public function testGetPhpLocalHackPath()
 {
     if (AdvancedPathLib::getCurrentOS() == AdvancedPathLib::OS_WINDOWS) {
         $this->assertEquals('C:/path/to/myFile.ext', AdvancedPathLib::getPhpLocalHackPath('file://C:/path/to/myFile.ext'));
         $this->assertEquals('C:/path/to/myDir/', AdvancedPathLib::getPhpLocalHackPath('file://C:/path/to/myDir/'));
         $this->assertEquals('C:/path/to/myFile.ext', AdvancedPathLib::getPhpLocalHackPath('file://localhost/C:/path/to/myFile.ext'));
     } else {
         $this->assertEquals('/path/to/myFile.ext', AdvancedPathLib::getPhpLocalHackPath('file:///path/to/myFile.ext'));
         $this->assertEquals('/path/to/myFile.ext', AdvancedPathLib::getPhpLocalHackPath('file://path/to/myFile.ext'));
         $this->assertEquals('/path/to/myFile.ext', AdvancedPathLib::getPhpLocalHackPath('file://localhost/path/to/myFile.ext'));
         $this->assertEquals('/path/to/myDir', AdvancedPathLib::getPhpLocalHackPath('file://localhost/path/to/myDir/'));
     }
 }
Esempio n. 2
0
 public function testChown()
 {
     if (AdvancedPathLib::getCurrentOS() == AdvancedPathLib::OS_WINDOWS) {
         $this->markTestSkipped('chown() is not available on Windows.');
     }
     //
     // Unable to check that without running phpunit as 'root'
     //
     /*chmod(TESTS_FSI_LOCALFILE_TMP_PATH . '/myFile.ext', 0777);
     		$this->assertNotEquals(1001, fileowner(TESTS_FSI_LOCALFILE_TMP_PATH . '/myFile.ext'));		
     		$this->assertTrue($this->fixture_file->chown(1001));
     		clearstatcache();
     		$this->assertEquals(1001, fileowner(TESTS_FSI_LOCALFILE_TMP_PATH . '/myFile.ext'));*/
 }
 public static function updateDb(AbstractEyeosUser $user)
 {
     if (AdvancedPathLib::getCurrentOS() == AdvancedPathLib::OS_WINDOWS) {
         return;
     }
     $userRecollDirPath = UMManager::getInstance()->getEyeosUserDirectory($user) . '/' . USERS_CONF_DIR . '/' . FRAMEWORK_SEARCH_RECOLL_DIR;
     shell_exec(realpath(FRAMEWORK_SEARCH_UTILS_PATH) . '/updateDB.pl ' . escapeshellarg(realpath($userRecollDirPath)));
 }