Пример #1
0
 private function parseUrl($url)
 {
     $url = parse_url($url);
     $path = array_filter(explode('/', str_replace(Route::getPublicPath(), '', $url['path'])));
     $url['controller'] = $this->parseController(array_shift($path));
     $url['method'] = $this->parseMethod(array_shift($path));
     $url['arguments'] = $path;
     $url['query'] = isset($url['query']) ? $url['query'] : '';
     parse_str($url['query'], $url['query']);
     return $url;
 }
Пример #2
0
 private static function loadFile($key)
 {
     $path = Route::getConfigPath();
     $config = array();
     if (is_file($file = $path . '/' . $key . '.php')) {
         $config = (require $file);
     }
     if (is_file($file = $path . '/custom/' . $key . '.php')) {
         $config = array_replace($config, require $file);
     }
     return $config;
 }
Пример #3
0
function route($path)
{
    return Route::getPublicUrl($path);
}
Пример #4
0
 protected function composerInstall()
 {
     return (new Repository\Composer(Route::getBasePath(), true))->install()->getShellAndLog();
 }
Пример #5
0
 protected function publicAsset($file)
 {
     return Route::getPublicUrl('/storage/assets/' . ltrim($file, '/'));
 }
Пример #6
0
 private function git()
 {
     return new Repository\Git(Route::getBasePath());
 }
Пример #7
0
 public function __construct()
 {
     $this->path = Router\Route::getTemplatePath();
 }
Пример #8
0
 private function getLogFile()
 {
     return Route::getStoragePath('/logs/' . microtime(true) . '-' . uniqid());
 }