Chad has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/94268


Change subject: Don't use wfIsWindows() in CDB writers
......................................................................

Don't use wfIsWindows() in CDB writers

Change-Id: I5d6baf6fe63d135c679e4795287daa0a8722dde6
---
M includes/utils/Cdb.php
M includes/utils/CdbPHP.php
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/94268/1

diff --git a/includes/utils/Cdb.php b/includes/utils/Cdb.php
index 5b2bcb1..a3b50af 100644
--- a/includes/utils/Cdb.php
+++ b/includes/utils/Cdb.php
@@ -177,6 +177,13 @@
                        $this->close();
                }
        }
+
+       /**
+        * Are we running on Windows?
+        */
+       protected function isWindows() {
+               return substr( php_uname(), 0, 7 ) == 'Windows';
+       }
 }
 
 /**
@@ -223,7 +230,7 @@
                if ( isset( $this->handle ) ) {
                        dba_close( $this->handle );
                }
-               if ( wfIsWindows() ) {
+               if ( $this->isWindows() ) {
                        unlink( $this->realFileName );
                }
                if ( !rename( $this->tmpFileName, $this->realFileName ) ) {
diff --git a/includes/utils/CdbPHP.php b/includes/utils/CdbPHP.php
index 8dee671..80973ae 100644
--- a/includes/utils/CdbPHP.php
+++ b/includes/utils/CdbPHP.php
@@ -334,7 +334,7 @@
                if ( isset( $this->handle ) ) {
                        fclose( $this->handle );
                }
-               if ( wfIsWindows() && file_exists( $this->realFileName ) ) {
+               if ( $this->isWindows() && file_exists( $this->realFileName ) ) 
{
                        unlink( $this->realFileName );
                }
                if ( !rename( $this->tmpFileName, $this->realFileName ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/94268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d6baf6fe63d135c679e4795287daa0a8722dde6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to