public static function get_file($call) { if (!empty($call['file'])) { return Path::get_path_from_root($call['file']); } return 'Internal'; }
/** * @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; }
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); } } } }
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; }
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)); }