Commit: e53400bee65403d1dd0919051a68dc579df7b25c
Author: Joël Perras | Date: 2010-05-05 02:42:57 -0400
diff --git a/config/bootstrap/action.php b/config/bootstrap/action.php
index 146039b..d6a81aa 100644
--- a/config/bootstrap/action.php
+++ b/config/bootstrap/action.php
@@ -23,15 +23,25 @@ use \lithium\core\Environment;
use \lithium\action\Dispatcher;
/**
- * This filter loads all application routes in all plugins, loading the default application routes
- * last. Change this code if plugin routes must be loaded in a specific order, or if application
- * routes must be loaded first (in which case the catch-all routes should be removed). If
- * `Dispatcher::run()` is called multiple times in the course of a single request, change the
+ * This filter intercepts the `run()` of the `Dispatcher`, and first passes the `'request'`
+ * parameter (an instance of the `Request` object) to the `Environment` class to detect which
+ * environment the application is running in. Then, loads all application routes in all plugins,
+ * loading the default application routes last.
+ *
+ * Change this code if plugin routes must be loaded in a specific order (i.e. not the same order as
+ * the plugins are added in your bootstrap configuration), or if application routes must be loaded
+ * first (in which case the default catch-all routes should be removed).
+ *
+ * If `Dispatcher::run()` is called multiple times in the course of a single request, change the
* `include`s to `include_once`.
*
+ * @see lithium\action\Request
+ * @see lithium\core\Environment
* @see lithium\net\http\Router
*/
Dispatcher::applyFilter('run', function($self, $params, $chain) {
+ Environment::set($params['request']);
+
foreach (array_reverse(Libraries::get()) as $name => $config) {
if ($name === 'lithium') {
continue;
@@ -42,16 +52,4 @@ Dispatcher::applyFilter('run', function($self, $params, $chain) {
return $chain->next($self, $params, $chain);
});
-/**
- * Intercepts the `Dispatcher` as it finds a controller object, and passes the `'request'` parameter
- * to the `Environment` class to detect which environment the application is running in.
- *
- * @see lithium\action\Request
- * @see lithium\core\Environment
- */
-Dispatcher::applyFilter('_callable', function($self, $params, $chain) {
- Environment::set($params['request']);
- return $chain->next($self, $params, $chain);
-});
-
?>
\ No newline at end of file
diff --git a/config/bootstrap/libraries.php b/config/bootstrap/libraries.php
index 575daae..2d6599a 100644
--- a/config/bootstrap/libraries.php
+++ b/config/bootstrap/libraries.php
@@ -21,7 +21,7 @@ require LITHIUM_LIBRARY_PATH . '/lithium/util/Inflector.php';
require LITHIUM_LIBRARY_PATH . '/lithium/util/String.php';
require LITHIUM_LIBRARY_PATH . '/lithium/core/Adaptable.php';
require LITHIUM_LIBRARY_PATH . '/lithium/core/Environment.php';
-require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Base.php';
+require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Message.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Media.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Request.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Response.php';