Commit graph

57 commits

Author SHA1 Message Date
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
Aaron Schulz
1627c222df Remove some individual transactions 2008-09-19 10:13:32 +00:00
Aaron Schulz
991bb4c016 * Remove mysql var and move field init to updaters.inc 2008-09-01 19:22:28 +00:00
Aaron Schulz
332c496506 * Maintain active user count for Special:Statistics (bug 13585)
* Add a global to add update functions to updateSpecialPages.php
2008-08-31 19:29:37 +00:00
Chad Horohoe
7bc1f87963 Add some caching to the group counts. 2008-08-28 01:09:40 +00:00
Chad Horohoe
14a80040bf Deprecate SiteStats::admins() in favor of SiteStats::numberingroup('sysop'). Should make bug 13471 easy. 2008-07-28 15:49:44 +00:00
Aryeh Gregor
3574dd82e3 Revert 36514 per Wikitech-l discussion. 2008-06-22 18:24:33 +00:00
Chad Horohoe
5c7d4d299d No need to count(*) in SiteStats::admins 2008-06-20 18:46:29 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Yuri Astrakhan
fa3c83c114 Statistics code cleanup, fixed multiple db reload bug. 2007-08-09 12:27:50 +00:00
Aryeh Gregor
a4e96dbddb Er, right. Best to have "return true;" somewhere in the function, isn't it? 2007-07-16 20:05:32 +00:00
Aryeh Gregor
8959942024 Whoops, reversed inequality. Forgot to check whether this is being run *too* often. 2007-07-16 20:01:54 +00:00
Aryeh Gregor
c3311c0887 (bug 4650) Added various sanity checks to site stats generation. 2007-07-16 19:48:18 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Nick Jenkins
558807bb9c Suspect $dbr was undefined in this scope. 2007-03-23 08:48:27 +00:00