Unless --nopurge is set in update.php, clear module_deps cache
tables.
We already clear the objectcache via purgeCache(), and
msg_resource and msg_resource_links via MessageBlobStore::clear().
The module_deps table should be included as well.
Bug: T37472
Change-Id: I7cb63bb39a62b7f5be3855d022a8c76e175e95b5
The test for OutputPage::makeResourceLoaderLink was triggering database
queries through MessageBlobStore even though it doesn't use any
messages.
In bb03d1a8e0 I had made MessageBlobStore a singleton instead of static
functions, however there's no need for it to be one since the class is
stateless. Callers can just create a new MessageBlobStore instance and
call functions upon it. Using getInstance() is now deprecated.
ResourceLoader now has a setMessageBlobStore setter to allow overriding
which MessageBlobStore instance will be used. OutputPageTest uses this
to set a NullMessageBlobStore, which makes no database queries.
Change-Id: Ica7436fb6f1ea59bd445b02527829ab0742c0842
- Added/removed spaces around parenthesis
- Added newline in empty blocks
- Added space after switch/foreach/function
- Use tabs at begin of line
- Add newline at end of file
Change-Id: I244cdb2c333489e1020931bf4ac5266a87439f0d
Was not completely removed and the remaining bits were mostly
broken. $wgProfiler['output'] = 'db' is the proper way.
Fixes T75917
Change-Id: I36565e2372db2ed49b219cf533ec433e8111c52f
The key was constructed depending on the current time only.
This method fails, if multiple updates are performed
within one second.
Bug: 71087
Change-Id: Id7e30298729b3abb1501a34fcc1ba4e45d2172f0
For easier testability and other things. There are no uses
of this class in any extensions in gerrit.
Change-Id: I606de4259239e128ed7e0477fc98b84c647430c4
* Also tweaked the query so MySQL avoids doing a page_name
index scan when it should start with the link table index
* Added population script (triggered by update.php)
* Also removed uniqueness from some indexes where it is redundant
* Renamed two confusing variables
Bug: 60618
Change-Id: Icca99b6ae0ef76cb77695faf82c615516191da36
to ease future maintenance work. The pattern for catching the right
CHECK constraint is admittedly vague but the order in which auto-created
CHECK constraints of a table is removed doesn't really matter assuming
the update is always completed before another update is applied. If
updates are run through Update.php, that should be always the case.
Furthermore eliminating a bug causing application of several patches each
time when running Update.php
Bug: 65757
Bug: 65813
Change-Id: Ic7fc3bd836241dce8f296237bbd80ed3e4d1ee0d
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
Can be kind of confusing for people to figure out why certain
updates didn't happen. I just had an irc conversation with
someone who didn't realize why their db wasn't fully updated.
Change-Id: I56223e70bdac8baaf079c28cbb1f0e20ef0336b8
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line
Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
They can cause problems if, for example, the installation has hooks
for UserSaveSettings or UserSaveOptions that try to update a user page.
Change-Id: I31078678e8939c897b1357bcb77eb2d26f806f29
Bug: 47271
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.
Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668
There was a bad rebase on I96b4cfd4c02e9cbf46cc6a0499b87fb3b89020a0,
because it partically reverts Ice42a31dee1e6b41da4aa0a47e8786579382aff1
Bug: 44690
Change-Id: Iff2c8d3cb1a10da7cd0ab18ee189454761d7db6f
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
Update.php is supposed to clear all localization caches. This
makes sure to clear the ResourceLoader's own message cache
as well.
Bug: 44524
Change-Id: I15ceb60f5e2e4d3ed9ba818fe6cd619f9adce5b2
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays
Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
As calling $updater->modifyField will do the action immediately (not queued),
this may be undesired.
So this is a shortcut/utility function like addExtensionField/addExtensionTable etc,
instead of the developer calling addExtensionUpdate( array() ) themselves.
Change-Id: Ie94f2b42679062c6e106ae560faab26818a9b15c
- Add doTable() check at the top of renameIndex()
- Return true instead of false when aborting an update due to unfulfilled
condition; false is only to be used for updates that will be written to
a schema update file to be run later
Also removed the return false from addIndex() for consistency
- Break long line
Change-Id: I2efb6e3af4703ed8afeb315e8cda774d9a6c4a32
- DatabaseUpdater::dropExtensionIndex( $tableName, $indexName, $sqlPath )
- DatabaseUpdater::renameExtensionIndex( $tableName, $oldIndexName, $newIndexName, $sqlPath, $skipBothIndexExistWarning = false )
[ Case use ]
This feature is required to help extensions schema change to ensure
compatibility with SQLite.
First extensions to use it will be Echo and Flagged Revisions.
Change-Id: Ia2782d644593ab6b64b67720ed61b3994db10346
This might not be quite right... We might want to cache the result of apply patch, insert the row and then return the result...
Change-Id: Ie6a1bb16d2912ad43aa8fd45b2bf10a8bf8652ae
Change I96b4cfd4 changed the data being stored in updatelog, trying to
store the mangled parameters (which may included an added copy of the
DatabaseUpdater object itself) instead of the input parameters. This
causes warnings because database objects cannot be effectively
serialized.
Go back to storing the original input parameters instead.
Change-Id: I96e6dffed98772ebb9b812773ff2f608e7e40cb1
Allows update.php to be run when $wgAllowSchemaUpdates = false.
This is useful for non-WMF environments where strict DB permissions
allow database updates (which update.php performs), but no schema
changes (such as adding or dropping tables or indices which update.php
also performs).
It does this by adding the --schema and --noschema flags. Without
either of these flags, update.php will perform exactly as before.
With --noschema, all changes to the table structure or table additions
are skipped. Only data changes are made.
With --schema is used, no schema changes are made to the database, but
the schema changes are saved to a separate SQL file that can be run.
Change-Id: I96b4cfd4c02e9cbf46cc6a0499b87fb3b89020a0
It makes a whole lot more sense to run this at the end of the
update process after post update maintenance rather than just
at the end of schema updates.
Run update.php more than once so all the updatelog entries
are populated and you'll see why it makes sense.
Change-Id: Ice42a31dee1e6b41da4aa0a47e8786579382aff1
This allows sha1 searches with the api in miser mode for deleted files
Added script to populate the rows
Adding new field to selects and handle it in all places, where needed
Using a 10 byte index for the new field per
http://lists.wikimedia.org/pipermail/wikitech-l/2012-September/063429.html
Change-Id: Ie54a513fe361202e63df44be44a0fdd91926c974
The parent class LoggedUpdateMaintenance of each update script is
checking the updatelog self.
Checking in update.php prevents the script to be run, when using --force
on update.php and updater is not outputting a skipped message
Change-Id: I6cdad807ee4e49983cedef168d4e697a5bd8b7e7
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