예제 #1
0
파일: Socket.php 프로젝트: jasny/Q
 /**
  * Class constructor.
  * 
  * @param string $path
  */
 public function __construct($path)
 {
     parent::__construct($path);
     if (is_link($path) xor $this instanceof Fs_Symlink) {
         throw new Fs_Exception("File '{$path}' is " . ($this instanceof Fs_Symlink ? 'not ' : '') . "a symlink.");
     }
     if (file_exists($path) && filetype(realpath($path)) != 'socket') {
         throw new Fs_Exception("File '{$path}' is not a socket, but a " . filetype($path) . ".");
     }
 }
예제 #2
0
파일: Unknown.php 프로젝트: jasny/Q
 /**
  * Class constructor.
  * 
  * @param string $path
  */
 public function __construct($path)
 {
     parent::__construct($path);
     if (file_exists($path) && filetype(realpath($path)) != 'unknown') {
         throw new Fs_Exception("File '{$path}' is not a file with an unknown type, but a " . Fs::typeOfNode($path, Fs::DESCRIPTION));
     }
     if (is_link($path) xor $this instanceof Fs_Symlink) {
         throw new Fs_Exception("File '{$path}' is " . ($this instanceof Fs_Symlink ? 'not ' : '') . "a symlink.");
     }
 }
예제 #3
0
파일: File.php 프로젝트: jasny/Q
 /**
  * Class constructor.
  * 
  * @param string $path
  */
 public function __construct($path)
 {
     parent::__construct($path);
     if (file_exists($path) && !is_file($path)) {
         throw new Fs_Exception("File '{$path}' is not a regular file, but a " . Fs::typeOfNode($path, Fs::DESCRIPTION));
     }
     if (is_link($path) xor $this instanceof Fs_Symlink) {
         throw new Fs_Exception("File '{$path}' is " . ($this instanceof Fs_Symlink ? 'not ' : '') . "a symlink");
     }
 }
예제 #4
0
파일: Broken.php 프로젝트: jasny/Q
 /**
  * Class constructor.
  * 
  * @param string $path
  */
 public function __construct($path)
 {
     if (!is_link($path)) {
         throw new Fs_Exception("File '{$path}' is not a symlink");
     }
     if (file_exists($path)) {
         throw new Fs_Exception("File '{$path}' is not a broken link, the target is a " . filetype(realpath($path)));
     }
     parent::__construct($path);
 }