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


PHP RecursiveIteratorIterator::setMaxDepth方法代码示例

本文整理汇总了PHP中RecursiveIteratorIterator::setMaxDepth方法的典型用法代码示例。如果您正苦于以下问题:PHP RecursiveIteratorIterator::setMaxDepth方法的具体用法?PHP RecursiveIteratorIterator::setMaxDepth怎么用?PHP RecursiveIteratorIterator::setMaxDepth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecursiveIteratorIterator的用法示例。


在下文中一共展示了RecursiveIteratorIterator::setMaxDepth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: readData

 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // stats
     if (LINKLIST_ENABLE_STATISTICS) {
         $this->stats = array_merge(StatsCacheBuilder::getInstance()->getData(), UserStatsCacheBuilder::getInstance()->getData());
     }
     // get categories
     $categoryTree = new LinklistCategoryNodeTree('de.incendium.linklist.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // get featured entries
     $this->featuredEntryList = new AccessibleEntryList();
     $this->featuredEntryList->getConditionBuilder()->add('entry.isFeatured = ?', array(1));
     $this->featuredEntryList->sqlLimit = 10;
     $this->featuredEntryList->sqlOrderBy = 'RAND()';
     $this->featuredEntryList->readObjects();
     // remove default breadcrumb entry and set current page as 'website'
     if (WCF::isLandingPage()) {
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Linklist', array('application' => 'linklist')), true);
         MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
         MetaTagHandler::getInstance()->addTag('og:title', 'og:title', WCF::getLanguage()->get(PAGE_TITLE), true);
         MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get(PAGE_DESCRIPTION), true);
     }
 }
开发者ID:Griborim,项目名称:de.incendium.cms.linklist,代码行数:28,代码来源:LinklistPage.class.php

示例2: _createIterator

 /**
  * Creates an iterator with settings
  * Resets class-wide results
  *
  * @param  $items  array
  *
  * @return object  \RecursiveIteratorIterator
  */
 protected function _createIterator(array $items)
 {
     $this->result = [];
     $iterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($items));
     $iterator->setMaxDepth($this->max_depth);
     return $iterator;
 }
开发者ID:JREAM,项目名称:php-recursive,代码行数:15,代码来源:AbstractBase.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param \RecursiveIteratorIterator $iterator    The Iterator to filter
  * @param array                      $comparators An array of \NumberComparator instances
  */
 public function __construct(\RecursiveIteratorIterator $iterator, array $comparators)
 {
     $minDepth = 0;
     $maxDepth = INF;
     foreach ($comparators as $comparator) {
         switch ($comparator->getOperator()) {
             case '>':
                 $minDepth = $comparator->getTarget() + 1;
                 break;
             case '>=':
                 $minDepth = $comparator->getTarget();
                 break;
             case '<':
                 $maxDepth = $comparator->getTarget() - 1;
                 break;
             case '<=':
                 $maxDepth = $comparator->getTarget();
                 break;
             default:
                 $minDepth = $maxDepth = $comparator->getTarget();
         }
     }
     $this->minDepth = $minDepth;
     $iterator->setMaxDepth(INF === $maxDepth ? -1 : $maxDepth);
     parent::__construct($iterator);
 }
开发者ID:faridos,项目名称:ServerGroveLiveChat,代码行数:32,代码来源:DepthRangeFilterIterator.php

示例4: __construct

    /**
     * Constructor.
     *
     * @param \RecursiveIteratorIterator $iterator    The Iterator to filter
     * @param int                        $minDepth    The min depth
     * @param int                        $maxDepth    The max depth
     */
    public function __construct(\RecursiveIteratorIterator $iterator, $minDepth = 0, $maxDepth = INF)
    {
        $this->minDepth = $minDepth;
        $iterator->setMaxDepth(INF === $maxDepth ? -1 : $maxDepth);

        parent::__construct($iterator);
    }
开发者ID:Robert-Xie,项目名称:php-framework-benchmark,代码行数:14,代码来源:DepthRangeFilterIterator.php

示例5: readData

 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get the accessible news categories
     $categoryTree = new NewsCategoryNodeTree('de.voolia.news.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if (!$this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
         // set default publication and archivation date
         $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->publicationDate = $this->archivingDate = $dateTime->format('c');
     }
     // add breadcrumbs
     NEWSCore::getInstance()->setBreadcrumbs();
 }
开发者ID:joshuaruesweg,项目名称:de.voolia.news,代码行数:30,代码来源:NewsAddForm.class.php

示例6: __construct

 /**
  * @param IItem $root
  * @param int $maxDepth
  * @param array $filter
  */
 public function __construct(IItem $root, $maxDepth = -1, $filter = array())
 {
     parent::__construct($root, parent::SELF_FIRST);
     parent::setMaxDepth($maxDepth);
     $this->filter = $filter;
     $this->accessor = PropertyAccess::getPropertyAccessor();
     $this->iterated = new \SplObjectStorage();
 }
开发者ID:appsco,项目名称:component-firi,代码行数:13,代码来源:BushIterator.php

示例7: readData

 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get categories
     $categoryTree = new FilebaseCategoryNodeTree('de.incendium.filebase.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // add breadcrumbs
     FILEBASECore::getInstance()->setLocation($this->category->getParentCategories());
 }
开发者ID:Griborim,项目名称:de.incendium.cms.filebase,代码行数:13,代码来源:EntryListPage.class.php

示例8: _get_rit

 private function _get_rit()
 {
     $config = (array) Kohana::$config->load('finder');
     $config = Arr::merge($config, $this->filter);
     Finder_Filter_Iterator::$config = $config;
     $this->dit = new Finder_Filter_Iterator($this->dit);
     $rit = new RecursiveIteratorIterator($this->dit, RecursiveIteratorIterator::SELF_FIRST);
     $rit->setMaxDepth($this->max_depth);
     return $rit;
 }
开发者ID:coolswitcher,项目名称:kohana_modules,代码行数:10,代码来源:Core.php

示例9: getFiles

function getFiles($path)
{
    $dir = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
    // Flatten the recursive iterator, folders come before their files
    $it = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::SELF_FIRST);
    // Maximum depth is 1 level deeper than the base folder
    $it->setMaxDepth(1);
    $res = "";
    foreach ($it as $fileinfo) {
        $res .= '<option >' . $fileinfo->getFilename() . '</option>';
    }
    return $res;
}
开发者ID:andrewing10,项目名称:Angularjs-and-codeIgniter,代码行数:13,代码来源:fileinfo.php

示例10: phpbb_load_extensions_autoloaders

/**
* Load the autoloaders added by the extensions.
*
* @param string $phpbb_root_path Path to the phpbb root directory.
*/
function phpbb_load_extensions_autoloaders($phpbb_root_path)
{
    $iterator = new \RecursiveIteratorIterator(new \phpbb\recursive_dot_prefix_filter_iterator(new \RecursiveDirectoryIterator($phpbb_root_path . 'ext/', \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)), \RecursiveIteratorIterator::SELF_FIRST);
    $iterator->setMaxDepth(2);
    foreach ($iterator as $file_info) {
        if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2) {
            $filename = $file_info->getRealPath() . '/autoload.php';
            if (file_exists($filename)) {
                require $filename;
            }
        }
    }
}
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:18,代码来源:functions.php

示例11: countThemePages

 protected function countThemePages($path)
 {
     $result = 0;
     $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
     $it->setMaxDepth(1);
     while ($it->valid()) {
         if (!$it->isDot() && !$it->isDir() && $it->getExtension() == 'htm') {
             $result++;
         }
         $it->next();
     }
     return $result;
 }
开发者ID:janusnic,项目名称:october-heroku,代码行数:13,代码来源:ThemeTest.php

示例12: discoverDirectory

 private function discoverDirectory($path, $recursive = true)
 {
     if (false) {
         Log::Warning('Not valid directory: %s', $path);
         return;
     }
     $rdi = new \RecursiveDirectoryIterator(realpath($path));
     $iterator = new \RecursiveIteratorIterator($rdi);
     $iterator->setMaxDepth($recursive ? -1 : 0);
     foreach ($iterator as $file) {
         if ($file->isFile() && $file->getExtension() == 'php') {
             $this->AddClassFile($file->getRealPath());
         }
     }
 }
开发者ID:samuferenc,项目名称:codegenerator,代码行数:15,代码来源:CodeGenerator.php

示例13: debug_dir_list

function debug_dir_list($dir_recurse_depth = 0, $dir_list_root = '.')
{
    // Create a recursive file system directory iterator.
    $dir_iter = new RecursiveDirectoryIterator($dir_list_root, RecursiveDirectoryIterator::SKIP_DOTS);
    // Create a recursive iterator.
    $iter = new RecursiveIteratorIterator($dir_iter, RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
    // The maximum recursive path.
    $iter->setMaxDepth($dir_recurse_depth);
    // List of paths Include current paths
    $path = array($dir_list_root);
    foreach ($iter as $path => $dir) {
        if ($dir_recurse_depth == 0 && $dir->isDir()) {
            $path .= "/";
        }
        $paths[] = $path;
    }
    return $paths;
}
开发者ID:lalocespedes,项目名称:cfdi-xml-change-name,代码行数:18,代码来源:index.php

示例14: RecursiveDirectoryIterator

	function dir_list($dir_recurse_depth = 0, $dir_list_root = '.') {

		$dir_iter = new RecursiveDirectoryIterator(
			$dir_list_root,
			RecursiveDirectoryIterator::SKIP_DOTS);
		$iter = new RecursiveIteratorIterator(
			$dir_iter,
			RecursiveIteratorIterator::SELF_FIRST,
			RecursiveIteratorIterator::CATCH_GET_CHILD
			);

		$iter->setMaxDepth($dir_recurse_depth);
		$path = array($dir_list_root);
		foreach ($iter as $path => $dir) {
			if ($dir_recurse_depth == 0 && $dir->isDir()) $path .= "/";
				$paths[] = substr($path,2);
		}
		return $paths;
	}
开发者ID:akashsinha123,项目名称:php-practice,代码行数:19,代码来源:script.php

示例15: readData

 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get categories
     $excludedCategoryIDs = array_diff(FilebaseCategory::getAccessibleCategoryIDs(), FilebaseCategory::getAccessibleCategoryIDs(array('canUseCategory')));
     $categoryTree = new FilebaseCategoryNodeTree('de.incendium.filebase.category', 0, false, $excludedCategoryIDs);
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if (!$this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
     }
 }
开发者ID:Griborim,项目名称:de.incendium.cms.filebase,代码行数:25,代码来源:EntryAddForm.class.php


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