mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-07-28 15:29:43 +02:00
Much faster Windows detection
This commit is contained in:
4
boot.php
4
boot.php
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user