From 1ff5f8454585722fe7022291498237c66bea7068 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 18 Jun 2011 19:49:29 -0500 Subject: [PATCH] added apc driver notes in cache configuration file. --- application/config/cache.php | 28 ++++++++++++++-------------- system/cache/driver/apc.php | 9 --------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/application/config/cache.php b/application/config/cache.php index 1364446a..65ac2602 100644 --- a/application/config/cache.php +++ b/application/config/cache.php @@ -12,12 +12,24 @@ | Caching can be used to increase the performance of your application | by storing commonly accessed data in memory or in a file. | - | Supported Drivers: 'file', 'memcached'. + | Supported Drivers: 'file', 'memcached', 'apc'. | */ 'driver' => 'file', + /* + |-------------------------------------------------------------------------- + | Cache Key + |-------------------------------------------------------------------------- + | + | This key will be prepended to items stored using Memcached and APC to + | prevent collisions with other applications on the server. + | + */ + + 'key' => 'laravel', + /* |-------------------------------------------------------------------------- | Memcached Servers @@ -35,18 +47,6 @@ 'servers' => array( array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), - ), - - /* - |-------------------------------------------------------------------------- - | Memcached Key - |-------------------------------------------------------------------------- - | - | This key will be prepended to items stored using Memcached to avoid - | collisions with other applications on the server. - | - */ - - 'key' => 'laravel', + ), ); \ No newline at end of file diff --git a/system/cache/driver/apc.php b/system/cache/driver/apc.php index 54ba9304..195aa0ad 100644 --- a/system/cache/driver/apc.php +++ b/system/cache/driver/apc.php @@ -29,22 +29,13 @@ public function has($key) */ public function get($key, $default = null) { - // -------------------------------------------------- - // If the item has already been loaded, return it. - // -------------------------------------------------- if (array_key_exists($key, $this->items)) { return $this->items[$key]; } - // -------------------------------------------------- - // Attempt to the get the item from cache. - // -------------------------------------------------- $cache = apc_fetch(\System\Config::get('cache.key').$key); - // -------------------------------------------------- - // Verify that the item was retrieved. - // -------------------------------------------------- if ($cache === false) { return $default;