Commit graph

129 commits

Author SHA1 Message Date
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
Chad Horohoe
cd1a039320 Remove some PHP 5.2 cruft (we already bailed for < 5.3.2)
Change-Id: I7057c2e0f389095b9d6191e6fdee0c6ff2f97bd8
2012-09-24 10:43:30 -04:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00
Reedy
248ff9e925 (bug 40302) Lock user table with LOCK TABLES
Change-Id: I26905c29e004a4c7df82fd38aab908287daf193e
2012-09-17 19:17:11 +01:00
daniel
ff03cf38cc get rid of Revision::getText
Change-Id: Ia0b16813fa1688b6faccbe8ca81b1099001b1f3b
2012-09-14 18:23:21 +02:00
Hoo man
d13c6fa967 Follow up to dirname( __FILE__ ) clean up
Remove a trailing whitespace added by me in dirname( __FILE__ )
clean up and add some comments to the PHP version checks (they
can't use __DIR__ as they have to run in older PHP versions.

Change-Id: I6a7e8cb7dbf384d91dda4d0ecbef7ce588bc3073
2012-08-28 23:47:56 +02:00
Hoo man
8ffbb077b3 Use __DIR__ instead of dirname( __FILE__ )
Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments.
Running the PHP version test in maintenance/Maintenance.php earlier, so that
we no longer have to stay PHP < 5.3 compatible in there.

Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
2012-08-27 23:58:28 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
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
2012-08-27 21:45:00 +02:00
Tim Starling
6a79e09d6f Merge "Various updates needed to bump min php version to 5.3.2" 2012-05-04 12:44:57 +00:00
Reedy
f1bec81eba Various updates needed to bump min php version to 5.3.2
Change-Id: I22015387e4ac5839a907059086d787f352746886
2012-04-16 15:38:22 +01:00
Christian Aistleitner
0c33345146 fwriting to STDOUT -> print in Maintenance
Change-Id: I50dec90893a5dc88a5deabcc05a8c32058aca4c8
2012-04-15 20:59:07 +02:00
Reedy
d1f9213c81 Document $mDb
Change-Id: I971820ba14d08f23c2eec570183ab851e48debfc
2012-04-07 22:07:41 +01:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Sam Reed
c8eb4467f1 Fix user related direct member variable access 2012-02-16 00:54:34 +00:00
Sam Reed
e63c1a4fb1 gearman has been nuked
Ping r110958
2012-02-15 21:06:13 +00:00
Sam Reed
f3f180850a Fixing up undefined types in maintenance documentation 2012-02-09 21:08:06 +00:00
Antoine Musso
46546f0519 Fix doc for maintenance/ 2012-02-08 16:55:54 +00:00
Sam Reed
5ef630a3b3 Braces, spaces, documentation 2011-11-20 18:02:38 +00:00
Platonides
7bf57a29b9 Follow-up r103179: $handled variable undefined 2011-11-15 16:27:16 +00:00
Chad Horohoe
bb45c5e8a3 Address fixme on r101644 (bug 32325, bug 32263), originally for bug 31822. PHP 5.2 below 5.2.7 throws a warning when you try to fopen() in append mode. Fixed by only fwrite()ing to STDIN|STDERR when in cli, use print otherwise (per Tim's suggestion).
People didn't seem to like the idea of bumping the minimum version to 5.2.7 since some distros like being behind the times.
2011-11-15 15:04:36 +00:00
Chad Horohoe
f0683c2351 (bug 31822) Error during upgrade due to output buffer reset in stdout.
In various places in Maintenance, we're overwriting our output buffer rather than appending to it. This doesn't matter too much in the CLI, but it can corrupt headers when upgrading from the web. Thanks Woozle for pointing this out.
2011-11-02 18:03:46 +00:00
Sam Reed
2f23e71490 arrray -> array
Whitespace

Other documentation improvements

Comment out some unused code (which has a fixme left with it already)
2011-11-01 23:48:09 +00:00
Aaron Schulz
d6ac929842 Added default updateSkippedMessage() message 2011-10-27 18:37:11 +00:00
Sam Reed
e336b5e951 Remove some unused getting of non existent arguments
Documentation
2011-10-18 17:31:54 +00:00
Chad Horohoe
41f7e84068 Tweaks to LoggedUpdateMaintenance:
* Reduce some duplication
* Prefix skipped steps with "..." per updater convention
* Make PopulateLogUsertext, PopulateLogSearch and PopulateParentId use LoggedUpdateMaintenance -- now they will properly log when there was "Nothing to do" and we can skip the clutter on future update runs
* Docs, etc.
2011-09-08 15:52:00 +00:00
Chad Horohoe
321de8502c Tweaks to WikimediaMaintenance:
* Rename Site to WMFSite, less likely to conflict
* Create generic inclusion point for these scripts, so they don't have to duplicate the $IP detection
* Make them all subclass WikimediaMaintenance and move some of the wmf-specific hacks out of core -- almost resolved this crap :D
* Fix rebuildInterwiki to be protocol-relative (like r96139)
* By the way: rebuildInterwiki and dumpInterwiki seem awfully alike...maybe we can merge the two :)
2011-09-08 00:35:16 +00:00
Brian Wolff
ddc1d23149 New maintenance script for refreshing image metadata (refreshImageMetadata.php)
This is very similar to rebuildImages.php, except more specific to img_metadata field,
and does the images in batches instead of all at once.

Also, while I'm here, I added a line to Maintenance.php to make sure it casted
$this->mBatchSize to an integer when gotten from command line (thought it was weird
that it didn't do that)

(I'm going to tag this revision 1.18 because I think it'd be nice to have this script
in 1.18 given new image metadata stuff added in 1.18, but not super-important
because rebuildImages.php does already work to refresh image metadata)
2011-08-25 05:33:32 +00:00
Brian Wolff
eb013851a5 Move the check for if a Maintenance script supports --batch-size away from addDefaultParams()
and to setBatchSize(), since setBatchSize is usually called in a subclass constructor after
parent:__construct() which is after addDefaultParams() is called.

Upside of this is lots of scripts supporting --batch-size now list it in their help output.
2011-08-25 05:15:45 +00:00
Aaron Schulz
977ce7e45e Restored r94370 changes PopulateRevisionLen, moving it to $postDatabaseUpdateMaintenance 2011-08-15 18:52:25 +00:00
Aaron Schulz
7cb4d69d9d Changed PopulateImageSha1 to use LoggedUpdateMaintenance and added it to $postDatabaseUpdateMaintenance 2011-08-12 20:37:35 +00:00
Aaron Schulz
18f5bf2c95 * Added LoggedUpdateMaintenance subclass
* Moved PopulateRevisionLength/PopulateRevisionSha1 scripts to $postDatabaseUpdateMaintenance
* Fixed bogus "{$prefix}_sha1 != ''" comparison (r94362)
* Removed unneeded NOT NULL check (speeds up script a bit) from populateRevisionSha1 script
* Various code cleanups
2011-08-12 19:11:04 +00:00
Chad Horohoe
59cfbd0cf9 (bug 30172) posix_isatty() fallback does not work when the function has been disabled (but exists). While we're at it, make things work for HipHop too. 2011-08-02 22:01:58 +00:00
Aaron Schulz
92cc0f4fd2 Removed code lost in r93105, wtf. 2011-07-25 20:20:13 +00:00
Aaron Schulz
e657d50e47 Make Chad happy ;) 2011-07-25 20:11:00 +00:00
Aaron Schulz
ca1f27edff Added include_once to shouldExecute() check 2011-07-25 19:54:14 +00:00
Aaron Schulz
ea1176e336 Changed Maintenance::shouldExecute() to allow for multiple requires() in the stack. This avoids failing over requires due to Het wrappers. 2011-07-23 19:50:19 +00:00
Aaron Schulz
1159d6cdf1 Avoid redefining TESTWIKI constant (Het wrappers already do this) 2011-07-22 10:32:19 +00:00
Aaron Schulz
20850d5e33 Disallow given options twice (instead of letting the newest one take precedence). This property may be useful for a Het Deploy wrapper. 2011-07-18 03:30:03 +00:00
Chad Horohoe
b91ace27d9 Clean up the mess that is wfDie (resolves r85918). wfDie() doesn't exist anymore, so don't use it.
The only two usages left since r91590 are php version checks for index/load/api.php, and $wgAPIEnabled check in api.php. Consolidate all of the "bailing for invalid version" into PHPVersionError.php. Leaving $wgAPIEnabled as the only user was silly, so just echo and die like wfDie() would've done
2011-07-06 21:01:12 +00:00
Chad Horohoe
831a14ab85 Make Maintenance::error() more useful in dying situations by turning the second parameter into an int to allow dying errors to specify an exit code. Bool t/f will still work for b/c 2011-06-22 21:48:46 +00:00
Sam Reed
8bfd19b451 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (3/3), so hopefully reviewable in CR...
2011-06-17 16:05:35 +00:00
Chad Horohoe
4081fcabad Kill $wgWikiFarm. Only use in a wmf code path, and I can't find any evidence of this being use in WMF anywhere. 2011-06-03 03:38:52 +00:00
Max Semenik
c79a16167a Introduced Maintenance::getDB() and corresponding setDB() to control externally what database object should be used by maintenance script. Currently used by updater to avoid DatabaseSqliteTest from running stuff like Populate* on the live database instead of the one used for testing. 2011-05-24 17:48:22 +00:00
Tim Starling
6fec4e3fde Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support. 2011-05-15 13:21:16 +00:00
Happy-melon
cd128f4496 Follow-up r87637: the terrors of copy-and-paste. 2011-05-07 15:37:23 +00:00
Happy-melon
7055add799 Centralise the minimum-required-php-version in a MW_MIN_PHP_VERSION constant in Defines.php. This requires loading Defines.php before the PHP4 version checks, so include a big note reminding people not to include anything other than vanilla define() statements in there.
I have a sneaking suspicion that including Defines.php in the entry points might not play nicely with HipHop, but I can't test it (wrong OS).
2011-05-07 15:16:01 +00:00
Chad Horohoe
5a6d1ee2d3 More profiler cleanup:
* Move autoloader up a little bit so the profiler classes can use it
* Make Profiler into a singleton so it's lazy-constructed, $wgProfiler is now a configuration array (used 'visible' in ProfilerSimpleText as an example of other globals we can move into this array). If $wgProfiler is set to an object, it'll use that for back-compat
* Maintenance: rather than setting up the profiler and then disabling it, just disable it from the start
* Kill $wgProfiling -> now that ProfilerStub overrides profileIn() and profileOut(), it's not needed
* dumpHTML needs some fixes still
2011-04-16 19:00:54 +00:00
Alexandre Emsenhuber
0ddbaade34 And I forgot to commit this file in r85557 2011-04-06 18:38:48 +00:00
Tim Starling
7bb50c630a The beginnings of HipHop compiled mode support. It works now for parser 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.
2011-04-04 12:59:55 +00:00
Sam Reed
b88afb0daa Fixup/add documentation
Remove some unused variables
2011-03-30 19:00:11 +00:00