mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-27 13:34:30 -04:00
Fixing Windows Program Detection
command is currently not ported for windows, which however is. To remain intact with the current code already in place, it will detect if the server is running windows or not.
This commit is contained in:
parent
580653a1ad
commit
064527a17e
1 changed files with 13 additions and 5 deletions
|
@ -282,11 +282,19 @@ class App {
|
|||
}
|
||||
$exif = function_exists("exif_thumbnail");
|
||||
$cache = @is_writable($this->get_cache_abs_path());
|
||||
$tar = @preg_match("/tar(.exe)?$/i", `command -v tar`) > 0;
|
||||
$zip = @preg_match("/zip(.exe)?$/i", `command -v zip`) > 0;
|
||||
$convert = @preg_match("/convert(.exe)?$/i", `command -v convert`) > 0;
|
||||
$ffmpeg = @preg_match("/ffmpeg(.exe)?$/i", `command -v ffmpeg`) > 0;
|
||||
$du = @preg_match("/du(.exe)?$/i", `command -v du`) > 0;
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$tar = @preg_match("/tar(.exe)?$/i", `which tar`) > 0;
|
||||
$zip = @preg_match("/zip(.exe)?$/i", `which zip`) > 0;
|
||||
$convert = @preg_match("/convert(.exe)?$/i", `which convert`) > 0;
|
||||
$ffmpeg = @preg_match("/ffmpeg(.exe)?$/i", `which ffmpeg`) > 0;
|
||||
$du = @preg_match("/du(.exe)?$/i", `which du`) > 0;
|
||||
} else {
|
||||
$tar = @preg_match("/tar(.exe)?$/i", `command -v tar`) > 0;
|
||||
$zip = @preg_match("/zip(.exe)?$/i", `command -v zip`) > 0;
|
||||
$convert = @preg_match("/convert(.exe)?$/i", `command -v convert`) > 0;
|
||||
$ffmpeg = @preg_match("/ffmpeg(.exe)?$/i", `command -v ffmpeg`) > 0;
|
||||
$du = @preg_match("/du(.exe)?$/i", `command -v du`) > 0;
|
||||
}
|
||||
|
||||
return array(
|
||||
"idx" => $this->app_abs_href . "server/php/index.php",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue