/** * Handles calls to static methods. * * @param string $name Method name * @param array $params Method parameters * @return mixed Callback results */ public static function __callStatic($name, $params) { static $initialized = false; if (!$initialized) { require_once __DIR__ . '/autoload.php'; self::$engine = new \flight\Engine(); $initialized = true; } return \flight\core\Dispatcher::invokeMethod(array(self::$engine, $name), $params); }
/** * @return object 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; }