本文整理汇总了PHP中DirectoryIterator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP DirectoryIterator::__construct方法的具体用法?PHP DirectoryIterator::__construct怎么用?PHP DirectoryIterator::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DirectoryIterator
的用法示例。
在下文中一共展示了DirectoryIterator::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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;
}
示例2: __construct
/**
* @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);
}
示例3: __construct
/**
* ( 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();
}
示例4: __construct
/**
* 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);
}
示例5: __construct
/**
* 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);
}
示例6: __construct
public function __construct($path, $root)
{
$this->root = $root;
parent::__construct($path);
}
示例7: __construct
public function __construct($path, $dirsOnly = true)
{
$this->dirsOnly = $dirsOnly;
parent::__construct($path);
}
示例8: __construct
public function __construct($path)
{
parent::__construct($path);
}
示例9:
function __construct($dir)
{
echo __METHOD__ . "\n";
parent::__construct($dir);
}
示例10: __construct
public function __construct($resource, $path)
{
$sftp = ssh2_sftp($resource);
$realpath = 'ssh2.sftp://' . $sftp . $path;
parent::__construct($realpath);
}
示例11: __construct
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);
}
示例12: __construct
public function __construct($path)
{
/*** pass the $path off to the parent class constructor ***/
parent::__construct($path);
}
示例13: __construct
/**
* @param $path
*/
public function __construct($path)
{
if (is_dir($path)) {
parent::__construct($path);
}
}
示例14: __construct
public function __construct($f)
{
parent::__construct($f);
}
示例15:
function __construct($path, $flags = 0)
{
parent::__construct($path);
$this->flags = $flags;
}