From ed9f04a37261277c83d7d8ec495035f0c6bc98ab Mon Sep 17 00:00:00 2001 From: Chr1sh3ng Date: Fri, 15 Apr 2016 19:17:43 +0800 Subject: [PATCH] Add commands support for Windows --- src/_h5ai/private/php/core/class-setup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_h5ai/private/php/core/class-setup.php b/src/_h5ai/private/php/core/class-setup.php index d0ae1693..c5117c4c 100644 --- a/src/_h5ai/private/php/core/class-setup.php +++ b/src/_h5ai/private/php/core/class-setup.php @@ -119,17 +119,17 @@ class Setup { $cmds = Json::load($cmds_cache_path); if (sizeof($cmds) === 0 || $this->refresh) { $cmds['command'] = Util::exec_0('command -v command'); - $cmds['which'] = Util::exec_0('which which'); + $cmds['which'] = Util::exec_0('which which') ? true : Util::exec_0('which which.exe'); $cmd = false; if ($cmds['command']) { $cmd = 'command -v'; } else if ($cmds['which']) { - $cmd = 'which'; + $cmd = 'which '; } foreach (['avconv', 'convert', 'du', 'ffmpeg', 'gm', 'tar', 'zip'] as $c) { - $cmds[$c] = ($cmd !== false) && Util::exec_0($cmd . ' ' . $c); + $cmds[$c] = ($cmd !== false) && Util::exec_0($cmd . $c) || Util::exec_0($cmd . $c . '.exe'); } Json::save($cmds_cache_path, $cmds);