当前位置: 首页>>代码示例>>PHP>>正文


PHP DirectoryIterator::__construct方法代码示例

本文整理汇总了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;
 }
开发者ID:Grummfy,项目名称:Central,代码行数:15,代码来源:Directory.php

示例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);
 }
开发者ID:onedaylabs,项目名称:onedaylabs.com,代码行数:12,代码来源:FilesystemIterator.php

示例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();
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:24,代码来源:FilesystemIterator.php

示例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);
 }
开发者ID:johnnyos,项目名称:johnnyos,代码行数:24,代码来源:GenericDirectory.php

示例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);
 }
开发者ID:dcarbone,项目名称:directory-iterator-plus,代码行数:28,代码来源:DirectoryIteratorPlus.php

示例6: __construct

 public function __construct($path, $root)
 {
     $this->root = $root;
     parent::__construct($path);
 }
开发者ID:getherbie,项目名称:herbie,代码行数:5,代码来源:DirectoryIterator.php

示例7: __construct

 public function __construct($path, $dirsOnly = true)
 {
     $this->dirsOnly = $dirsOnly;
     parent::__construct($path);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:5,代码来源:VersionedDirectoryIterator.php

示例8: __construct

 public function __construct($path)
 {
     parent::__construct($path);
 }
开发者ID:heartshare,项目名称:walden,代码行数:4,代码来源:Document.php

示例9:

 function __construct($dir)
 {
     echo __METHOD__ . "\n";
     parent::__construct($dir);
 }
开发者ID:gleamingthecube,项目名称:php,代码行数:5,代码来源:ext_phar_tests_phar_oo_004U.php

示例10: __construct

 public function __construct($resource, $path)
 {
     $sftp = ssh2_sftp($resource);
     $realpath = 'ssh2.sftp://' . $sftp . $path;
     parent::__construct($realpath);
 }
开发者ID:yrsdi,项目名称:ssh,代码行数:6,代码来源:SSHDirectoryIterator.php

示例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);
 }
开发者ID:biggtfish,项目名称:magixcms,代码行数:10,代码来源:makefiles.php

示例12: __construct

 public function __construct($path)
 {
     /*** pass the $path off to the parent class constructor ***/
     parent::__construct($path);
 }
开发者ID:Birjemin,项目名称:Study,代码行数:5,代码来源:demo8.php

示例13: __construct

 /**
  * @param $path
  */
 public function __construct($path)
 {
     if (is_dir($path)) {
         parent::__construct($path);
     }
 }
开发者ID:AtiqulHaque,项目名称:phprightway,代码行数:9,代码来源:DirectoryReader.php

示例14: __construct

 public function __construct($f)
 {
     parent::__construct($f);
 }
开发者ID:garrettw,项目名称:dice,代码行数:4,代码来源:DiceSpec.php

示例15:

 function __construct($path, $flags = 0)
 {
     parent::__construct($path);
     $this->flags = $flags;
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:5,代码来源:RecursiveDirectoryIterator.php


注:本文中的DirectoryIterator::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。