Browse files

updating bootstrap.php with checks for PHP_SAPI. Removing the check f…

…rom cache.php.
  • Loading branch information...
1 parent 321fe4d commit ca22f776849108bb451f5e607f83426a12beaf22 @gwoo committed Jan 5, 2012
Showing with 7 additions and 8 deletions.
  1. +6 −3 app/config/bootstrap.php
  2. +1 −5 app/config/bootstrap/cache.php
View
9 app/config/bootstrap.php
@@ -42,7 +42,9 @@
* This file contains configurations for connecting to external caching resources, as well as
* default caching rules for various systems within your application
*/
-require __DIR__ . '/bootstrap/cache.php';
+if (PHP_SAPI !== 'cli') {
+ require __DIR__ . '/bootstrap/cache.php';
+}
/**
* Include this file if your application uses one or more database connections.
@@ -78,7 +80,8 @@
/**
* This file configures console filters and settings, specifically output behavior and coloring.
*/
-// require __DIR__ . '/bootstrap/console.php';
-
+if (PHP_SAPI === 'cli') {
+ require __DIR__ . '/bootstrap/console.php';
+}
?>
View
6 app/config/bootstrap/cache.php
@@ -16,10 +16,6 @@
use lithium\action\Dispatcher;
use lithium\storage\cache\adapter\Apc;
-if (PHP_SAPI === 'cli') {
- return;
-}
-
/**
* If APC is not available and the cache directory is not writeable, bail out. This block should be
* removed post-install, and the cache should be configured with the adapter you plan to use.
@@ -43,7 +39,7 @@
Cache::config(compact('default'));
/**
- * Caches paths for auto-loaded and service-located classes.
+ * Caches paths for auto-loaded and service-located classes when in production.
*/
Dispatcher::applyFilter('run', function($self, $params, $chain) {
if (!Environment::get('production')) {

0 comments on commit ca22f77

Please sign in to comment.