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


PHP Docs::classes方法代码示例

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


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

示例1: class_methods

 /**
  * Get all classes and methods of files in a list.
  *
  * >  I personally don't like this as it was used on the index page.  Way too much stuff on one page.  It has potential for a package index page though.
  * >  For example:  class_methods( Kohana::list_files('classes/sprig') ) could make a nice index page for the sprig package in the api browser
  * >     ~bluehawk
  *
  */
 public static function class_methods(array $list = NULL)
 {
     $list = Docs::classes($list);
     $classes = array();
     foreach ($list as $class) {
         $_class = new ReflectionClass($class);
         if (stripos($_class->name, 'MyQEE') === 0) {
             // Skip the extension stuff stuff
             continue;
         }
         $methods = array();
         foreach ($_class->getMethods() as $_method) {
             $declares = $_method->getDeclaringClass()->name;
             if (stripos($declares, 'MyQEE') === 0) {
                 // Remove "Kohana_"
                 $declares = substr($declares, 7);
             }
             if ($declares === $_class->name) {
                 $methods[] = $_method->name;
             }
         }
         sort($methods);
         $classes[$_class->name] = $methods;
     }
     return $classes;
 }
开发者ID:google2013,项目名称:myqeecms,代码行数:34,代码来源:Docs.class.php

示例2: loader_import

loader_import('docs.Docs');
loader_import('docs.Filters');
loader_import('docs.Functions');
$data = array();
$data['packages'] = docs_cache('packages');
if (!is_array($data['packages'])) {
    $data['packages'] = docs_cache_store(Docs::packages($parameters['current']), 'packages');
}
if (strpos($parameters['package'], '.') !== false) {
    if (!in_array($parameters['package'], $data['packages']) && $data['package'] != $data['current']) {
        die('Invalid package!');
    }
    $data['package'] = $parameters['package'];
    $data['classes'] = docs_cache('classes', $parameters['package']);
    if (!is_array($data['classes'])) {
        $data['classes'] = docs_cache_store(Docs::classes($parameters['package']), 'classes', $parameters['package']);
    }
    $data['functions'] = docs_cache('functions', $parameters['package']);
    if (!is_array($data['functions'])) {
        $data['functions'] = docs_cache_store(Docs::functions($parameters['package']), 'functions', $parameters['package']);
    }
    if ($parameters['class']) {
        if (!Docs::isClass($parameters['class'], $data['classes'])) {
            die('Invalid class!');
        }
        $data['class'] = $parameters['class'];
        if ($parameters['class'] == '_functions_') {
            $functions = docs_cache('func_data', $parameters['package']);
            if (!is_array($functions)) {
                $functions = docs_cache_store(Docs::getFunctions($parameters['package']), 'func_data', $parameters['package']);
            }
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php


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