Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Windows Program Detection #241

Merged
merged 1 commit into from
Apr 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/_h5ai/server/php/inc/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,19 @@ public function get_server_checks() {
}
$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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which where is which where, where which is where and where is which?

$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",
Expand Down