Commit graph

71 commits

Author SHA1 Message Date
This, that and the other
babe76221c Fix initSiteStats.php maintenance script
It appears not to have worked for some time, as it either calls a protected
function ($counter->refresh()) or an undefined function
($counter->update()) depending on the parameters specified.

Bug: 65214
Change-Id: Ia7d867792b84c98714ec6dbbfef09745e875c8bc
2014-06-29 00:12:16 +00:00
Siebrand Mazeland
c0c39640e4 Make phpcs-strict pass on includes/ (5/~10)
Change-Id: I259f3f11cfc22f3ed1693f9ebd5bd80491b8a6e8
2014-05-11 19:35:32 +00:00
umherirrender
a3983418d5 Fixed some @params documentation (includes/*)
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: I0056b4a8df243cfc0c5f25378de48f7a35170aca
2014-04-22 13:07:02 +02:00
umherirrender
b058096a58 Remove another ss_active_users check from SiteStats::isSane
Also add a comment to method doc to make sure, nobody will add it again.

Follow-Up: Id8f1cb7035ae0058fb34a6c7bdf7bf9f6c740a69
Follow-Up: I268599be96106e1175fdf9750a2adc9468ebc93c
Change-Id: Ifd6da554b531720aace4497f7fbc2f58c12edc07
2014-02-24 18:17:35 +01:00
Marius Hoch
d8c0373371 Make SiteStats (re)initializing more sane
Don't set ss_active_users back to its default in SiteStatsInit::refresh.
Also remove SiteStatsInit::update and make refresh() protected.
Also don't consider ss_active_users in SiteStats::isSane as that value
isn't going to be fixed by the following SiteStatsInit::refresh call.

Change-Id: I268599be96106e1175fdf9750a2adc9468ebc93c
2014-02-24 00:40:51 +00:00
Tim Starling
64d0dc06a0 Move the DeferredUpdates hierarchy to its own directory
The grouping makes at least as much sense as job/, and certainly makes
more sense than cache/. With directories named after base classes, it is
fairly easy to tell what should go where. The grouping of
DeferredUpdates, DataUpdate and CallableUpdate would surely be
uncontroversial.

The move of SearchUpdate out of search/ demonstrates the conflict between
arrangement by module versus arrangement by type, which is the most
difficult design question here. I think arrangement by type is more
consistent with e.g. the arrangement of the core root, i.e. tests/,
resources/, maintenance/, etc. where a given feature will have its files
split up into a mostly type-based hierarchy.

I also tidied up AutoLoader.php by moving includes/content to the correct
location, sorted alphabetically by subdirectory.

Verified with AutoLoaderTest.

Change-Id: Ib369411d0caca38e72978084aa57348f1b892ed0
2013-11-04 10:32:40 +11:00
Aaron Schulz
167d7149e4 jobqueue: improved performance of JobQueueGroup::getQueuesWithJobs()
* Also added a JobQueueGroup::getQueueSizes() function.
  This function is now used by the SiteStats to make is
  meaningful for when queues are not in the DB. This number
  is already exposed via the API.

bug: 45072
bug: 50635
bug: 9518
Change-Id: I75c16ffa14c963e7f8fb7cb390e6cc4cde0a5804
2013-10-01 03:18:48 +00:00
Aaron Schulz
45daade27c Avoid "Transaction already in progress" errors in SiteStatsUpdate::doUpdate
* Also fixed TRX callback code to match documentation (wrong since 3b7c4f6)

Change-Id: I8c4ea7412e9f96912939c441c68090eacc42b3d4
2013-07-20 12:09:12 -07:00
umherirrender
2f8a5b34e6 Add ss_active_users in SiteStats::isSane
Also changed the array to the full row name, avoids unnecessary string
concat

Change-Id: Id8f1cb7035ae0058fb34a6c7bdf7bf9f6c740a69
2013-05-23 19:05:13 +02:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
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
2013-03-11 13:15:01 -04:00
Aaron Schulz
dd2de0ed9f Fixed unmatched begin/commit in SiteStatsUpdate.
Change-Id: Iaea0334571a283a72d9a070508d6175cd5b8d9bf
2013-02-11 16:53:25 -08:00
umherirrender
c6738a6ecd SiteStats: use field names in select instead of *
Change-Id: Id8eefdf5fb320a920b7d1c725e0d250f9b6125c1
2012-09-23 00:42:34 +02:00
Aaron
480ead91e6 Moved begin() since the lock() function may cause a BEGIN.
Change-Id: Ib5f7d6b7464a27d08de12c63495374319ac09dfe
2012-09-21 16:00:02 -07:00
umherirrender
bd8b22d90f change raw database quoting to use addQuotes
Change-Id: Ia734f958b1458224f998c5b59df2ff49e597f868
2012-08-26 18:56:29 +02:00
Reedy
0597984bd8 Fixup some wrong documentation
Don't try and return the result of void functions

Change-Id: I7a4db738b3e3052aebcf43742d31753f8cc1f47a
2012-06-15 15:05:49 +01:00
Aaron
ff187ea7cc [SiteStatsUpdate] Reduced contention by using a new lockIsFree() DB function.
* Note: follows up a4b3979160
* Cleanup up transaction statements a bit; transactions don't effect the lock calls
* Also made DatabaseMysql::unlock() actually return a bool

Change-Id: Iade2efa94165b6918eae0863716cc163f36a07b8
2012-05-10 15:48:58 -07:00
Catrope
4a75357363 Merge "[SiteStatsUpdate] Added support for memcached staging of stats updates." 2012-05-10 22:23:14 +00:00
Aaron
a4b3979160 [SiteStatsUpdate] Added support for memcached staging of stats updates.
Change-Id: I0bfdd6a4c9b8b09355bf008bd97456401f8b485b
2012-05-10 15:19:43 -07:00
Alexandre Emsenhuber
bc9d9f1f9c Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent and removed a duplicate comment from SpecialPageFactory.php in SpecialPage.php.

Change-Id: I99dd2de7fe461f2fad4e0bd315ebc2899958a90f
2012-05-10 17:51:44 +02:00
Aaron
b9ac85cbf3 [SiteStatsUpdate] Changing raw DB update calls to use SiteStatsUpdate.
* Made SiteStatsUpdate fields protected
* Added factory function for unretarded object construction
* Changed FileRepo code to use deferred stats updates like everything else

Change-Id: I93039104b14f0362509e37b6852604ffb0898dc7
2012-05-09 14:17:56 -07:00
Chad Horohoe
c37f30841a (bug 33911) SiteStats::isSane() should not check admins anymore 2012-01-26 22:08:38 +00:00
Alexandre Emsenhuber
d109eae77f Pass some more __METHOD__ to DatabaseBase::begin() and DatabaseBase::commit() 2012-01-18 12:10:16 +00:00
Sam Reed
3f704bbe0b Fix whitespace
Fix/improve documentation
2012-01-10 18:42:59 +00:00
Chad Horohoe
22b599e06c Refactor deferrable updates into classes & interfaces, also add helper method for the most common use case:
$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, "sometable" );

I kept b/c with $wgDeferredUpdateList for now, but seeing as only 3 exts in svn use it (FileSearch, FlaggedRevs and WikiScripts), I'd like to deprecate it pretty soon :)
2011-09-10 06:50:30 +00:00
Alexandre Emsenhuber
33fb14c862 Remove mention of wfOut() in comment 2011-08-13 18:12:43 +00:00
Sam Reed
8edf4a2d92 Fix trailing whitespace
Swap methods that call $this->getResult() to use temporary variable
2011-06-29 23:46:39 +00:00
Alexandre Emsenhuber
049404ebdc Fix for r91076: forgot to change one instance of $useMaster to $database 2011-06-29 17:18:06 +00:00
Alexandre Emsenhuber
60eca97237 Per Platonides, follow-up r72842: pass the db connection to SiteStatsInit::doAllAndCommit(). Changed parameters to that functions to give as first parameter a db connection and merged existing ones in the second parameter which is now an array of options (and is also much, much easier to read that those boolean parameters). No other calls in core or extensions. 2011-06-29 15:39:40 +00:00
Sam Reed
542ee58441 We check self::$pageCount, then assign it to another array, and return it from that array
Not ever caching stuff further

Follows up some ancient revisions
2011-05-25 20:57:15 +00:00
Sam Reed
36cb6833e4 More documentation updates and additions
Getting bored of this tonight now I think...
2011-05-21 20:06:57 +00:00
Alexandre Emsenhuber
421948c238 Rewrote the article counting code and related:
* (bug 26033, bug 24754) Added $wgArticleCountMethod to have a more flexible way to define which method to use to define if a page is an article or not and deprecated $wgUseCommaCount. There is now a new 'any' method to count any article that is in a content namespace and not a redirect.
* (bug 11868) If using links to count articles, Article::isCountable() will now use the ParserOutput to check if there's a link instead of checking for the "[[" string. Changed Article::isCountable() to take a stdObject or false for the first parameters. If false is passed, the result will be based on the current article's state (i.e. database). The only call outside of the Article class is in DeleteAction (including extensions).
* Removed this horror of Article::$mGoodAdjustment and Article::$mTotalAdjustment, replaced by the new $created parameter on Article::editUpdates(); simplified Article::createUpdates()
* Updated Import.php to take advantage of the new parameter and make a single call to Article::editUpdates()
2011-05-14 17:11:32 +00:00
Sam Reed
21d35067b9 Kill some more long deprecated unused functions
Add more @deprecated since where appropriate
2011-05-06 21:09:34 +00:00
Alexandre Emsenhuber
5981d695ce * Made SiteStatsInit::articles() give a correct result when $wgUseCommaCount is false (btw, do we really need to keep that variable?)
* Changed updateArticleCount.php to use that function instead of doing its own query
2011-04-20 11:58:00 +00:00
Alexandre Emsenhuber
f1c63eb018 Use MWNamespace::getContentNamespaces() instead of $wgContentNamespaces in case of misconfiguration of the latter 2011-04-18 16:33:16 +00:00
Sam Reed
eb316e03cd Swap "or" to || 2011-01-31 16:41:19 +00:00
Niklas Laxström
ab662057d5 Made active users concept have some meaning by decoupling it from recent changes length.
Introduced wgActiveUserDays, which defaults to 30 days as used on wmf.
This way the number can be more easily compared between wikis.
We no longer lie to users if the actual rc length is longer than the limit.
2010-07-18 07:15:27 +00:00
Jack Phoenix
11ff1526c4 coding style & doxygen tweaks 2010-05-29 23:45:02 +00:00
Chad Horohoe
974da20dfd Stop caring about ss_admins, we don't use it for anything anyway. Could probably be dropped from schema too. 2010-04-05 18:18:47 +00:00
Alexandre Emsenhuber
2d0dd7959c $fname -> __METHOD__ 2009-11-07 14:23:09 +00:00
Chad Horohoe
e0f51edc51 Typofix. 2009-08-02 20:00:41 +00:00
Chad Horohoe
a1c51e18af Merge maintenance-work branch (now with less errors!):
* 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
2009-08-02 19:35:17 +00:00
Niklas Laxström
2dce653596 Whitespace 2009-07-18 07:44:57 +00:00
Brion Vibber
1c9773bd01 Revert r52336 "Merge maintenance-work branch:"
Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks!
2009-06-24 02:49:24 +00:00
Chad Horohoe
59b60fc311 Merge maintenance-work branch:
* (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 :)
2009-06-24 02:02:37 +00:00
Tim Starling
4124558d7b For backport to 1.14.
* Made the upgrader work with SQLite
* Implemented missing schema info functionality in DatabaseSqlite
* Merged the SQLite and MySQL schemas into the one file with the help of some replaceVars() hacks.
* Moved all primary key definitions to the field definition, moved all indexes to CREATE INDEX statements, for best SQLite compatibility.
* Made all autoincrement fields primary keys, as required by SQLite.
* Removed meaningless buzzword from the category table comment
* tables.sql: s/'0'/0/
* In SQLite the index names have DB scope. Renamed archive.usertext_timestamp, user_newtalk.user_id, user_newtalk.user_ip
* SQLite does not support UPDATE with LIMIT by default. Removed all instances I could find.
* Made query errors work in the installer.
* Fixed DatabaseSqlite::lastErrno(), made SQLITE_SCHEMA errors automatically reissue the query as suggested on sqlite-users. Otherwise upgrade breaks.
* Removed miscellaneous status information from getServerVersion(), that's not the place to put it
2009-01-15 06:56:58 +00:00
Tim Starling
60fbfaa93f * Use a separate transaction for the site_stats update
* Remove obsolete runtime schema check
2008-09-26 15:35:11 +00:00
Aaron Schulz
41591cbdce rc_log_type can be null, and NULL != 'x' is treated as false, which borked the count. (bug 15682) 2008-09-21 22:56:59 +00:00