Commit graph

17 commits

Author SHA1 Message Date
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
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
2013-05-21 23:26:28 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
umherirrender
b114f5e1c1 Fixed some spacing in maintenance folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
2013-04-18 20:48:44 +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
Alexandre Emsenhuber
f7c4c52ba0 Improve documentation of maintenance scripts.
Change-Id: I1c911eb0fd6108fdee0b4e96363d87b926aba396
2012-06-25 21:54:41 +02:00
Chad Horohoe
26505b170a Fix concern raised by Brion in r74108 (but has really existed since the maintenance rewrite). Right now, including a maintenance script causes it to execute. This is bad when you want to reuse the particular class but not have it start executing all by itself.
Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild().

Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once().
2011-01-13 22:58:55 +00:00
Sam Reed
487d9a4ec8 Per CR on r75575, remove array_keys() as getModuleNames has array_key'd the returned stuffs 2011-01-12 19:03:59 +00:00
Sam Reed
9015102f59 Fix another typo in r80075 2011-01-12 02:20:41 +00:00
Sam Reed
3253df4a9b Fix typo from r80075
Rename table variable
2011-01-12 02:19:09 +00:00
Sam Reed
4906d50911 Follwup r75575, honour table prefixes. Bad Roan ;) 2011-01-12 02:16:56 +00:00
Sam Reed
298d0344da Followup r75575
reedy@ubuntu64-esxi:~/mediawiki/trunk/phase3/maintenance$ php cleanupRemovedModules.php 
Fatal error: Call to undefined method ResourceLoader::getModules() in /home/reedy/mediawiki/trunk/phase3/maintenance/cleanupRemovedModules.php on line 40
2011-01-12 02:12:53 +00:00
Mark A. Hershberger
617a5b1e15 Whitespace fixup under tha maint directory. 2010-12-04 03:20:14 +00:00
Chad Horohoe
b412b3ed8e (bug 25935) Fix comment in cleanupRemovedModules.php 2010-11-15 12:20:00 +00:00
Roan Kattouw
77e631ae23 Fix copy-paste mistake in @author attribution for cleanupRemovedModules.php 2010-11-06 12:03:39 +00:00
Roan Kattouw
69171cde6d Re-add maintenance script from r75555, not totally broken this time 2010-10-27 20:08:04 +00:00
Roan Kattouw
89b49c49c1 Revert unintended changes in r75555 2010-10-27 18:49:18 +00:00
Roan Kattouw
e31ed04b16 Whitespace fixes for r75486 2010-10-27 15:51:31 +00:00