本文整理匯總了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';
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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));
}