/** * Constructor. * Please, see \DirectoryIterator::__construct() method. * We add the $splFileInfoClass parameter. * * @param string $path Path. * @param string $splFileInfoClass SplFileInfo classname. */ public function __construct($path, $splFileInfoClass = null) { $this->_splFileInfoClass = $splFileInfoClass; parent::__construct($path); $this->setRelativePath($path); return; }
/** * @param string $path * @param int $flags */ public function __construct($path, $flags = null) { if ($flags === null) { $flags = self::KEY_AS_PATHNAME | self::CURRENT_AS_FILEINFO | self::SKIP_DOTS; } $this->flags = $flags; parent::__construct($path); }
/** * ( excerpt from http://php.net/manual/en/filesystemiterator.construct.php * ) * * Constructs a new filesystem iterator from the path. * * @path mixed The path of the filesystem item to be iterated over. * @flags mixed Flags may be provided which will affect the behavior * of some methods. A list of the flags can found under * FilesystemIterator predefined constants. They can * also be set later with * FilesystemIterator::setFlags() * * @return mixed No value is returned. */ public function __construct($path, $flags = null) { parent::__construct($path); if ($flags === null) { $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS; } $this->flags = $flags; $this->goPastDotsIfNeeded(); }
/** * Creates a GenericDirectory instance. * * @param string|array $pathname The pathname of the directory to traverse. * @throws DirectoryNotValidException If the pathname is not a directory. * @throws DirectoryNotReadableException If the pathname is not readable. */ public function __construct($pathname) { // given pathname is an array, build up path if (is_array($pathname)) { $pathname = join(DIRECTORY_SEPARATOR, $pathname); } // pathname is not a directory if (is_dir($pathname) === false) { throw new DirectoryNotValidException(sprintf("The given pathname '%s' is not a directory.", $pathname)); } // try to open directory if (is_readable($pathname) === false) { throw new DirectoryNotReadableException(sprintf("Failed reading contents from given pathname '%s'. Please check permissions.", $pathname)); } // run DirectoryIterator constructor logic parent::__construct($pathname); }
/** * Constructor * * @param string $path * @throws \RuntimeException * @throws \InvalidArgumentException */ public function __construct($path) { if (!is_string($path)) { throw new \InvalidArgumentException('DirectoryIterator::__construct - Argument 1 expected to be string, ' . gettype($path) . ' seen.'); } $realpath = realpath($path); if ($realpath === false) { throw new \RuntimeException('DirectoryIterator::__construct - Could not find specified file at path "' . $path . '".'); } if (!is_dir($realpath)) { throw new \RuntimeException('DirectoryIterator::__construct - The directory name is invalid.'); } switch (php_uname('s')) { case 'Windows NT': $this->_os = 'windows'; break; default: $this->_os = 'linux'; } parent::__construct($realpath); }
public function __construct($path, $root) { $this->root = $root; parent::__construct($path); }
public function __construct($path, $dirsOnly = true) { $this->dirsOnly = $dirsOnly; parent::__construct($path); }
public function __construct($path) { parent::__construct($path); }
function __construct($dir) { echo __METHOD__ . "\n"; parent::__construct($dir); }
public function __construct($resource, $path) { $sftp = ssh2_sftp($resource); $realpath = 'ssh2.sftp://' . $sftp . $path; parent::__construct($realpath); }
public function __construct($path, $extensions) { if (is_array($extensions)) { $this->regexp = '`\\.(' . implode('|', $extensions) . ')$`i'; } else { $this->regexp = '`\\.(' . $extensions . ')$`i'; } //appel le constructeur parent parent::__construct($path); }
public function __construct($path) { /*** pass the $path off to the parent class constructor ***/ parent::__construct($path); }
/** * @param $path */ public function __construct($path) { if (is_dir($path)) { parent::__construct($path); } }
public function __construct($f) { parent::__construct($f); }
function __construct($path, $flags = 0) { parent::__construct($path); $this->flags = $flags; }