r37019 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37018‎ | r37019 | r37020 >
Date:06:47, 4 July 2008
Author:siebrand
Status:old
Tags:
Comment:
Trying to resolve commit r37017/revert r37018: Throw an E_USER_NOTICE saying that function is deprecated for wfGetHTTP() and wfIsLocalURL()
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -452,7 +452,7 @@
453453 * @param string $key
454454 * @param bool $useDB
455455 * @param string $langcode Code of the language to get the message for, or
456 - * behaves as a content language switch if it is a
 456+ * behaves as a content language switch if it is a
457457 * boolean.
458458 * @return string
459459 * @private
@@ -1732,7 +1732,7 @@
17331733 $currentDir = substr( $currentDir, 0, $p );
17341734 }
17351735 }
1736 -
 1736+
17371737 if ( count( $createList ) == 0 ) {
17381738 # Directory specified already exists
17391739 return true;
@@ -1752,7 +1752,7 @@
17531753 wfDebugLog( 'mkdir', "Not writable: $currentDir\n" );
17541754 return false;
17551755 }
1756 -
 1756+
17571757 foreach ( $createList as $dir ) {
17581758 # use chmod to override the umask, as suggested by the PHP manual
17591759 if ( !mkdir( $dir, $mode ) || !chmod( $dir, $mode ) ) {
@@ -1812,7 +1812,7 @@
18131813 function wfEncryptPassword( $userid, $password ) {
18141814 wfDeprecated(__FUNCTION__);
18151815 # Just wrap around User::oldCrypt()
1816 - return User::oldCrypt($password, $userid);
 1816+ return User::oldCrypt($password, $userid);
18171817 }
18181818
18191819 /**
@@ -2294,12 +2294,20 @@
22952295 }
22962296
22972297 /**
2298 - * Aliases for modularized functions
 2298+ * Alias for modularized function
 2299+ * @deprecated Use Http::get() instead
22992300 */
23002301 function wfGetHTTP( $url, $timeout = 'default' ) {
 2302+ wfDeprecated(__FUNCTION__);
23012303 return Http::get( $url, $timeout );
23022304 }
 2305+
 2306+/**
 2307+ * Alias for modularized function
 2308+ * @deprecated Use Http::isLocalURL() instead
 2309+ */
23032310 function wfIsLocalURL( $url ) {
 2311+ wfDeprecated(__FUNCTION__);
23042312 return Http::isLocalURL( $url );
23052313 }
23062314
@@ -2307,7 +2315,7 @@
23082316 global $wgHttpOnlyBlacklist;
23092317 if( !version_compare("5.2", PHP_VERSION, "<") )
23102318 return false;
2311 -
 2319+
23122320 if( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
23132321 foreach( $wgHttpOnlyBlacklist as $regex ) {
23142322 if( preg_match( $regex, $_SERVER['HTTP_USER_AGENT'] ) ) {
@@ -2315,7 +2323,7 @@
23162324 }
23172325 }
23182326 }
2319 -
 2327+
23202328 return true;
23212329 }
23222330
@@ -2454,9 +2462,9 @@
24552463 *
24562464 * @param string $wiki The wiki ID, or false for the current wiki
24572465 *
2458 - * Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request
2459 - * will always return the same object, unless the underlying connection or load
2460 - * balancer is manually destroyed.
 2466+ * Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request
 2467+ * will always return the same object, unless the underlying connection or load
 2468+ * balancer is manually destroyed.
24612469 */
24622470 function &wfGetDB( $db = DB_LAST, $groups = array(), $wiki = false ) {
24632471 return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );
@@ -2674,4 +2682,4 @@
26752683 $salt = serialize($salt);
26762684
26772685 return md5( mt_rand( 0, 0x7fffffff ) . $salt );
2678 -}
\ No newline at end of file
 2686+}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37017Remove wfGetHTTP() and wfIsLocalUrl(). Unused wrapper functions for stuff in ...demon02:25, 4 July 2008
r37018Revert r37017. Please do not remove functions unless you have a really really...tstarling02:52, 4 July 2008

Status & tagging log