diff options
Diffstat (limited to 'kohana/core')
| -rw-r--r-- | kohana/core/Bootstrap.php | 4 | ||||
| -rw-r--r-- | kohana/core/Kohana.php | 32 | 
2 files changed, 23 insertions, 13 deletions
| diff --git a/kohana/core/Bootstrap.php b/kohana/core/Bootstrap.php index 0190eb9d..ad7564c8 100644 --- a/kohana/core/Bootstrap.php +++ b/kohana/core/Bootstrap.php @@ -10,8 +10,8 @@   * @license    http://kohanaphp.com/license.html   */ -define('KOHANA_VERSION',  '2.3.2'); -define('KOHANA_CODENAME', 'accipiter'); +define('KOHANA_VERSION',  '2.3.3'); +define('KOHANA_CODENAME', 'aegolius');  // Test of Kohana is running in Windows  define('KOHANA_IS_WIN', DIRECTORY_SEPARATOR === '\\'); diff --git a/kohana/core/Kohana.php b/kohana/core/Kohana.php index 7f9b87da..0ee6f631 100644 --- a/kohana/core/Kohana.php +++ b/kohana/core/Kohana.php @@ -53,6 +53,7 @@ final class Kohana {  	// Internal caches and write status  	private static $internal_cache = array();  	private static $write_cache; +	private static $internal_cache_path;  	/**  	 * Sets up the PHP environment. Adds error/exception handling, output @@ -90,6 +91,12 @@ final class Kohana {  		if (self::$cache_lifetime = self::config('core.internal_cache'))  		{ +			// Set the directory to be used for the internal cache +			if ( ! self::$internal_cache_path = self::config('core.internal_cache_path')) +			{ +				self::$internal_cache_path = APPPATH.'cache/'; +			} +  			// Load cached configuration and language files  			self::$internal_cache['configuration'] = self::cache('configuration', self::$cache_lifetime);  			self::$internal_cache['language']      = self::cache('language', self::$cache_lifetime); @@ -570,7 +577,7 @@ final class Kohana {  	{  		if ($lifetime > 0)  		{ -			$path = APPPATH.'cache/kohana_'.$name; +			$path = self::$internal_cache_path.'kohana_'.$name;  			if (is_file($path))  			{ @@ -606,7 +613,7 @@ final class Kohana {  		if ($lifetime < 1)  			return FALSE; -		$path = APPPATH.'cache/kohana_'.$name; +		$path = self::$internal_cache_path.'kohana_'.$name;  		if ($data === NULL)  		{ @@ -1139,18 +1146,21 @@ final class Kohana {  			{  				$items = (array) glob($path.'*'); -				foreach ($items as $index => $item) +				if ( ! empty($items))  				{ -					$files[] = $item = str_replace('\\', '/', $item); - -					// Handle recursion -					if (is_dir($item) AND $recursive == TRUE) +					foreach ($items as $index => $item)  					{ -						// Filename should only be the basename -						$item = pathinfo($item, PATHINFO_BASENAME); +						$files[] = $item = str_replace('\\', '/', $item); -						// Append sub-directory search -						$files = array_merge($files, self::list_files($directory, TRUE, $path.$item)); +						// Handle recursion +						if (is_dir($item) AND $recursive == TRUE) +						{ +							// Filename should only be the basename +							$item = pathinfo($item, PATHINFO_BASENAME); + +							// Append sub-directory search +							$files = array_merge($files, self::list_files($directory, TRUE, $path.$item)); +						}  					}  				}  			} | 
