Esempio n. 1
0
File: Socket.php Progetto: 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) . ".");
     }
 }
Esempio n. 2
0
File: Unknown.php Progetto: 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.");
     }
 }
Esempio n. 3
0
File: File.php Progetto: 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");
     }
 }
Esempio n. 4
0
File: Broken.php Progetto: 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);
 }