MediaWiki
1.23.2
|
PHP script to stream out an image thumbnail. More...
Go to the source code of this file.
Functions | |
wfExtractThumbParams ( $file, $params) | |
Convert a thumbnail name (122px-foo.png) to parameters, using file handler. More... | |
wfExtractThumbRequestInfo ( $thumbRel) | |
Convert pathinfo type parameter, into normal request parameters. More... | |
wfStreamThumb (array $params) | |
Stream a thumbnail specified by parameters. More... | |
wfThumbAttemptKey (File $img, $thumbName) | |
wfThumbError ( $status, $msg) | |
Output a thumbnail generation error message. More... | |
wfThumbHandle404 () | |
Handle a thumbnail request via thumbnail file URL. More... | |
wfThumbHandleRequest () | |
Handle a thumbnail request via query parameters. More... | |
wfThumbIncrAttemptFailures (File $img, $thumbName) | |
wfThumbIsAttemptThrottled (File $img, $thumbName, $limit) | |
Variables | |
$factory = wfGetLBFactory() | |
$wgTrivialMimeDetection = true | |
if(defined( 'THUMB_HANDLER')) | else |
const | MW_NO_OUTPUT_COMPRESSION 1 |
PHP script to stream out an image thumbnail.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
Definition in file thumb.php.
wfExtractThumbParams | ( | $file, | |
$params | |||
) |
Convert a thumbnail name (122px-foo.png) to parameters, using file handler.
Definition at line 448 of file thumb.php.
References $file, $matches, $params, $size, array(), list, wfDeprecated(), and wfRunHooks().
Referenced by wfStreamThumb().
wfExtractThumbRequestInfo | ( | $thumbRel | ) |
Convert pathinfo type parameter, into normal request parameters.
So for example, if the request was redirected from /w/images/thumb/a/ab/Foo.png/120px-Foo.png. The $thumbRel parameter of this function would be set to "a/ab/Foo.png/120px-Foo.png". This method is responsible for turning that into an array with the folowing keys:
Transform specific parameters are set later via wfExtractThumbParams().
$thumbRel | String Thumbnail path relative to the thumb zone |
Definition at line 410 of file thumb.php.
References $params, array(), list, and RepoGroup\singleton().
Referenced by wfThumbHandle404().
wfStreamThumb | ( | array | $params | ) |
Stream a thumbnail specified by parameters.
$params | Array List of thumbnailing parameters. In addition to parameters passed to the MediaHandler, this may also includes the keys: f (for filename), archived (if archived file), temp (if temp file), w (alias for width), p (alias for page), r (ignored; historical), rel404 (path for render on 404 to verify hash path correct), thumbName (thumbnail name to potentially extract more parameters from e.g. 'lossy-page1-120px-Foo.tiff' would add page, lossy and width to the parameters) |
Definition at line 105 of file thumb.php.
References $e, $params, $response, $section, $title, $user, are, array(), based, false, User\getGroupPermissions(), RequestContext\getMain(), HttpStatus\getMessage(), global, however, Title\makeTitleSafe(), name, NS_FILE, on, PROTO_CURRENT, File\RENDER_NOW, RepoGroup\singleton(), text, File\THUMB_FULL_NAME, TS_UNIX, wfExpandUrl(), wfExtractThumbParams(), wfLocalFile(), wfMessage(), wfRestoreWarnings(), wfSuppressWarnings(), wfThumbError(), wfThumbIncrAttemptFailures(), wfThumbIsAttemptThrottled(), wfTimestamp(), and will.
Referenced by wfThumbHandle404(), and wfThumbHandleRequest().
wfThumbAttemptKey | ( | File | $img, |
$thumbName | |||
) |
File | $img | |
string | $thumbName |
Definition at line 384 of file thumb.php.
References File\getName(), File\getRepo(), global, and wfMemcKey().
Referenced by wfThumbIncrAttemptFailures(), and wfThumbIsAttemptThrottled().
wfThumbError | ( | $status, | |
$msg | |||
) |
Output a thumbnail generation error message.
$status | integer |
$msg | string |
Definition at line 506 of file thumb.php.
References $debug, global, title, and wfHostname().
Referenced by wfStreamThumb(), and wfThumbHandle404().
wfThumbHandle404 | ( | ) |
Handle a thumbnail request via thumbnail file URL.
Definition at line 64 of file thumb.php.
References $matches, $params, $wgArticlePath, WebRequest\getPathInfo(), global, RepoGroup\singleton(), wfExtractThumbRequestInfo(), wfStreamThumb(), and wfThumbError().
wfThumbHandleRequest | ( | ) |
Handle a thumbnail request via query parameters.
Definition at line 51 of file thumb.php.
References $params, and wfStreamThumb().
wfThumbIncrAttemptFailures | ( | File | $img, |
$thumbName | |||
) |
File | $img | |
string | $thumbName |
Definition at line 368 of file thumb.php.
References $wgMemc, global, and wfThumbAttemptKey().
Referenced by wfStreamThumb().
wfThumbIsAttemptThrottled | ( | File | $img, |
$thumbName, | |||
$limit | |||
) |
File | $img | |
string | $thumbName | |
int | $limit |
Definition at line 358 of file thumb.php.
References $limit, $wgMemc, global, and wfThumbAttemptKey().
Referenced by wfStreamThumb().
$factory = wfGetLBFactory() |
$wgTrivialMimeDetection = true |
Definition at line 28 of file thumb.php.
Referenced by StreamFile\contentTypeFromPath().
if (defined('THUMB_HANDLER')) else |