Flight::app PHP Method

app() public static method

public static app ( ) : Engine
return flight\Engine Application instance
    public static function app()
    {
        static $initialized = false;
        if (!$initialized) {
            require_once __DIR__ . '/autoload.php';
            self::$engine = new \flight\Engine();
            $initialized = true;
        }
        return self::$engine;
    }

Usage Example

Esempio n. 1
0
 /**
  * Handles calls to static methods.
  *
  * @param string $name Method name
  * @param array $params Method parameters
  * @return mixed Callback results
  * @throws \Exception
  */
 public static function __callStatic($name, $params)
 {
     $app = Flight::app();
     return \flight\core\Dispatcher::invokeMethod(array($app, $name), $params);
 }