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


PHP RecursiveIteratorIterator::getBasename方法代码示例

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


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

示例1: _getPluggableFiles

 private function _getPluggableFiles()
 {
     $FilePaths = array();
     $directory = new \RecursiveDirectoryIterator($this->directory);
     foreach ($F = new \RecursiveIteratorIterator($directory) as $filepath) {
         if (!$F->isDot() && $F->getDepth() === 1) {
             if ($F->getBasename() === $this->filename) {
                 $FilePaths[] = $filepath;
             }
         }
     }
     return $FilePaths;
 }
开发者ID:bhittani,项目名称:pluggable,代码行数:13,代码来源:Pluggable.php

示例2: execute

 /**
  * Executes the transformation process.
  *
  * @throws Zend_Console_Getopt_Exception
  *
  * @return void
  */
 public function execute()
 {
     $results = array();
     $longest_name = 0;
     /** @var RecursiveDirectoryIterator $files */
     $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/../'));
     while ($files->valid()) {
         // skip abstract files
         if (!$files->isFile() || $files->getBasename() == 'Abstract.php') {
             $files->next();
             continue;
         }
         // convert the filename to a class
         $class_name = 'DocBlox_Task_' . str_replace(DIRECTORY_SEPARATOR, '_', $files->getSubPath()) . '_' . $files->getBasename('.php');
         // check if the class exists, if so: add it to the list
         if (class_exists($class_name)) {
             $name = $files->getBasename('.php');
             $longest_name = max(strlen($name), $longest_name);
             $results[strtolower($files->getSubPath())][strtolower($name)] = $files->getRealPath();
         }
         $files->next();
     }
     // echo the list of namespaces with their tasks
     ksort($results, SORT_STRING);
     foreach ($results as $namespace => $tasks) {
         echo $namespace . PHP_EOL;
         asort($tasks, SORT_STRING);
         foreach ($tasks as $task => $filename) {
             // get the short description by reflecting the file.
             $refl = new DocBlox_Reflection_File($filename, false);
             $refl->setLogLevel(DocBlox_Core_Log::QUIET);
             $refl->process();
             /** @var DocBlox_Reflection_Class $class */
             $class = current($refl->getClasses());
             echo ' :' . str_pad($task, $longest_name + 2) . $class->getDocBlock()->getShortDescription() . PHP_EOL;
         }
     }
     echo PHP_EOL;
 }
开发者ID:rvanvelzen,项目名称:phpDocumentor2,代码行数:46,代码来源:List.php


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