Esempio n. 1
0
 /**
  * Initializes the Spire framework.
  *
  * @return void
  */
 public static function initialize()
 {
     // Start the system.
     Spire::start();
     // Load routes.
     static::routes();
     // Find the current route.
     $route = Repository::retrieve(Request::method(), Uri::segmentString());
     // If no route was found, show a 404.
     if (empty($route)) {
         die('404');
     }
     // Instantiate the module.
     static::$module = $module = new Module($route);
     // Run the module.
     $response = $module->run();
     // Run the response.
     if (is_object($response) && method_exists($response, 'respond')) {
         $response->respond();
     }
     // Do we have a layout to process?
     $layout = $module->instance()->layout;
     // Process layout.
     if ($layout !== '') {
         echo Layout::get($layout);
     }
     // Close Spire.
     Spire::close();
 }
Esempio n. 2
0
 public function testCli()
 {
     $request = Request::cli();
     $this->assertInternalType('boolean', $request);
 }