Commit: 249d0d49bb6e633692d0d455a5c8c5da16d3ef31
Author: Jon Adams | Date: 2010-03-27 21:26:01 -0700
diff --git a/config/bootstrap/cache.php b/config/bootstrap/cache.php
index 821ec8d..562850b 100644
--- a/config/bootstrap/cache.php
+++ b/config/bootstrap/cache.php
@@ -15,7 +15,12 @@ use lithium\core\Libraries;
use lithium\action\Dispatcher;
use lithium\storage\cache\adapter\Apc;
-$apcEnabled = Apc::enabled();
+/**
+ * If APC is not available and the cache directory is not writeable, bail out.
+ */
+if (!$apcEnabled = Apc::enabled() && !is_writable(LITHIUM_APP_PATH . '/resources/tmp/cache')) {
+ return;
+}
Cache::config(array(
'default' => array(
@@ -23,13 +28,6 @@ Cache::config(array(
)
));
-/**
- * If APC is not available and the cache directory is not writeable, bail out.
- */
-if (!$apcEnabled && !is_writable(LITHIUM_APP_PATH . '/resources/tmp/cache')) {
- return;
-}
-
Dispatcher::applyFilter('run', function($self, $params, $chain) {
if ($cache = Cache::read('default', 'core.libraryCache')) {
$cache = (array) unserialize($cache) + Libraries::cache();
diff --git a/config/bootstrap/test.php b/config/bootstrap/test.php
new file mode 100644
index 0000000..d004567
--- /dev/null
+++ b/config/bootstrap/test.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Lithium: the most rad php framework
+ *
+ * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
+ * @license http://opensource.org/licenses/bsd-license.php The BSD License
+ */
+
+use lithium\core\Libraries;
+use lithium\action\Dispatcher;
+use lithium\test\Controller;
+
+Dispatcher::applyFilter('run', function($self, $params, $chain) {
+ list($isTest, $args) = explode('/', $params['request']->url, 2) + array("", "");
+ $request = $params['request'];
+
+ if ($isTest === "test") {
+ $controller = new Controller();
+ $args = str_replace('/', '\\', $args);
+ return $controller($request, compact('args'));
+ }
+ return $chain->next($self, $params, $chain);
+});
+
+?>
\ No newline at end of file