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