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


PHP Kohana::list_files方法代码示例

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


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

示例1: test_list_files_returns_array_on_success_and_failure

 /**
  * Kohana::list_files() should return an array on success and an empty array on failure
  *
  * @test
  * @covers Kohana::list_files
  */
 public function test_list_files_returns_array_on_success_and_failure()
 {
     $files = Kohana::list_files('config');
     $this->assertType('array', $files);
     $this->assertGreaterThan(3, count($files));
     $this->assertSame(array(), Kohana::list_files('geshmuck'));
 }
开发者ID:Tidwell,项目名称:HMXSongs-PHP-API,代码行数:13,代码来源:CoreTest.php

示例2: _execute

 /**
  * Generates a help list for all tasks
  *
  * @return null
  */
 protected function _execute(array $params)
 {
     $tasks = $this->_compile_task_list(Kohana::list_files('classes/task'));
     $view = new View('minion/help/list');
     $view->tasks = $tasks;
     echo $view;
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:12,代码来源:help.php

示例3: find_tests

 /**
  * Recurse into test directories to find all tests
  *
  * @param   string sub directory (under any /tests dir) to (recursively) look for tests in
  * @param   array  (optional) list of files to flatten (used for recursion)
  * @return  array  flattened list of all test files
  */
 public static function find_tests($directory = NULL, array $tests = NULL)
 {
     if (is_null($tests)) {
         if (is_null($directory)) {
             $tests_directory = "";
         } else {
             $tests_directory = 'tests' . DIRECTORY_SEPARATOR . trim($directory, DIRECTORY_SEPARATOR);
         }
         // Load tests from directory
         $tests = Kohana::list_files($tests_directory);
         // Load specified test case if found and make it first to run
         if (dirname($tests_directory) !== basename($tests_directory) and $test_file = Kohana::find_file(dirname($tests_directory), basename($tests_directory))) {
             array_unshift($tests, $test_file);
         }
     }
     $flattened_tests = array();
     foreach ($tests as $relative => $file) {
         if (is_array($file)) {
             $flattened_tests += self::find_tests(NULL, $file);
         } else {
             $flattened_tests[$relative] = $file;
         }
     }
     return $flattened_tests;
 }
开发者ID:banks,项目名称:unittest,代码行数:32,代码来源:unittest.php

示例4: index

 public function index()
 {
     // Require Zend_Amf_Server
     require_once 'Zend/Amf/Server.php';
     // *ZAMFBROWSER IMPLEMENTATION*
     // Require the ZendAmfServiceBrowser class, required to retrieve the list of methods on the ZendAMF server.
     require_once Kohana::find_file('vendor/ZamfBrowser', 'ZendAmfServiceBrowser');
     // Start Server
     $server = new Zend_Amf_Server();
     // $server->addDirectory( SHAREDPATH.Kohana::config('zendamf.services_path') );
     $services_path = APPPATH . Kohana::config('zendamf.services_path');
     $files = Kohana::list_files($services_path, FALSE);
     foreach ($files as $file) {
         $class = pathinfo($file, PATHINFO_FILENAME);
         $server->setClass($class);
     }
     // // do class mapping
     $vo_path = APPPATH . Kohana::config('zendamf.vo_path');
     $files = Kohana::list_files($vo_path, FALSE);
     foreach ($files as $file) {
         $class = pathinfo($file, PATHINFO_FILENAME);
         $server->setClassMap($class, $class);
     }
     // *ZAMFBROWSER IMPLEMENTATION*
     // Add the ZendAmfServiceBrowser class to the list of available classes.
     $server->setClass("ZendAmfServiceBrowser");
     // *ZAMFBROWSER IMPLEMENTATION*
     // Set this reference the class requires to the server object.
     // ZendAmfServiceBrowser::setAmfServer( $server );
     ZendAmfServiceBrowser::$ZEND_AMF_SERVER = $server;
     // Handle the AMF request
     echo $server->handle();
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:33,代码来源:amf_gateway.php

示例5: getPlugins

 /**
  * Get plugins
  *
  * @return void
  * @author Peter Bowyer
  */
 function getPlugins()
 {
     $x = Kohana::list_files(PLUGPATH, false, PLUGPATH);
     for ($i = 0; $i < count($x); $i++) {
         $x[$i] = substr($x[$i], strlen(PLUGPATH . '/') - 1);
     }
     return $x;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:14,代码来源:PluginManager.php

示例6: fetch_seed_groups

 public function fetch_seed_groups()
 {
     $groups = [];
     $files = Kohana::list_files('database/seeds');
     foreach ($files as $file => $path) {
         $groups[] = substr($file, 15);
     }
     return $groups;
 }
开发者ID:evopix,项目名称:minion-database,代码行数:9,代码来源:Manager.php

示例7: get_template_list

 function get_template_list()
 {
     $f = Kohana::list_files('views/containers');
     $arr = array();
     foreach ($f as $file) {
         $n = basename($file, ".php");
         $arr[$n] = $n;
     }
     return $arr;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:10,代码来源:containers.php

示例8: get_container_templates

 /**
  * get a list of container templates
  *
  * @return array
  * @author Andy Bennett
  */
 public static function get_container_templates()
 {
     $arr = array();
     $l = Kohana::list_files('views/container');
     foreach ($l as $f) {
         $n = basename($f, ".php");
         $arr[$n] = ucfirst($n);
     }
     return $arr;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:16,代码来源:containers.php

示例9: action_i18n

 /**
  * Dump all i18n files
  */
 public function action_i18n()
 {
     $files = Kohana::list_files('i18n');
     $i18n = array();
     foreach ($files as $key => $value) {
         // Trim off "i18n/" and ".php"
         $i18n[$key] = substr($key, 5, -strlen(EXT));
     }
     $this->template->content = View::factory('devtools/i18n', array('i18n' => $i18n));
 }
开发者ID:ametsuramet,项目名称:belajar_kohana,代码行数:13,代码来源:devtools.php

示例10: _getTaskClasses

 protected static function _getTaskClasses()
 {
     $aClasses = self::_getTaskClassesList(Kohana::list_files('classes/Task'));
     foreach ($aClasses as $iKey => $sClass) {
         if (!in_array('Interface_TaskLauncherTask', class_implements($sClass))) {
             unset($aClasses[$iKey]);
         }
     }
     return $aClasses;
 }
开发者ID:murich,项目名称:kohana-task-launcher,代码行数:10,代码来源:TaskLauncher.php

示例11: find_local

 /**
  * @return array
  */
 public static function find_local()
 {
     $patches_list = Kohana::list_files('patches', array(DOCROOT));
     $installed_patches = self::installed();
     $patches = array();
     foreach ($patches_list as $path) {
         $filename = pathinfo($path, PATHINFO_BASENAME);
         if (!in_array($filename, $installed_patches)) {
             $patches[$filename] = $path;
         }
     }
     return $patches;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:16,代码来源:patch.php

示例12: action_help

 /**
  * Prints out the help for a specific task
  *
  */
 public function action_help()
 {
     $tasks = Minion_Util::compile_task_list(Kohana::list_files('classes/minion/task'));
     $view = NULL;
     if (empty($this->_task)) {
         $view = new View('minion/help/list');
         $view->tasks = $tasks;
     } else {
         $inspector = new ReflectionClass($this->_retrieve_task());
         list($description, $tags) = Minion_Util::parse_doccomment($inspector->getDocComment());
         $view = View::factory('minion/help/task')->set('description', $description)->set('tags', (array) $tags)->set('task', $this->_task);
     }
     echo $view;
 }
开发者ID:reflectivedevelopment,项目名称:jfh-lib,代码行数:18,代码来源:minion.php

示例13: __construct

 public function __construct($name, $directory)
 {
     $this->name = $name;
     $files = Kohana::list_files($directory);
     foreach ($files as $file) {
         if (!is_file($file)) {
             continue;
         }
         if (substr_compare($file, 'Base_Test' . EXT, strlen($file) - strlen('Base_Test' . EXT)) !== 0) {
             PHPUnit_Util_Filter::addFileToFilter($file);
             $this->addTestFile($file);
         }
     }
 }
开发者ID:swk,项目名称:bluebox,代码行数:14,代码来源:PHPUnit_Test_Suite.php

示例14: _get_models

 public function _get_models()
 {
     $initial_classes = get_declared_classes();
     foreach (Kohana::list_files('models') as $file) {
         include_once $file;
     }
     $classes = array_diff(get_declared_classes(), $initial_classes);
     $models = array();
     foreach ($classes as $class) {
         if (is_subclass_of($class, 'ORM')) {
             $models[] = new $class();
         }
     }
     return $models;
 }
开发者ID:evansd-archive,项目名称:kohana-module--erd,代码行数:15,代码来源:erd.php

示例15: merge_resources

 /**
  * Method to merge resources
  * It finds out all the controllers and adds the basenames to the acl config array
  * as resources only if the key doesnot already exists
  */
 private function merge_resources()
 {
     $controllers = Kohana::list_files('classes/controller');
     // controllers can also be nested, so just flatten the array
     $controllers = Arr::flatten($controllers);
     foreach ($controllers as $controller) {
         $resource = basename($controller, '.php');
         if (self::is_resource_ignored($resource) || array_key_exists($resource, $this->_acl)) {
             continue;
         }
         $this->_acl[$resource] = array();
     }
     ksort($this->_acl);
     return $this;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:20,代码来源:config.php


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