r73957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73956‎ | r73957 | r73958 >
Date:17:05, 29 September 2010
Author:platonides
Status:ok
Tags:
Comment:
Remove $wgServerName in extensions, too (follow r73950)
Modified paths:
  • /trunk/extensions/ContactPage/README (modified) (history)
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)
  • /trunk/extensions/ContactPage/install.settings (modified) (history)
  • /trunk/extensions/ContactPageFundraiser/README (modified) (history)
  • /trunk/extensions/ContactPageFundraiser/install.settings (modified) (history)
  • /trunk/extensions/News/README (modified) (history)
  • /trunk/extensions/OAI/OAIRepo_body.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php (modified) (history)
  • /trunk/extensions/SemanticTasks/SemanticTasks.classes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -321,10 +321,10 @@
322322
323323 function doSubmit() {
324324 global $wgOut, $wgUser;
325 - global $wgEnableEmail, $wgUserEmailUseReplyTo, $wgEmergencyContact;
 325+ global $wgEnableEmail, $wgUserEmailUseReplyTo, $wgPasswordSender;
326326 global $wgContactUser, $wgContactSender, $wgContactSenderName, $wgContactIncludeIP;
327327
328 - $csender = $wgContactSender ? $wgContactSender : $wgEmergencyContact;
 328+ $csender = $wgContactSender ? $wgContactSender : $wgPasswordSender;
329329 $cname = $wgContactSenderName;
330330 $senderIP = wfGetIP();
331331
Index: trunk/extensions/ContactPage/install.settings
@@ -1,5 +1,6 @@
22 require_once( "{{path}}/ContactPage.php" );
33
44 $wgContactUser = 'WikiAdmin';
5 -$wgContactSender = 'apache@' . $wgServerName;
 5+$wgContactSender = $wgPasswordSender;
66 $wgContactSenderName = 'Contact Form on ' . $wgSitename;
 7+
Index: trunk/extensions/ContactPage/README
@@ -28,7 +28,7 @@
2929 require_once( "$IP/extensions/ContactPage/ContactPage.php" );
3030
3131 $wgContactUser = 'WikiAdmin';
32 - $wgContactSender = 'apache@' . $wgServerName;
 32+ $wgContactSender = $wgPasswordSender;
3333 $wgContactSenderName = 'Contact Form on ' . $wgSitename;
3434
3535
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php
@@ -33,13 +33,14 @@
3434 * available as early on. Moreover, jobs and special pages are registered.
3535 */
3636 function enableSemantics( $namespace = null, $complete = false ) {
37 - global $smwgIP, $wgServerName, $smwgNamespace, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages, $wgSpecialPageGroups, $wgHooks, $wgExtensionMessagesFiles, $wgJobClasses, $wgExtensionAliasesFiles;
 37+ global $smwgIP, $wgServer, $smwgNamespace, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages, $wgSpecialPageGroups, $wgHooks, $wgExtensionMessagesFiles, $wgJobClasses, $wgExtensionAliasesFiles;
3838
3939 // The dot tells that the domain is not complete. It will be completed
4040 // in the Export since we do not want to create a title object here when
4141 // it is not needed in many cases.
4242 if ( $namespace === null ) {
43 - $namespace = $wgServerName;
 43+ wfWarn( 'You should be providing the domain name to enableSemantics()' );
 44+ $namespace = parse_url( $wgServer, PHP_URL_HOST );
4445 }
4546 if ( !$complete && ( $smwgNamespace !== '' ) ) {
4647 $smwgNamespace = '.' . $namespace;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -27,13 +27,14 @@
2828 */
2929 function enableSemantics( $namespace = null, $complete = false ) {
3030 global $wgVersion, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages, $wgSpecialPageGroups, $wgHooks, $wgExtensionMessagesFiles;
31 - global $smwgIP, $smwgNamespace, $wgJobClasses, $wgExtensionAliasesFiles, $wgServerName;
 31+ global $smwgIP, $smwgNamespace, $wgJobClasses, $wgExtensionAliasesFiles, $wgServer;
3232
3333 // The dot tells that the domain is not complete. It will be completed
3434 // in the Export since we do not want to create a title object here when
3535 // it is not needed in many cases.
3636 if ( $namespace === null ) {
37 - $namespace = $wgServerName;
 37+ wfWarn( 'You should be providing the domain name to enableSemantics()' );
 38+ $namespace = parse_url( $wgServer, PHP_URL_HOST );
3839 }
3940 if ( !$complete && ( $smwgNamespace !== '' ) ) {
4041 $smwgNamespace = '.' . $namespace;
@@ -489,4 +490,4 @@
490491 $smwgContLang = new $smwContLangClass();
491492
492493 wfProfileOut( 'smwfInitContentLanguage (SMW)' );
493 -}
\ No newline at end of file
 494+}
Index: trunk/extensions/SemanticTasks/SemanticTasks.classes.php
@@ -365,7 +365,7 @@
366366 }
367367
368368 function remindAssignees( $wiki_url ) {
369 - global $wgSitename, $wgServer;
 369+ global $wgSitename, $wgServer, $wgNoReplyAddress;
370370
371371 $user_mailer = new UserMailer();
372372
@@ -380,7 +380,7 @@
381381 return FALSE;
382382 }
383383
384 - $sender = new MailAddress( "no-reply@$wgServerName", "$wgSitename" );
 384+ $sender = new MailAddress( $wgNoReplyAddress, $wgSitename );
385385
386386 while ( $row = $results->getNext() ) {
387387 $task_name = $row[0]->getNextObject()->getTitle();
@@ -436,4 +436,4 @@
437437 }
438438 }
439439 }
440 -}
\ No newline at end of file
 440+}
Index: trunk/extensions/OAI/OAIRepo_body.php
@@ -518,9 +518,19 @@
519519 return null;
520520 }
521521
 522+ static function identifierPrefix() {
 523+ static $prefix = false;
 524+ if ( !$prefix ) {
 525+ global $wgServer, $wgDBname;
 526+ wfSuppressWarnings();
 527+ $prefix = "oai:" . parse_url( $wgServer, PHP_URL_HOST ) . ":$wgDBname:";
 528+ wfRestoreWarnings();
 529+ }
 530+ return $prefix;
 531+ }
 532+
522533 function stripIdentifier( $identifier ) {
523 - global $wgServerName, $wgDBname;
524 - $prefix = "oai:$wgServerName:$wgDBname:";
 534+ $prefix = self::identifierPrefix();
525535 if( substr( $identifier, 0, strlen( $prefix ) ) == $prefix ) {
526536 $pageid = substr( $identifier, strlen( $prefix ) );
527537 if( preg_match( '/^\d+$/', $pageid ) ) {
@@ -773,8 +783,7 @@
774784 }
775785
776786 function getIdentifier() {
777 - global $wgDBname, $wgServerName;
778 - return "oai:$wgServerName:$wgDBname:{$this->_id}";
 787+ return OAIRepo::identifierPrefix() . $this->_id;
779788 }
780789
781790 function getDatestamp() {
Index: trunk/extensions/ContactPageFundraiser/install.settings
@@ -1,5 +1,5 @@
22 require_once( "{{path}}/ContactPage.php" );
33
44 $wgContactUser = 'WikiAdmin';
5 -$wgContactSender = 'apache@' . $wgServerName;
 5+$wgContactSender = $wgPasswordSender;
66 $wgContactSenderName = 'Contact Form on ' . $wgSitename;
Index: trunk/extensions/ContactPageFundraiser/README
@@ -28,7 +28,7 @@
2929 require_once( "$IP/extensions/ContactPage/ContactPage.php" );
3030
3131 $wgContactUser = 'WikiAdmin';
32 - $wgContactSender = 'apache@' . $wgServerName;
 32+ $wgContactSender = $wgPasswordSender;
3333 $wgContactSenderName = 'Contact Form on ' . $wgSitename;
3434
3535
Index: trunk/extensions/News/README
@@ -217,4 +217,4 @@
218218 * $wgNewsFeedUserPattern: this defines the pattern used to generate author
219219 names in feed items. In the pattern, $1 is replaced by the user name. To
220220 e.g. generate email-addresses at your site as author names, use
221 - $wgNewsFeedUserPattern = '$1@' . $wgServerName;
 221+ $wgNewsFeedUserPattern = '$1@example.com';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73950Remove $wgServerName. Its only usage was for {{servername}}, and needed to be...platonides15:47, 29 September 2010

Status & tagging log