Permalink
Browse files

Fix COM class namespace

  • Loading branch information...
1 parent 1ba320b commit 9f41e247e40857adbf5eee908e46183fe0f18360 @cdujeu cdujeu committed Jun 29, 2016
@@ -132,7 +132,7 @@ public static function runCommandInBackground($cmd, $logFile)
if (PHP_OS == "WIN32" || PHP_OS == "WINNT" || PHP_OS == "Windows") {
if (AJXP_SERVER_DEBUG) $cmd .= " > " . $logFile;
if (class_exists("COM") && ConfService::getGlobalConf("CLI_USE_COM")) {
- $WshShell = new COM("WScript.Shell");
+ $WshShell = new \COM("WScript.Shell");
$WshShell->Run("cmd /C $cmd", 0, false);
} else {
$basePath = str_replace("/", DIRECTORY_SEPARATOR, AJXP_INSTALL_PATH);
@@ -92,7 +92,7 @@ public function doTest()
$comCommand = $cmd;
if ($useCOM) {
- $WshShell = new COM("WScript.Shell");
+ $WshShell = new \COM("WScript.Shell");
$res = $WshShell->Run("cmd /C $comCommand", 0, false);
} else {
$tmpBat = implode(DIRECTORY_SEPARATOR, array(str_replace("/", DIRECTORY_SEPARATOR, AJXP_INSTALL_PATH), "data","tmp", md5(time()).".bat"));
@@ -106,7 +106,7 @@ public function doTest()
// Failed, but we can try with COM
if ( ! is_file(AJXP_CACHE_DIR."/cli_result.php") && $comEnabled ) {
$useCOM = true;
- $WshShell = new COM("WScript.Shell");
+ $WshShell = new \COM("WScript.Shell");
$res = $WshShell->Run("cmd /C $comCommand", 0, false);
}
}
@@ -160,7 +160,7 @@ public function directoryUsage(AJXP_Node $node){
$dir = $node->getRealFile();
$size = -1;
if ( ( PHP_OS == "WIN32" || PHP_OS == "WINNT" || PHP_OS == "Windows") && class_exists("COM") ) {
- $obj = new COM ( 'scripting.filesystemobject' );
+ $obj = new \COM ( 'scripting.filesystemobject' );
if ( is_object ( $obj ) ) {
$ref = $obj->getfolder ( $dir );
$size = floatval($ref->size);

0 comments on commit 9f41e24

Please sign in to comment.