summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--application/config/config.php6
-rw-r--r--modules/gallery/helpers/gallery_event.php1
-rw-r--r--system/core/Kohana.php47
3 files changed, 17 insertions, 37 deletions
diff --git a/application/config/config.php b/application/config/config.php
index 1c5bccb7..aecc400c 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -67,12 +67,6 @@ $config["url_suffix"] = "";
* can give significant speed improvements at the expense of delayed updating.
*/
$config["internal_cache"] = FALSE;
-/**
- * Enable or disable writing to the internal cache. Used by Gallery to treat
- * the cache as read-only until all active modules and themes are in the
- * include path.
- */
-$config["internal_cache_read_only"] = TRUE;
$config["internal_cache_path"] = VARPATH . "tmp/";
/**
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index a6783bc6..36f91142 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -25,7 +25,6 @@ class gallery_event_Core {
static function gallery_ready() {
identity::load_user();
theme::load_themes();
- Kohana_Config::instance()->set('core.internal_cache_read_only', false);
locales::set_request_locale();
}
diff --git a/system/core/Kohana.php b/system/core/Kohana.php
index 1ed6d725..ae056d0e 100644
--- a/system/core/Kohana.php
+++ b/system/core/Kohana.php
@@ -365,17 +365,13 @@ abstract class Kohana_Core {
// Add SYSPATH as the last path
Kohana::$include_paths[] = SYSPATH;
- if ( ! Kohana::config('core.internal_cache_read_only'))
+ // Clear cached include paths
+ self::$internal_cache['find_file_paths'] = array();
+ if ( ! isset(self::$write_cache['find_file_paths']))
{
- // Clear cached include paths
- self::$internal_cache['find_file_paths'] = array();
-
- if ( ! isset(self::$write_cache['find_file_paths']))
- {
- // Write cache at shutdown
- self::$write_cache['find_file_paths'] = TRUE;
- }
- }
+ // Write cache at shutdown
+ self::$write_cache['find_file_paths'] = TRUE;
+ }
}
@@ -822,17 +818,13 @@ abstract class Kohana_Core {
}
}
- if ( ! Kohana::config('core.internal_cache_read_only'))
+ if ( ! isset(Kohana::$write_cache['find_file_paths']))
{
- Kohana::$internal_cache['find_file_paths'][$search] = $found;
-
- if ( ! isset(Kohana::$write_cache['find_file_paths']))
- {
- // Write cache at shutdown
- Kohana::$write_cache['find_file_paths'] = TRUE;
- }
+ // Write cache at shutdown
+ Kohana::$write_cache['find_file_paths'] = TRUE;
}
- return $found;
+
+ return Kohana::$internal_cache['find_file_paths'][$search] = $found;
}
/**
@@ -908,7 +900,8 @@ abstract class Kohana_Core {
public static function message($key, $args = array())
{
// Extract the main group from the key
- list ($group, $subkey) = explode('.', $key, 2);
+ $group = explode('.', $key, 2);
+ $group = $group[0];
if ( ! isset(Kohana::$internal_cache['messages'][$group]))
{
@@ -920,23 +913,17 @@ abstract class Kohana_Core {
include $file[0];
}
- if ( ! isset(Kohana::$write_cache['messages']) && ! Kohana::config('core.internal_cache_read_only'))
+ if ( ! isset(Kohana::$write_cache['messages']))
{
// Write language cache
Kohana::$write_cache['messages'] = TRUE;
}
- if ( ! Kohana::config('core.internal_cache_read_only'))
- {
- Kohana::$internal_cache['messages'][$group] = $messages;
- }
- }
- else
- {
- $messages = Kohana::$internal_cache['messages'][$group];
+
+ Kohana::$internal_cache['messages'][$group] = $messages;
}
// Get the line from cache
- $line = Kohana::key_string($messages, $subkey);
+ $line = Kohana::key_string(Kohana::$internal_cache['messages'], $key);
if ($line === NULL)
{