Much faster Windows detection

This commit is contained in:
Klaus Silveira
2012-09-10 01:28:55 -03:00
parent 3af7081068
commit a84edd0e64
2 changed files with 1 additions and 5 deletions

View File

@@ -1,9 +1,5 @@
<?php
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && !defined('WINDOWS_BUILD')) {
define('WINDOWS_BUILD', 1);
}
// Load configuration
$config = new GitList\Config('config.ini');
$config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);

View File

@@ -227,7 +227,7 @@ class Repository
*/
public function getTotalCommits($file = null)
{
if (WINDOWS_BUILD) {
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$command = "rev-list --count --all $file";
} else {
$command = "rev-list --all $file | wc -l";