MediaWiki  REL1_24
eval.php File Reference

This script lets a command-line user start up the wiki engine and then poke about by issuing PHP commands directly. More...

Go to the source code of this file.

Variables

if($useReadline) $e = null
 $optionsWithArgs = array( 'd' )
if(isset($options['d'])) $useReadline
while(($line=Maintenance::readconsole())!==false)
print 
n

Detailed Description

This script lets a command-line user start up the wiki engine and then poke about by issuing PHP commands directly.

Unlike eg Python, you need to use a 'return' statement explicitly for the interactive shell to print out the value of the expression. Multiple lines are evaluated separately, so blocks need to be input without a line break. Fatal errors such as use of undeclared functions can kill the shell.

To get decent line editing behavior, you should compile PHP with support for GNU readline (pass --with-readline to configure).

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 eval.php.


Variable Documentation

if ($useReadline) $e = null

Definition at line 66 of file eval.php.

Referenced by SpecialUploadStash\__construct(), ORAResult\__construct(), MimeMagic\__construct(), RedisBagOStuff\add(), BackupDumperPageTest\addDBData(), TextPassDumperTest\addDBData(), ApiQueryContinue2Test\addDBData(), ApiQueryContinueTest\addDBData(), ApiQueryBasicTest\addDBData(), BackupDumperLoggerTest\addDBData(), SVGMetadataExtractorTest\assertMetadata(), ApiQueryTestBase\assertResult(), SpecialChangePassword\attemptReset(), Sqlite\checkSqlSyntax(), MessageBlobStore\clear(), DatabaseMssql\delete(), DatabaseMssql\deleteJoin(), profile_point\display(), SpecialImport\doImport(), TestFileOpPerformance\doPerfTest(), DeferredUpdates\doUpdates(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiUpload\execute(), JSParseHelper\execute(), MwSql\execute(), PPFuzzTester\execute(), ApiFeedWatchlist\execute(), ZipDirectoryReader\execute(), Message\extractParam(), TrackBlobs\findOrphanBlobs(), UploadForm\getDescriptionSection(), BmpHandler\getImageSize(), RequestContext\getLanguage(), GIFHandler\getMetadata(), PNGHandler\getMetadata(), TiffHandler\getMetadata(), JpegHandler\getMetadata(), SvgHandler\getMetadata(), DjVuHandler\getMetaTree(), NewFilesPager\getStartBody(), SpecialRandomInCategory\getTimestampOffset(), MWExceptionHandler\handle(), DatabaseMssql\insert(), MessageBlobStore\insertMessageBlob(), DatabaseMssql\insertSelect(), ProfilerSimpleDB\logData(), JSMinPlus\min(), SpecialChangePassword\onSubmit(), MysqlInstaller\openConnection(), OracleInstaller\openConnection(), MssqlInstaller\openConnection(), PostgresInstaller\openConnectionWithParams(), OracleInstaller\openSYSDBAConnection(), lessc_parser\parseChunk(), PreprocessDump\processRevision(), lessc\pushEnv(), ApiQueryContinueTestBase\query(), PostgreSqlLockManager\releaseAllLocks(), AssembleUploadChunksJob\run(), PublishStashedFileJob\run(), ApiQueryWatchlist\run(), Hooks\run(), ApiQueryRecentChanges\run(), DatabaseMssql\selectDB(), UserMailer\send(), JobQueueTest\setUp(), PostgresInstaller\setupPLpgSQL(), PostgresInstaller\setupSchema(), MysqlInstaller\setupUser(), PostgresInstaller\setupUser(), SpecialUploadStash\showUpload(), MWCryptHKDF\singleton(), MssqlInstaller\submitSettingsForm(), MysqlInstaller\submitSettingsForm(), ApiMainTest\testAssert(), UserNotLoggedInTest\testConstruction(), ReadOnlyErrorTest\testConstruction(), ErrorPageErrorTest\testConstruction(), ApiEditPageTest\testEditSection(), BadTitleErrorTest\testExceptionSetsStatusCode(), ThrottledErrorTest\testExceptionSetsStatusCode(), ResourceLoaderTest\testGetLoadScript(), MWExceptionHandlerTest\testGetRedactedTrace(), MWExceptionTest\testisCommandLine(), MWExceptionTest\testIsLogable(), UploadFromUrlTest\testLeaveMessage(), HtmlCheckMatrixTest\testPlainInstantiation(), ErrorPageErrorTest\testReport(), MWExceptionTest\testRunHooks(), UploadFromUrlTest\testSetupUrlDownload(), ApiUploadTest\testUpload(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadMissingParams(), ApiUploadTest\testUploadRequiresToken(), ApiUploadTest\testUploadSameContent(), ApiUploadTest\testUploadSameFileName(), ApiUploadTest\testUploadStash(), ApiUploadTest\testUploadZeroLength(), MWExceptionTest\testUseMessageCache(), MWExceptionTest\testUseOutputPage(), BitmapHandler\transformImageMagickExt(), DatabaseMssql\update(), MessageBlobStore\updateMessage(), MessageBlobStore\updateModule(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionSha1\upgradeRow(), wfGenerateThumbnail(), wfLogProfilingData(), wfStreamThumb(), and wfTimestamp().

$optionsWithArgs = array( 'd' )

Definition at line 33 of file eval.php.

if (isset($options['d'])) $useReadline
Initial value:
 function_exists( 'readline_add_history' )
    && Maintenance::posix_isatty( 0  )

Definition at line 57 of file eval.php.

Referenced by MwSql\execute().

Definition at line 67 of file eval.php.