當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Path::get_path_from_root方法代碼示例

本文整理匯總了PHP中Path::get_path_from_root方法的典型用法代碼示例。如果您正苦於以下問題:PHP Path::get_path_from_root方法的具體用法?PHP Path::get_path_from_root怎麽用?PHP Path::get_path_from_root使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Path的用法示例。


在下文中一共展示了Path::get_path_from_root方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_file

 public static function get_file($call)
 {
     if (!empty($call['file'])) {
         return Path::get_path_from_root($call['file']);
     }
     return 'Internal';
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:7,代碼來源:ExceptionUtils.class.php

示例2: get_path_from_root

 /**
  * @desc Returns the element path from the phpboost root.
  * @return string The element from the phpboost root.
  */
 public function get_path_from_root()
 {
     $path_from_root = Path::get_path_from_root($this->path);
     if (empty($path_from_root)) {
         return $this->path;
     }
     return $path_from_root;
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:12,代碼來源:FileSystemElement.class.php

示例3: add_classes

 private static function add_classes($directory, $pattern, $recursive = true)
 {
     $files = array();
     $folder = new Folder($directory);
     $relative_path = Path::get_path_from_root($folder->get_path());
     $files = $folder->get_files($pattern);
     foreach ($files as $file) {
         $filename = $file->get_name();
         $classname = $file->get_name_without_extension();
         self::$autoload[$classname] = $relative_path . '/' . $filename;
     }
     if ($recursive) {
         $folders = $folder->get_folders('`^[a-z]{1}.*$`i');
         foreach ($folders as $a_folder) {
             if (!in_array($a_folder->get_path_from_root(), self::$exclude_paths) && !in_array($a_folder->get_name(), self::$exclude_folders_names)) {
                 self::add_classes($a_folder->get_path(), $pattern);
             }
         }
     }
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:20,代碼來源:ClassLoader.class.php

示例4: get_stackstrace_as_string

 protected function get_stackstrace_as_string($start_trace_index)
 {
     $stack = '[0] ' . Path::get_path_from_root($this->errfile) . ':' . $this->errline;
     if (count($this->exception->getTrace()) > 2) {
         $stack .= Debug::is_output_html() ? '<br />' : "\n";
         $stack .= Debug::get_stacktrace_as_string($start_trace_index);
     }
     return $stack;
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:9,代碼來源:ErrorHandler.class.php

示例5: test_get_path_from_root

 public function test_get_path_from_root()
 {
     $path_from_root = '/kernel/framework/util';
     $path = Path::phpboost_path() . $path_from_root;
     self::assertEquals($path_from_root, Path::get_path_from_root($path));
 }
開發者ID:AroundPBT,項目名稱:PHPBoost,代碼行數:6,代碼來源:PathTest.php


注:本文中的Path::get_path_from_root方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。