From b10b294d8396eddbfe9d5e07e83c0885cbf19c68 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sun, 22 Jun 2014 22:28:40 -0700 Subject: [PATCH] Added method to get the application object instance. --- README.md | 1 + VERSION | 2 +- flight/Engine.php | 1 + flight/Flight.php | 8 +++++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e4d1ab..711ace6 100644 --- a/README.md +++ b/README.md @@ -816,6 +816,7 @@ Flight::set($key, $value) // Sets a variable. Flight::has($key) // Checks if a variable is set. Flight::clear([$key]) // Clears a variable. Flight::init() // Initializes the framework to its default settings. +Flight::app() // Gets the application object instance ``` ## Extensible Methods diff --git a/VERSION b/VERSION index 0664a8f..2bf1ca5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.6 +1.1.7 diff --git a/flight/Engine.php b/flight/Engine.php index d7f69db..ebf374f 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -55,6 +55,7 @@ class Engine { * * @param string $name Method name * @param array $params Method parameters + * @return mixed Callback results */ public function __call($name, $params) { $callback = $this->dispatcher->get($name); diff --git a/flight/Flight.php b/flight/Flight.php index 5cbfff6..951ba64 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -42,5 +42,11 @@ class Flight { return \flight\core\Dispatcher::invokeMethod(array(self::$engine, $name), $params); } -} + /** + * @return object Application instance + */ + public static function app() { + return self::$engine; + } +}