Skip to content

Commit

Permalink
Improved Windows detect
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed May 7, 2015
1 parent 6469a6e commit c9bfb39
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function _getConfig($path)
*/
public function isAbsolutePath($path)
{
if (PHP_OS == "WINNT") {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if (preg_match('/^[A-Z]:\\\\/', $path)) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/Phalcon/Web/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public static function install($path)
$path = rtrim(realpath($path), '/') . '/';
$tools = realpath(__DIR__ . '/../../../');

if (PHP_OS == 'WINNT') {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = str_replace("\\", '/', $path);
$tools = str_replace("\\", '/', $tools);
}
Expand Down Expand Up @@ -397,7 +397,7 @@ public static function install($path)
public static function uninstall($path)
{
$path = realpath($path) . '/';
if (PHP_OS == 'WINNT') {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = str_replace("\\", '/', $path);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Web/Tools/controllers/ControllerBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private function checkToolsIp($ip)
*/
public function isAbsolutePath($path)
{
if (PHP_OS == "WINNT") {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if (preg_match('/^[A-Z]:\\\\/', $path)) {
return true;
}
Expand Down

0 comments on commit c9bfb39

Please sign in to comment.