Use Doxygen @addtogroup instead of phpdoc @package && @subpackage
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index c52c346..4b73d5a 100644 (file)
@@ -2,7 +2,6 @@
 
 /**
  * Global functions used everywhere
- * @package MediaWiki
  */
 
 /**
@@ -230,7 +229,7 @@ function wfLogProfilingData() {
                        $forward .= ' anon';
                $log = sprintf( "%s\t%04.3f\t%s\n",
                  gmdate( 'YmdHis' ), $elapsed,
-                 urldecode( $_SERVER['REQUEST_URI'] . $forward ) );
+                 urldecode( $wgRequest->getRequestURL() . $forward ) );
                if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
                        error_log( $log . $prof, 3, $wgDebugLogFile );
                }
@@ -376,8 +375,11 @@ function wfMsgNoDBForContent( $key ) {
  * @return String: the requested message.
  */
 function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform = true ) {
+       $fname = 'wfMsgReal';
+       wfProfileIn( $fname );
        $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
        $message = wfMsgReplaceArgs( $message, $args );
+       wfProfileOut( $fname );
        return $message;
 }
 
@@ -1624,6 +1626,7 @@ function wfMkdirParents( $fullDir, $mode = 0777 ) {
        foreach ( $createList as $dir ) {
                # use chmod to override the umask, as suggested by the PHP manual
                if ( !mkdir( $dir, $mode ) || !chmod( $dir, $mode ) ) {
+                       wfDebugLog( 'mkdir', "Unable to create directory $dir\n" );
                        return false;
                } 
        }
@@ -1853,6 +1856,10 @@ function wfBaseName( $path ) {
  * @return string
  */
 function wfRelativePath( $path, $from ) {
+       // Normalize mixed input on Windows...
+       $path = str_replace( '/', DIRECTORY_SEPARATOR, $path );
+       $from = str_replace( '/', DIRECTORY_SEPARATOR, $from );
+       
        $pieces  = explode( DIRECTORY_SEPARATOR, dirname( $path ) );
        $against = explode( DIRECTORY_SEPARATOR, $from );