aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/eval.php
Commit message (Collapse)AuthorAgeFilesLines
* Convert all array() syntax to []Kunal Mehta2016-02-171-1/+1
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Revert "Make eval.php try to handle newlines in code"MaxSem2015-02-231-16/+1
| | | | | | | | | | | | | | Completely broke the script for me. <TimStarling> MaxSem: that was a pretty crazy change <TimStarling> fancy trying to detect the end of a statement by shelling out to detect parse errors <TimStarling> maybe just revert that? <TimStarling> we can probably do a better job with a few regexes <TimStarling> I wonder how php -a does it This reverts commit f0ae292da7ef0673b30c68b4a6f3789b2eea8464. Change-Id: I16c9c200dc3f4db55cecc23aaa0d9ff55504c19d
* Make eval.php try to handle newlines in codeAaron Schulz2015-02-121-1/+16
| | | | Change-Id: I9f4664bde6bea6f0e1dca0f4623553b9e849c83b
* Remove $wgDebugFunctionEntry, unusedChad Horohoe2015-01-071-3/+0
| | | | Change-Id: I5f215ab2275333b329406ca7dda7b12fc0b9b6ec
* Fix incorrect replacement inside regular expressionAlexandre Emsenhuber2014-10-201-1/+1
| | | | | | | | Fix for Id3aa87cfa0 (2537ca2). The "$" is for the end of the string, not for a variable. Change-Id: I2d262582644b903992dc621079ea5a6a04d7af70
* Use prefixed globals in eval.php main loopTim Starling2014-10-201-18/+18
| | | | | | | | Use globals with less-common names so that variables created by the command line are less likely to conflict with the ones used by the eval.php loop. Change-Id: Id3aa87cfa039eb7555f44e17134c7cdbb5f25cc1
* Make it a bit safer to paste input to eval.phpAaron Schulz2014-01-091-2/+17
| | | | Change-Id: I0839678e3dec64a709c0fe8808329268f36486d2
* eval.php: update intro commentTim Starling2013-12-171-1/+0
| | | | | | PHP has had an interactive mode since 5.1.0. Change-Id: I5ecc35ca6c4911b4fbc8eb17866997d931c5a97d
* Rename wfIsHipHop() to wfIsHHVM()Chad Horohoe2013-10-291-1/+1
| | | | | | | | | | | | | | The former is only really used to refer to the older hphp compiler. Now all docs pretty much exclusively are referring to HHVM and that's the project's name going forward. While we're here, swap HPHP_VERSION for HHVM_VERSION. Either work, but the latter is more correct. Only affected extension (in Git or SVN) is GWToolset, fixing in I3a490ef. Change-Id: I81e4ce5d14e344e67045050261f91b3c0159f222
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-1/+1
| | | | | | | | | | | | | Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
* style: normalize end of filesAntoine Musso2013-02-031-2/+0
| | | | | | | | | | | | By PSR2 PHP Standard, the files should ends with exactly one newline. Some of our files have 2 or more and some other were missing a newline. Fix almost all occurences of CodeSniffer sniff: PSR2.Files.EndFileNewline.TooMany I have not fixed the selenium files, I believe we will drop them. Change-Id: I89fca8c1786fee94855b7b77bb0f364001ee84b6
* Remove a bunch of trailing spaces and unneeded newlinesumherirrender2012-10-101-1/+1
| | | | Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :) Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Revert r108777 (making eval subclass maintenance). eval's supposed to be in ↵Chad Horohoe2012-01-141-57/+42
| | | | | | | the global context. See r54839 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108942
* Maintenance class-ify eval.phpSam Reed2012-01-121-42/+57
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108777
* Fix typo in SpecialVersionSam Reed2012-01-121-8/+3
| | | | | | | | | | | Change require to require_once in commandLine.inc Make eval.php require an absolute path rather than just one in itself Simplify if statement Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108770
* Revert r107054: breaks execution of lines that might test or output '<?php' ↵Brion Vibber2012-01-031-5/+0
| | | | | | | | | | say when generating a PHP script Is apparently meant to strip an initial line from PHP script files being piped in, but is insufficient to actually catch all cases. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107952
* Fixed a typo in r107054Max Semenik2011-12-221-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107055
* do not evaluate '<?php' lineAntoine Musso2011-12-221-0/+5
| | | | | | | | | | | | | | | | | | | | This happen when you are sending to eval.php a php file. The first line is the string '<?php' which is passed to eval(). Boom! This patch skip that string. Example usage: $ cat somefile.php <?php echo "Working!\n"; $ $ cat somefile.php | php maintenance/eval.php Working! $ Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107054
* Removed $wgUseNormalUser var; not used by any scripts anymoreAaron Schulz2011-10-281-2/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101110
* (bug 30172) posix_isatty() fallback does not work when the function has been ↵Chad Horohoe2011-08-021-1/+1
| | | | | | | disabled (but exists). While we're at it, make things work for HipHop too. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93789
* Apply LoadBalancer related fixesSam Reed2011-04-181-2/+5
| | | | | | | | | Patches by Yuvi Panda From (bug 28583) Remove all /* private */ declarations in MediaWiki core Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86363
* The beginnings of HipHop compiled mode support. It works now for parser ↵Tim Starling2011-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | cache hits. * Work around HipHop issue 314 (volatile broken) and issue 308 (no compilation detection) by adding some large and ugly compilation detection code to WebStart.php and doMaintenance.php. * Provide an MW_COMPILED constant which can be used to detect compiled mode throughout the codebase. * Introduced wfIsHipHop(), which detects either compiled or interpreted mode. Used this to work around unusual eval() return value in eval.php. * Work around lack of ini_get() in Maintenance.php, by duplicating wfIsHipHop(). * In Maintenance::shouldExecute(), accept "include" as an inclusion function name, since all kinds of inclusion give this string in HipHop. * Introduced new class MWInit, which provides some static functions in the pre-autoloader environment. * Introduced MWInit::compiledPath(), which provides a relative path for invoking a compiled file, and MWInit::interpretedPath(), which provides an absolute path for interpreting a PHP file. Used these new functions in the appropriate places. * When we are running compiled code, don't include files which would generate duplicate class, function or constant definitions. Documented the new requirements on the contents of Defines.php and UtfNormalDefines.php. * In HipHop compiled mode, it's not possible to have executable code in the same file as a class definition. ** Moved MimeMagic initialisation to the constructor. ** Moved Namespace.php global variable initialisation to Setup.php. ** Moved MemcachedSessions.php initialisation to the caller in GlobalFunctions.php. ** Moved Sanitizer.php constants and global variables to static class members. Introduced an accessor function for the attribs regex, as a new place to put code formerly at file level. ** Moved Language.php initialisation of $wgLanguageNames to Language::getLanguageNames(). Removed the global variable, marked "private" since forever. * In two places: don't use error_log() with type=3 to append to a file, HipHop doesn't support it. Use file_put_contents() with FILE_APPEND instead. * Work around the terrible breakage of class_exists() by using MWInit::classExists() instead in various places. In WebInstaller::getPageByName(), the class_exists() was marked with a fixme comment already, so I replaced it with an autoloader solution. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85327
* Part of bug 26280: added license headers to PHP files in maintenanceAlexandre Emsenhuber2010-12-161-0/+15
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78508
* Trying to kill install-utils.inc/old install crap:Chad Horohoe2010-11-061-1/+1
| | | | | | | | | | | | | * Cripple the old installer (entry point is gone, supporting code immediately exits). Keeping the latter for reference still :) * Move posix_isatty() wrapper to Maintenance.php, all CLI scripts include this * Clarify docs on archive() deprecation and removal - hasn't been used going back thru 1.15 * Clarify docs on dbsource() deprecation and removal - was in wide use thru 1.15. 1.16 removed all extension usages * Move the two PHP bug tests to a file with the other installer files, moved them to more logical places in new install/update sequence * Remove mw_have_dl/mw_get_session_save_path, zero callers * Move readconsole() and helpers to be a static method on Maintenance, no extensions have used it since 1.15 either Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/76220
* Followup r72108, put the history file in $IP/maintenance rather than the ↵Chad Horohoe2010-09-031-1/+1
| | | | | | | cwd. Also add it to svnignore. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/72286
* $_ENV['HOME'] might not exist for everyone, doesn't on OSXChad Horohoe2010-09-011-1/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/72108
* Stylize maintenance folder..Sam Reed2010-05-221-5/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66751
* Define our own posix_isatty if posix extension is not installed.Platonides2010-04-111-1/+1
| | | | | | | | | | | Removes the extension dependency on non-windows for parserTests. Currently used on install-utils.inc readconsole(), eval.php and parserTests.inc Maintenance scripts receive it via commandLine.inc -> Maintenance.php .. doMaintenance.php -> install-utils.inc Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/64938
* Revert eval.php changes from r54653, r54312, r54225 (maintenance-work branch ↵Tim Starling2009-08-121-72/+48
| | | | | | | merge), these changes totally broke eval.php due to the change in scope, from global to function. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54839
* Move $wgUseNormalUser setting to constructors.Chad Horohoe2009-08-091-2/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54653
* Revert r54244 which was stupid and fix this properly. Require ↵Chad Horohoe2009-08-031-1/+1
| | | | | | | commandLine.inc/Maintenance.php using the full path every time. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54312
* Merge maintenance-work branch (now with less errors!):Chad Horohoe2009-08-021-48/+71
| | | | | | | | | | | * Docs have been updated to indicate the standard on how to write maintenance scripts (MW.org docs will follow) Have ported vast majority of maintenance scripts to new format. Remaining ones (mostly FiveUpgrade-related) are a bit more tricky. commandLine.inc is untouched for now. Many have gotten code-style updates as well. Deleted .inc files were only used by their .php counterparts, and have been merged into single files. * (bug 11867) Lock error on redirect table when running orphans.php * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params * (bug 18566) Maintenance script to un/protect pages * initStats overhaul, now uses class SiteStatsInit. Also fixes bug 18930 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54225
* Revert r52336 "Merge maintenance-work branch:"Brion Vibber2009-06-241-56/+47
| | | | | | | | Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks! Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52340
* Merge maintenance-work branch:Chad Horohoe2009-06-241-47/+56
| | | | | | | | | | | | * (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php * (bug 18768) Remove AdminSettings.php from MediaWiki core * (bug 19157) createAndPromote error on bad password * (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php * Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs. * Not deleting "unused" files yet, don't want to break everything at once :) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52336
* Use a history file with readline, so that readline history is carried over ↵Tim Starling2008-07-221-3/+16
| | | | | | | from one invocation to another Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/37926
* WARNING: HUGE COMMITAlexandre Emsenhuber2008-05-201-1/+2
| | | | | | | | | | | | | | | | | | Doxygen documentation update: * Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group. * Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file. * Removed some empty comments * Removed some ?> Added following groups: * ExternalStorage * JobQueue * MaintenanceLanguage One more thing: there are still a lot of warnings when generating the doc. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35098
* Removed usage of deprecated settingsAlexandre Emsenhuber2008-04-061-6/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/32855
* * Introduced LBFactory -- an abstract class for configuring database load ↵Tim Starling2008-03-301-2/+3
| | | | | | | | | | | | | | | | | | | balancers and connecting to foreign DBs. * Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. * Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. * Added ForeignDBViaLBRepo, a file repository which uses LBFactory. * Removed $wgLoadBalancer and $wgAlternateMaster * Improved the query group concept to allow failover and lag control * Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each. * Removed the $fail parameter to getConnection(), obsolete. * Removed the useless force() function. * Abstracted the replication position interface to allow for future non-MySQL support. * Rearranged Database.php. Added a few debugging features. * Removed ancient benet-specific hack from waitForSlave.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/32578
* Remove ?>'s from files. They're pointless, and just asking for people to ↵Aryeh Gregor2007-06-291-1/+1
| | | | | | | mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/23531
* Use Doxygen @addtogroup instead of phpdoc @package && @subpackageAntoine Musso2007-01-201-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/19502
* Remove some stray executable bitsBrion Vibber2006-04-041-0/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/13459
* * s~ +$~~Ævar Arnfjörð Bjarmason2006-01-071-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/12472
* Committing various live hacks from Wikimedia serversBrion Vibber2005-10-221-0/+22
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/11443
* * Code cleanupÆvar Arnfjörð Bjarmason2005-08-291-4/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/10828
* respect MW_WIKIUSER environment variableTim Starling2005-06-191-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/9483
* Various live patches ported from REL1_4Tim Starling2005-04-121-3/+9
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/8285
* Spiff this up a bit:Brion Vibber2004-11-151-5/+20
| | | | | | | | | * output data returned by the eval; prints strings and numbers directly, var_dump()s arrays and objects * if no returned data, print a line break. This makes things easier when doing 'echo' and you forget to add one yourself. * Add some documentation comments Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/6265
* Phpdoc comments and place holder. Part of the subpackage "maintenance", ↵Antoine Musso2004-09-031-1/+7
| | | | | | | archives in subpackage "maintenanceArchive" Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/5060
* using new commandLine.inc style, readconsole() moved to install-utils()Tim Starling2004-06-131-17/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/4059