Пример #1
0
 protected function tearDown()
 {
     $fileinfo = new FileInfo($this->getPathStore());
     $fileinfo->openDirectory()->chmodInternalContent(0777);
     $fileinfo->openDirectory()->clear();
     clearstatcache(true);
     parent::tearDown();
 }
Пример #2
0
 /**
  * @expectedException Stalxed\FileSystem\Exception\PathNotFoundException
  */
 public function testControl_UnknownPath()
 {
     $fileinfo = new FileInfo($this->storage->getPath('nonexistent_directory/nonexistent.file'));
     $fileinfo->control();
 }
Пример #3
0
 public function copyTo($pathDestinationFile, $copyMode = CopyMode::SKIP_EXISTING, $mode = 0644)
 {
     $destinationFile = new FileInfo($pathDestinationFile);
     if (!$destinationFile->isExists()) {
         if (!@copy($this->getRealPath(), $destinationFile->getPathname())) {
             throw new Exception\PermissionDeniedException();
         }
         if (!@chmod($destinationFile->getRealPath(), $mode)) {
             throw new Exception\PermissionDeniedException();
         }
     } elseif ($copyMode == CopyMode::ABORT_IF_EXISTS) {
         throw new Exception\AbortException();
     }
 }