/** * Realiza el despachado de la petición web. * @author Ignacio Daniel Rostagno <*****@*****.**> */ public static function dispatch() { // Obtenemos la URL pedida actualmente. if (php_sapi_name() == 'cli-server') { $url = $_SERVER['REQUEST_URI']; } else { $url = Request::current_url(); } $url = trim($url, '/'); // En caso de ser /, la transformamos en vacia. if ($url === '/') { $url = ''; } // Verificamos theme. if (preg_match('/^(\\/){0,1}(theme)\\/([a-z0-9_]+)\\/(assets)\\/(css|js)\\/([a-z0-9_\\.]+)(\\.css|\\.js)$/D', $url) || preg_match('/^(\\/){0,1}(plugin)\\/([a-z0-9]+)\\/(theme)\\/([a-z0-9_]+)\\/(assets)\\/(css|js)\\/([a-z0-9_\\.]+)(\\.css|\\.js)$/D', $url)) { Assets::reverse_compile(APP_BASE . DS . $url, !DEBUG); } return self::route($url); }
/** * phpinfoからattachする * @param string $path */ protected final function attach_self($path) { $this->media_url(Request::current_url() . '/'); if ($this->args() != null) { Log::disable_display(); Http::attach(new File($path . $this->args())); exit; } }
/** * 現在のURLを返す * @return string */ public function current_url() { return Request::current_url(); }
private function add_vars_other_tree($package_name, $root = '') { $trees = array('trunk' => false); foreach (array('branches', 'tags') as $path) { $rep_path = trim(implode('/', array($root, $path)), '/'); $list = Subversion::cmd('list', array(implode('/', array(OpenpearConfig::svn_root(), $package_name, $rep_path)))); if (is_array($list)) { foreach ($list as $file) { if (isset($file['kind']) && $file['kind'] == 'dir') { $trees[implode('/', array($path, $file['name']))] = false; } } } } foreach ($trees as $path => $current) { if (strpos(Request::current_url(), $path) !== false) { $trees[$path] = true; } } $this->vars('other_tree', $trees); }