Exemplo n.º 1
0
Arquivo: File.php Projeto: 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");
     }
 }
Exemplo n.º 2
0
Arquivo: Unknown.php Projeto: 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.");
     }
 }
Exemplo n.º 3
0
Arquivo: Node.php Projeto: jasny/Q
 /**
  * Execute file and return content of stdout.
  * 
  * @param Parameters will be escaped and passed as arguments.
  * @return string
  * @throws Fs_Exception if execution is not possible.
  * @throws ExecException if execution fails.
  */
 public function exec()
 {
     throw new Fs_Exception("Unable to execute '{$this->_path}': This is not a regular file, but a " . Fs::typeOfNode($this, Fs::DESCRIPTION));
 }