當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。