/** * 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) . "."); } }
/** * 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."); } }
/** * 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"); } }
/** * 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); }