Commit graph

22 commits

Author SHA1 Message Date
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Aaron Schulz
46cf4f1e30 Clean up $wgSQLiteDataDir handling and removed standalone sqlite class
* The data directory can now be set via the construction params
* A standalone factory method now replaces the subclass
* Also made mDatabaseFile protected

Change-Id: I1791fd4f630e5c121fa7f68f473411a7c12d0c97
2015-03-09 18:35:24 +00:00
Siebrand Mazeland
606c680b21 Update formatting in maintenance/ (4/4)
Change-Id: I6b58d014a4bfd6600e4e6f80188fdcfce18482ca
2014-04-23 20:09:26 +02:00
Siebrand Mazeland
a50a5d9da7 Pass phpcs-strict on maintenance/ (1/8)
Change-Id: Ib68a7cf4251e8f4c71233df869673f4c5d3cf84c
2014-04-22 21:25:22 +00:00
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
Alexandre Emsenhuber
a75b6d53cd Improve documentation of maintenance scripts.
Also contains a fix for Ia5a38311 (fae0550).

Change-Id: I630c83b48b66c5d8c97411082cabd731f316f42d
2012-09-02 20:33:22 +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
Sam Reed
44696806fb Remove some unused getting of non existent arguments
Documentation
2011-10-18 17:32:20 +00:00
Max Semenik
4ae61d1424 sqlite.php: don't fail after --check-syntax on a non-SQLite DB 2011-06-11 18:45:56 +00: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
Chad Horohoe
a548c1d87a Get rid of a bunch of $wgDBtypes in maintenance/ 2010-12-10 13:56:17 +00:00
Mark A. Hershberger
617a5b1e15 Whitespace fixup under tha maint directory. 2010-12-04 03:20:14 +00:00
Max Semenik
a2449fea86 maintenance/sqlite.php: added the ability to check .sql files for SQLite compatibility 2010-08-12 16:06:47 +00:00
Sam Reed
659778619c Stylize maintenance folder.. 2010-05-22 16:50:39 +00:00
Chad Horohoe
9b5196a68d Fix child class visibility 2010-03-10 12:59:44 +00:00
Max Semenik
0e89f32f99 Don't display useless --dbuser and --dbpass in sqlite.php help 2010-02-21 08:30:23 +00:00
Max Semenik
1b8062b6fa maintenance/sqlite.php: added an option for safe backup 2010-02-21 08:25:58 +00:00
Max Semenik
1ddb7210be While coding r58014, I thought that VACUUM on a 0-byte databse results in an error - it doesn't 2009-12-17 15:48:49 +00:00
Max Semenik
08350c0143 Either we write 'bytes' in both cases, or in neither 2009-10-31 08:44:08 +00:00
Max Semenik
c07f1e0c5e That way of percentage calculation was an epic fail:) 2009-10-22 15:39:07 +00:00
Max Semenik
719248cdc3 Added a script for SQLite-specific maintenance tasks 2009-10-18 10:55:36 +00:00