Browse code

Much faster Windows detection

Klaus Silveira authored on09/10/2012 04:28:55
Showing2 changed files
... ...
@@ -1,9 +1,5 @@
1 1
 <?php
2 2
 
3
-if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && !defined('WINDOWS_BUILD')) {
4
-    define('WINDOWS_BUILD', 1);
5
-}
6
-
7 3
 // Load configuration
8 4
 $config = new GitList\Config('config.ini');
9 5
 $config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
... ...
@@ -227,7 +227,7 @@ class Repository
227 227
      */
228 228
     public function getTotalCommits($file = null)
229 229
     {
230
-        if (WINDOWS_BUILD) {
230
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
231 231
             $command = "rev-list --count --all $file";
232 232
         } else {
233 233
             $command = "rev-list --all $file | wc -l";