Commit graph

80 commits

Author SHA1 Message Date
Nick Jenkins
3e5443d74d Minor tweak to prevent an E_STRICT warning:
"Object of class MailAddress to string conversion in includes/UserMailer.php on line 112"
(It seems a bit silly of PHP to give this warning when the class has a __toString method,
 but adding an explicit toString() call is easy enough)
2007-10-11 07:04:59 +00:00
Brion Vibber
def1cb2845 Fix for regression from r26357: send newtalk notifications only if user has that pref selected 2007-10-03 21:13:02 +00:00
Tim Starling
353f203ce2 WARNING! NEEDS CAREFUL DEPLOYMENT
* Bug 9213: Fixed the plainly broken user_newtalk updating and caching scheme. I tried to keep my changes roughly performance-neutral, but the update on Wikimedia should be watched carefully for performance problems.
* Made UserMailer a class, use the autoloader to load it
* General UserMailer refactoring
* If the user has email-on-newtalk enabled, send them an email for every change, not just the first one before they view the page again.
* Don't add a watchlist entry automatically on change of user talk page
2007-10-03 08:46:17 +00:00
Brion Vibber
dc4e9a3db7 * (bug 4918) Clean up logic for email notification minor edit option. I haven't been able to reproduce the bug, though, so not sure if there's no effect or what. Seems to work equally before and after. 2007-09-20 19:55:22 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Steve Sanbeg
340eebc81a missed a brace. 2007-07-12 21:25:22 +00:00
Steve Sanbeg
0ab7cfaab9 Add error checking for mail() function 2007-07-12 21:16:03 +00:00
Brion Vibber
8466f9561e Fix regression from r23575 -- wl_notificationtimestamp didn't get updated anymore on update notification, leading to duplicate mails being sent out.
Doing a WHERE on x=NULL doesn't work; need to do 'x IS NULL' here.
Perhaps we should make the DB functions smarter to handle that case to do what we'd expect it to do (as we do turning arrays into 'IN (...)') but this'll fix it for now.
2007-07-11 19:21:34 +00:00
Rob Church
153a4e9b87 Revert bogus reversion 2007-07-10 08:10:04 +00:00
Aryeh Gregor
8609a52a76 Okay, use named constants that are actually equivalent to what they replace. But still use named constants. (Thanks, Raymond) 2007-07-09 22:12:55 +00:00
Aryeh Gregor
1c8ab4afee Magic numbers are evil, use named constants. 2007-07-09 21:16:58 +00:00
Rob Church
286a1124a6 Don't waste time queuing or checking email notifications for pages in the Special or Media namespaces 2007-07-09 14:21:49 +00:00
Aaron Schulz
d9796d048d *Mark all versions newer than the time of the latest revision viewed as "updated since last view", not just the current (bug 10277) 2007-06-30 01:03:21 +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
Rob Church
b6b52063ec Some job cleanup:
* Move Jobs left in JobQueue.php to their own file
* Ditch $wgCustomJobs in favour of $wgJobClasses, which acts as a dictionary and allows extensions to add custom jobs
* Standardise Job derivative constructors and update everywhere
* Make sure all overriding implementations of Job::run() return true to avoid bogus "Error" report in runJobs.php
2007-06-21 19:11:24 +00:00
River Tarnell
a6f6e04841 instead of storing every mail as a job, have a job to send enotif updates for the whole mail at once. 2007-05-11 16:42:18 +00:00
River Tarnell
af16ff1358 english stripping 2007-05-11 15:21:06 +00:00
River Tarnell
10b254085d mail() sending was not chucking recips properly in array path, from Nick Jenkins 2007-05-08 08:28:34 +00:00
River Tarnell
59d5f6a703 < brion-sushi> Error sending mail: Undefined variable: dest
- don't try to log destination in debug message
2007-05-07 17:56:00 +00:00
River Tarnell
67044a931c - default value of $wgEnotifImpersonal should be false
- userMailer() needs to handle multiple recips in mail() path
2007-05-06 07:14:10 +00:00
River Tarnell
848d8f4611 allow enotif mails to be sent via job queue 2007-05-05 12:44:55 +00:00
River Tarnell
03df01a7fa enotif should have a way to send bulk mail without customisations, for large sites 2007-05-05 12:08:24 +00:00
Tim Starling
644c2a89ff Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification email for every change which occurs on a wiki 2007-04-22 14:07:28 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Antoine Musso
520598e6e5 Fix #4347: use MailAddress object for reply-to 2007-02-03 22:55:01 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Nick Jenkins
0e2426cc65 E_STRICT minor tweaks:
* Strict Standards: Undefined index:  currevisionid in includes/Skin.php on line 287
* Strict Standards: Undefined index:  oldid in includes/Skin.php on line 288
[ Repo above with error_logging(E_ALL | E_STRICT) in LocalSettings.php, and a non-default skin, e.g: http://localhost/wiki/index.php?title=Main_Page&useskin=nostalgia ]
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/UserMailer.php on line 42
2006-12-04 11:28:48 +00:00
Nick Jenkins
a474761d9a Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".
Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].

Otherwise, from a functionality/efficiency perspective the two forms should be identical.

By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
2006-11-27 08:36:57 +00:00
Tim Starling
a3b490d2c4 * Made special page names case-insensitive and localisable. Care has been taken to maintain backwards compatibility.
* Used special page subpages in a few more places, instead of query parameters
2006-10-30 06:25:31 +00:00
Tim Starling
8a61d5fc2e Fixed line endings on Windows. Cleaned up PHP 5 error messages. 2006-10-14 05:38:31 +00:00
Brion Vibber
b31d2a51cf Handle failure of Mail::factory() gracefully 2006-10-04 23:35:29 +00:00
Rob Church
70b000f0fb * (bug 4979) Use simplified email addresses when running on Windows 2006-08-30 13:51:37 +00:00
Brion Vibber
f7d4f86c7b * (bug 7010) Don't send email notifications for watched talk pages when user
has selected to receive only updates for their own talk page
2006-08-18 01:43:33 +00:00
Tim Starling
489a4a55cf profiling 2006-07-26 03:51:49 +00:00
Brion Vibber
3b3fe578ef * (bug 6243) Fix email for usernames containing dots when using PEAR::Mail 2006-06-09 08:24:47 +00:00
Domas Mituzas
1aacbbf476 autoload WikiError 2006-06-06 11:51:31 +00:00
Antoine Musso
69689725c1 Switching from phpdoc to doxygen (use less than 32MB of memory).
Run maintenance/mwdocgen.php to generate doc in ./docs/html/ .
2006-04-19 15:46:24 +00:00
Brion Vibber
f2c29baf9f Update the FSF's address in all these GPL stub headers 2006-04-05 07:43:17 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Brion Vibber
5cfddf9a82 * (bug 3407) Fix encoding of subject and from/to headers on notification
mails; userMailer() now takes a MailAddress wrapper object instead of
  a raw string to abstract things a level.
2005-12-12 06:04:45 +00:00
Brion Vibber
1a21a9ad74 * (bug 3211) Include Date, To mail headers when using PEAR::Mail 2005-12-12 04:51:53 +00:00
Brion Vibber
d815ca352f * (bug 4201) Fix user-talk mode for Enotif, and general code cleanup
- treat NULL properly in watchlist lookup for notification sending
- consolidate a lot of ugly code that fiddles in those tables
- use user_newtalk consistently in enotif mode; watchlist for email notifications, user_newtalk for on-screen message and status check
- clean up handling of other peoples' user_talk pages when in the talk-only limited enotif: only your own will get sent, not other people watching your page
- and others watching your page _will_ work in watchable enotif mode
- add a watch on page + talk page consistently for the auto-add of the user talk page, not just half the page
- don't unwatch the user talk page on view! that's just wacky
- removed UserTalkUpdate, now redundant
- have User::setNewTalk() apply immediately
- clear newtalk from User::clearNotification() and User::clearAllNotifications()
2005-12-07 11:52:34 +00:00
Antoine Musso
0db8ece2b1 * code formatting
* comment
* useless calls
2005-12-04 20:20:03 +00:00
Antoine Musso
2ca68a256d Clean up unused globals! 2005-12-04 18:27:59 +00:00
Niklas Laxström
c431c9af1a Bug 3307: Remove an if that might break timezone 2005-09-14 21:04:48 +00:00
River Tarnell
b817c0c15f merge ORACLE_WORK. sorry, this may break some parts of MySQL, i did not test extensively. 2005-08-02 13:35:19 +00:00