Example #1
0
 /**
  * Constructor.
  * @throws InvalidArgumentException Thrown when a invalid path is supplied.
  * @param string $path The path for which a transaction is required.
  */
 public function __construct($path)
 {
     if (empty($path) || !is_string($path) || file_exists($path) && !is_dir($path)) {
         throw new \InvalidArgumentException('The given path must be a directory.');
     }
     $this->path = FS::path($path);
     $parentPath = dirname($path);
     $this->journalPath = FS::combine($parentPath, '.journal-' . basename($path));
 }
Example #2
0
 /**
  * Constructor.
  * @param string $path The path for which a transaction is required.
  */
 public function __construct($path)
 {
     parent::__construct($path);
     $this->backupPath = FS::combine(dirname($this->path), '.old-' . basename($path));
 }