protected function prepare_path() { $path = NULL; if ($this->has('path')) { $path = $this->get('path'); } else { $path = $this->get_name(); } return DF_Web_Path::fromString("{$path}"); }
/** * * @param DF_Web_Path $sub * @return DF_Web_Path */ public function append_path($sub) { if (!$sub instanceof DF_Web_Path) { throw new DF_Error_InvalidArgumentException('sub', $sub, DF_Web_Path); } $sub_str = "{$sub}"; if ($sub->is_absolute()) { $sub_str = substr($sub_str, 1); } $base_str = "{$this}"; if (!$this->has_trailing_slash()) { $base_str .= "/"; } $new_path = "{$base_str}{$sub_str}"; return DF_Web_Path::fromString($new_path); }
public function log_execution_time() { $time = $this->get_execution_time(); $time = round($time, 3); $request = $this->request; $path = DF_Web_Path::fromString($request->get_path()); self::$LOGGER->debug("Page processing time: {$time} seconds ({$path})"); }
/** * @return DF_Web_Path */ protected function prepare_path() { $path = DF_Web_Path::fromString($this->namespace); return $path; }
public function get_private_path() { $name = $this->get_name(); $ctrlpath = $this->controller_path; $private_path = "{$name}"; if (strlen($private_path)) { $private_path = "/{$private_path}"; } if ("{$ctrlpath}") { $private_path = "/{$ctrlpath}{$private_path}"; } return DF_Web_Path::fromString($private_path); }
/** * * @param DF_Web_Routing_Config_Action $config * @return DF_Web_Path */ protected function prepare_path($config) { $stars = array(); $captures = $this->captures; for ($i = 0; $i < $captures->get_numargs(); $i++) { $stars[] = "*"; } $argspath = join("/", $stars); $path = $config->get_path(); #if (!$path->is_absolute()) { # $controller = new DF_Web_Path("/".$this->controller->get_path()); # $path = $controller->append_path($path); #} if ($argspath) { $path = $path->append_path(DF_Web_Path::fromString($argspath)); } return $path; }
public static function fromString($string) { $path = DF_Web_Path::fromString($string); return new DF_Web_Path_Part($path); }