MediaWiki REL1_33
|
Router for the php cli-server built-in webserver. More...
Go to the source code of this file.
Variables | |
if(!is_readable( $file)) | $ext = pathinfo( $file, PATHINFO_EXTENSION ) |
$f = fopen( $file, 'rb' ) | |
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) | $file = $_SERVER['SCRIPT_FILENAME'] |
$lines = explode( "\n", file_get_contents( "includes/libs/mime/mime.types" ) ) | |
if( $ext=='php') | else |
return | true |
Router for the php cli-server built-in webserver.
https://secure.php.net/manual/en/features.commandline.webserver.php
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 router.php.
if (!is_readable($file)) $ext = pathinfo( $file, PATHINFO_EXTENSION ) |
Definition at line 48 of file router.php.
Referenced by ResourceLoaderImage\__construct(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendFileExtensions(), PHPVersionCheck\checkExtensionExistence(), UploadBase\checkFileExtension(), UploadBase\checkFileExtensionList(), UploadFromChunks\concatenateChunks(), HTTPFileStreamer\contentTypeFromPath(), StreamFile\contentTypeFromPath(), Installer\dirIsExecutable(), LocalFileDeleteBatch\doDBInserts(), FSFileBackend\doGetLocalCopyMulti(), MemoryFileBackend\doGetLocalCopyMulti(), SwiftFileBackend\doGetLocalCopyMulti(), SpecialVersion\execute(), ApiImageRotate\execute(), LocalFileDeleteBatch\execute(), WebInstallerOptions\execute(), FileBackend\extensionFromPath(), TempFSFile\factory(), ImportImages\findFiles(), File\getArchiveThumbUrl(), File\getArchiveUrl(), MediaWiki\Revision\MainSlotRoleHandler\getDefaultModel(), MediaStatisticsPage\getExtensionList(), ApiFormatBase\getFilename(), CSSMin\getMimeType(), ResourceLoaderImage\getMimeType(), IEContentAnalyzer\getMimeTypeForVersion(), ApiBase\getModuleSourceInfo(), MWFileProps\getPropsFromPath(), FSFile\getPropsFromPath(), File\getStorageKey(), MediaHandler\getThumbType(), UploadBase\getTitle(), File\getUrl(), FileRepo\getZoneUrl(), ForeignAPIRepo\getZoneUrl(), File\getZoneUrl(), FileBackendGroup\guessMimeInternal(), MediaWiki\OutputHandler\handleGzip(), LocalRepo\hiddenFileHasKey(), ChannelFeed\httpHeaders(), moveToExternal(), FileRepo\nameForThumb(), ImagePage\openShowImage(), AutoloadGenerator\readDir(), GenerateSitemap\sitemapFilename(), WebInstallerOptions\submit(), MimeAnalyzerTest\testImproveTypeFromExtension(), and wfLoadExtensions().
$f = fopen( $file, 'rb' ) |
Definition at line 79 of file router.php.
Referenced by MemcachedClient\_flush_read_buffer(), ImportableUploadRevisionImporter\downloadSource(), ImportImages\execute(), ForeignAPIRepo\fileExistsBatch(), ImportImages\findAuxFile(), JSParser\FunctionDefinition(), BmpHandler\getImageSize(), Maintenance\getStdin(), XCFHandler\getXCFMetaData(), JSParser\parse(), ConverterRule\parseFlags(), RevisionDbTestBase\provideNewFromArchiveRow(), ChangesList\recentChangesFlags(), ImageGalleryBase\setShowBytes(), ImageGalleryBase\setShowDimensions(), ImageGalleryBase\setShowFilename(), StoreBatchTest\storecohort(), ChangesListFilterGroupTest\testAutoPriorities(), FileRepoTest\testFileRepoConstructionWithRequiredOptions(), TextContentTest\testGetParserOutput(), IPTest\testInvalidIPs(), GlobalTest\testReadOnlySet(), IPTest\testValidIPs(), and SpecialWhatLinksHere\whatlinkshereForm().
if(PHP_SAPI !='cli-server') if (!isset($_SERVER[ 'SCRIPT_FILENAME'])) $file = $_SERVER['SCRIPT_FILENAME'] |
Definition at line 42 of file router.php.
Referenced by DumpPipeOutput\__construct(), DumpBZip2Output\__construct(), DumpDBZip2Output\__construct(), DumpFileOutput\__construct(), DumpGZipOutput\__construct(), DumpLBZip2Output\__construct(), Dump7ZipOutput\__construct(), UnlistedSpecialPage\__construct(), IncludableSpecialPage\__construct(), ImageBuilder\addMissingImage(), OutputPage\addScriptFile(), HHVMMakeRepo\appendDir(), Wikimedia\Rdbms\DatabaseSqlite\attachDatabase(), AutoLoader\autoload(), OutputPage\buildCssLinksArray(), GIFHandler\canAnimateThumbnail(), ApiDelete\canDeleteFile(), ImageHandler\canRender(), TiffHandler\canRender(), WebPHandler\canRender(), XCFHandler\canRender(), AutoLoaderStructureTest\checkAutoLoadConf(), FindOrphanedFiles\checkFiles(), Sqlite\checkSqlSyntax(), UploadBase\checkXMLEncodingMissmatch(), ForeignResourceManager\cleanUp(), ImagePage\delete(), UploadFromUrlTest\deleteFile(), ApiDelete\deleteFile(), ApiUploadTestCase\deleteFileByTitle(), FileBackendTest\deleteFiles(), ParserTestRunner\deleteFiles(), MigrateFileRepoLayoutTest\deleteFilesRecursively(), UploadBase\detectScript(), UploadBase\detectVirus(), Installer\dirIsExecutable(), SpecialRedirect\dispatchFile(), PopulateImageSha1\doDBUpdates(), FileOpPerfTest\doPerfTest(), RevDelFileList\doPostCommitUpdates(), UploadBase\doStashFile(), MovePageForm\doSubmit(), FileBackendTest\doTestDoQuickOperations(), FileBackendTest\doTestGetDirectoryList(), FileBackendTest\doTestGetFileList(), DjVuImage\dump(), DjVuImage\dumpForm(), ParserTestPrinter\dumpToFile(), MediaWiki\Logger\LegacyLogger\emit(), ApiFormatBaseTest\encodeData(), CSSMin\encodeImageAsDataURI(), SpecialUndelete\execute(), SpecialVersion\execute(), ApiImageRotate\execute(), ApiQueryFilearchive\execute(), ApiQueryStashImageInfo\execute(), BenchmarkCSSMin\execute(), BenchmarkJavaScriptMinifier\execute(), BenchmarkTidy\execute(), CheckImages\execute(), CleanupUploadStash\execute(), CreateCommonPasswordCdb\execute(), DeleteArchivedFiles\execute(), DeleteBatch\execute(), EraseArchivedFile\execute(), ExportSites\execute(), FindDeprecated\execute(), FindHooks\execute(), FindMissingFiles\execute(), HHVMMakeRepo\execute(), ImportImages\execute(), ImportSites\execute(), ImportTextFiles\execute(), InvalidateUserSesssions\execute(), GenerateNormalizerDataAr\execute(), MigrateFileRepoLayout\execute(), MoveBatch\execute(), PatchSql\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), MwSql\execute(), UpdateMediaWiki\execute(), UpdateSearchIndex\execute(), ResourceLoaderFileModule\expandPackageFiles(), ResourceLoaderOOUIFileModule\extendSkinSpecific(), ExtensionProcessor\extractExtensionMessagesFiles(), ExtensionProcessor\extractMessagesDirs(), FormatMetadata\fetchExtendedMetadata(), Parser\fetchFileAndTitle(), Parser\fetchFileNoRegister(), FileRepo\fileExists(), FileRepo\fileExistsBatch(), ForeignAPIRepo\fileExistsBatch(), CoreParserFunctions\filepath(), DumpUploads\filterItem(), ImportImages\findAuxFile(), LocalRepo\findBySha1s(), RiffExtractor\findChunks(), RiffExtractor\findChunksFromFile(), Installer\findExtensionsByType(), RepoGroup\findFileFromKey(), ImportImages\findFiles(), FileRepo\findFiles(), LocalRepo\findFiles(), ParserEditTests\findTest(), SpecialUndelete\formatFileRow(), SvgHandler\formatMetadata(), ImageListPager\formatValue(), GenerateCollationData\generateFirstChars(), SvgHandler\getAvailableLanguages(), ImageHistoryPseudoPager\getBody(), MWDebug\getCallerDescription(), ExifBitmapHandler\getCommonMetaArray(), SvgHandler\getCommonMetaArray(), FileContentHandler\getDataForSearchIndex(), PurgeChangedFiles\getDeletedPath(), UploadForm\getDescriptionSection(), DjVuHandler\getDimensionInfo(), ImageHandler\getDimensionsString(), SpecialUpload\getDupeWarning(), WikiFilePage\getDuplicates(), MediaHandler\getEntireText(), SpecialUpload\getExistsWarning(), UploadBase\getExistsWarning(), SpecialVersion\getExtAuthorsFileName(), FormatMetadata\getExtendedMetadataFromFile(), FormatMetadata\getExtendedMetadataFromHook(), SpecialVersion\getExtLicenseFileName(), SpecialUndelete\getFileComment(), ImportImages\getFileCommentFromSourceWiki(), WebInstallerDocument\getFileContents(), SpecialUndelete\getFileLink(), WebRequest\getFileName(), MWDebug\getFilesIncluded(), WebRequest\getFileTempname(), SpecialUndelete\getFileUser(), ImportImages\getFileUserFromSourceWiki(), WikiFilePage\getForeignCategories(), MediaHandler\getGeneralLongDesc(), MediaHandler\getGeneralShortDesc(), ImagePage404Test\getImagePage(), ImagePageTest\getImagePage(), SvgHandler\getImageSize(), WebPHandler\getImageSize(), ApiQueryImageInfo\getInfo(), DjVuImage\getInfo(), ImagePage\getLanguageForRendering(), GIFHandler\getLength(), PNGHandler\getLength(), MWExceptionHandler\getLogMessage(), MWExceptionHandler\getLogNormalMessage(), ImageHandler\getLongDesc(), MediaHandler\getLongDesc(), SvgHandler\getLongDesc(), Language\getMessagesFileName(), CSSMin\getMimeType(), DjVuImage\getMultiPageInfo(), InstallerOverrides\getOverrides(), DjVuImage\getPageInfo(), SpecialFilepath\getRedirect(), ExifBitmapHandler\getRotation(), ResourceLoaderFileModule\getScriptURLsForDebug(), ImageHandler\getShortDesc(), MediaHandler\getShortDesc(), SpecialPageAliasTest\getSpecialPageAliases(), ResourceLoaderFileModule\getStyleURLsForDebug(), ImageHistoryList\getThumbForLine(), LocalFile\getThumbnails(), ForeignAPIFile\getThumbnails(), TransformationalImageHandler\getThumbnailSource(), DjVuHandler\getUnserializedMetadata(), WebRequest\getUploadError(), MWExceptionHandler\handleError(), ConvertExtensionToRegistration\handleExtensionMessagesFiles(), MWExceptionHandler\handleFatalError(), ForeignResourceManager\handleTypeMultiFile(), ForeignResourceManager\handleTypeTar(), ThumbnailRenderJob\hitThumbUrl(), RemexDriverTest\html5libProvider(), ImageBuilder\imageCallback(), ImagePage\imageDupes(), ImageHistoryList\imageHistoryLine(), ImportableUploadRevisionImporter\import(), SiteImporter\importFromFile(), BackupReader\importFromFile(), BackupReader\importFromStdin(), UploadStash\initFile(), MediaWiki\initializeArticle(), AutoloadGenerator\initMediaWikiDefault(), SvgHandler\isAnimatedImage(), DjVuHandler\isExpensiveToThumbnail(), TiffHandler\isExpensiveToThumbnail(), TransformationalImageHandler\isImageAreaOkForThumbnaling(), MovePage\isValidFileMove(), Title\isValidMoveTarget(), MovePage\isValidMoveTarget(), JobRunner\loadBackoffs(), Benchmarker\loadFile(), BackupDumper\loadPlugin(), Wikimedia\Services\ServiceContainer\loadWiringFiles(), RecompressTracked\logToFile(), Parser\makeImage(), DummyLinker\makeImageLink(), Linker\makeImageLink(), DummyLinker\makeMediaLinkFile(), Linker\makeMediaLinkFile(), SqliteInstaller\makeStubDBFile(), DummyLinker\makeThumbLink2(), Linker\makeThumbLink2(), DummyLinker\makeThumbLinkObj(), Linker\makeThumbLinkObj(), MovePage\moveFile(), TransformationalImageHandler\mustRender(), ImportStreamSource\newFromFile(), ArchivedFile\newFromRow(), ForeignDBFile\newFromRow(), LocalFile\newFromRow(), OldLocalFile\newFromRow(), ImportStreamSource\newFromURL(), ImageBuilder\oldimageCallback(), DumpUploads\outputItem(), SpecialUploadStash\outputLocalFile(), SpecialUploadStash\outputLocallyScaledThumb(), SpecialUploadStash\outputRemoteScaledThumb(), SpecialUploadStash\outputThumbFromStash(), SpecialUploadStash\parseKey(), ApiUpload\performUpload(), ExtensionRegistry\processAutoLoader(), BackupDumper\processOptions(), DummyLinker\processResponsiveImages(), Linker\processResponsiveImages(), ResourcesTest\provideMediaStylesheets(), AutoLoaderStructureTest\providePSR4Completeness(), ResourcesTest\provideResourceFiles(), FileContentsHasherTest\provideSingleFile(), PruneFileCache\prune_directory(), FileRepo\publishBatch(), PurgeChangedFiles\purgeFromArchiveTable(), PurgeChangedFiles\purgeFromLogType(), LocalFile\purgeOldThumbnails(), LocalFile\purgeThumbList(), ForeignAPIFile\purgeThumbnails(), LocalFile\purgeThumbnails(), DjVuImage\readChunk(), AutoloadGenerator\readDir(), ResourceLoaderFileModule\readStyleFile(), ResourceLoaderFileModule\readStyleFiles(), CSSMin\remap(), CSSMin\remapOne(), MediaWiki\Widget\Search\FullSearchResultWidget\render(), Parser\renderImageGallery(), CheckStorage\restoreText(), BitmapHandler\rotate(), JpegHandler\rotate(), ApiQueryAllImages\run(), ApiQueryDuplicateFiles\run(), ThumbnailRenderJob\run(), ImagePage\setFile(), WikiFilePage\setFile(), OutputPage\setFileVersion(), ImportLinkCacheIntegrationTest\setUp(), Dump7ZipOutput\setup7zCommand(), MediaWiki\Tests\Maintenance\DumpTestCase\setUpBeforeClass(), ParserEditTests\setupFileData(), SpecialUndelete\showFileConfirmationForm(), EditPage\showIntro(), SpecialUploadStash\showUploads(), SpecialUpload\showUploadWarning(), DjVuImage\skipChunk(), TextSuppressor\suppress(), CheckStyleSuppressor\suppress(), JobRunner\syncBackoffDeltas(), FileTest\testCanAnimateThumbIfAppropriate(), SvgHandlerTest\testGetAvailableLanguages(), GIFHandlerTest\testGetImageArea(), PNGHandlerTest\testGetImageArea(), XCFHandlerTest\testGetImageSize(), GIFHandlerTest\testGetIndependentMetaArray(), PNGHandlerTest\testGetIndependentMetaArray(), SvgHandlerTest\testGetIndependentMetaArray(), JpegTest\testGetIndependentMetaArray(), GIFHandlerTest\testGetLength(), PNGHandlerTest\testGetLength(), GIFHandlerTest\testGetMetadata(), PNGHandlerTest\testGetMetadata(), XCFHandlerTest\testGetMetadata(), DjVuTest\testGetPageDimensions(), DjVuTest\testGetPageText(), BitmapScalingTest\testImageArea(), SiteImporterTest\testImportFromFile(), FormatMetadataTest\testInvalidDate(), JpegTest\testInvalidFile(), GIFHandlerTest\testIsAnimanted(), PNGHandlerTest\testIsAnimanted(), JpegTest\testJpegMetadataExtraction(), ExifRotationTest\testMetadata(), ExifRotationTest\testMetadataAutoRotate(), ExifRotationTest\testMetadataAutoRotateUnsupported(), ExifRotationTest\testMetadataNoAutoRotate(), MimeAnalyzerTest\testMP3AsAudio(), MimeAnalyzerTest\testMP3NoID3RecognizeMPEG1(), MimeAnalyzerTest\testMP3NoID3RecognizeMPEG2(), MimeAnalyzerTest\testMP3NoID3RecognizeMPEG2_5(), MimeAnalyzerTest\testMP3WithID3Recognize(), BitmapScalingTest\testNormaliseParams(), SvgHandlerTest\testNormaliseParamsInternal(), DjVuTest\testPageCount(), JpegPixelFormatTest\testPixelFormatRendering(), AutoLoaderStructureTest\testPSR4Completeness(), ExifRotationTest\testRotationRendering(), ExifRotationTest\testRotationRenderingNoAutoRotate(), JpegTest\testSwappingICCProfile(), UploadStashTest\testT31408(), BitmapScalingTest\testTooBigImage(), BitmapScalingTest\testTooBigMustRenderImage(), JpegMetadataExtractorTest\testUtf8Comment(), ExtensionJsonValidatorTest\testValidate(), LocalFileTest\testWfLocalFile(), MimeAnalyzerTest\testZipInDoc(), Language\transformUsingPairFile(), ApiUpload\transformWarnings(), UploadBase\tryStashFile(), wfBacktrace(), wfExtractThumbParams(), wfGenerateThumbnail(), wfGetPrecompiledData(), wfIsBadImage(), wfThumbIsStandard(), and XmlDumpWriter\writeUpload().
$lines = explode( "\n", file_get_contents( "includes/libs/mime/mime.types" ) ) |
Definition at line 61 of file router.php.
Referenced by DiffOpDelete\__construct(), DiffOpAdd\__construct(), DiffFormatter\added(), TableDiffFormatter\added(), UnifiedDiffFormatter\added(), Skin\addToSidebarPlain(), ReleaseNotesTest\assertFileLength(), Diff\closing(), WordLevelDiff\closing(), DiffFormatter\context(), TableDiffFormatter\context(), DiffFormatter\deleted(), TableDiffFormatter\deleted(), UnifiedDiffFormatter\deleted(), Parser\doAllQuotes(), Parser\doTableStuff(), Installer\envCheckShellLocale(), MediaWiki\Shell\Command\execute(), MediaWiki\Tests\Maintenance\DumpTestCase\expectETAOutput(), HTMLFormField\formatErrors(), UploadBase\getFilenamePrefixBlacklist(), WikiTextStructure\getIgnoredHeadings(), RandomImageGenerator\getRandomLines(), RandomImageGenerator\getRandomWordPairs(), FormatMetadata\getVisibleFields(), SearchHighlighter\highlightSimple(), Block\isWhitelistedFromAutoblocks(), DiffFormatter\lines(), UnifiedDiffFormatter\lines(), Diff\orig(), WordLevelDiff\orig(), ForeignResourceManager\parseBasicYaml(), WikiTextStructure\parseSettingsInMessage(), SquidPurgeClient\processReadBuffer(), EnhancedChangesList\recentChangesBlockGroup(), Parser\renderImageGallery(), DiffEngine\shiftBoundaries(), WordLevelDiff\split(), HashRingTest\testHashRingKetamaMode(), wfIsBadImage(), and MediaWiki\Logger\Monolog\MwlogHandler\write().
foreach( $lines as $line) if (preg_match('#^text/#', $mime) else) |
Definition at line 52 of file router.php.
return true |
Definition at line 82 of file router.php.