本文整理汇总了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));
}