added apc driver notes in cache configuration file.
This commit is contained in:
@@ -12,12 +12,24 @@ return array(
|
|||||||
| Caching can be used to increase the performance of your application
|
| Caching can be used to increase the performance of your application
|
||||||
| by storing commonly accessed data in memory or in a file.
|
| by storing commonly accessed data in memory or in a file.
|
||||||
|
|
|
|
||||||
| Supported Drivers: 'file', 'memcached'.
|
| Supported Drivers: 'file', 'memcached', 'apc'.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'driver' => 'file',
|
'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
|
| Memcached Servers
|
||||||
@@ -37,16 +49,4 @@ return array(
|
|||||||
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
|
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',
|
|
||||||
|
|
||||||
);
|
);
|
||||||
9
system/cache/driver/apc.php
vendored
9
system/cache/driver/apc.php
vendored
@@ -29,22 +29,13 @@ class APC implements \System\Cache\Driver {
|
|||||||
*/
|
*/
|
||||||
public function get($key, $default = null)
|
public function get($key, $default = null)
|
||||||
{
|
{
|
||||||
// --------------------------------------------------
|
|
||||||
// If the item has already been loaded, return it.
|
|
||||||
// --------------------------------------------------
|
|
||||||
if (array_key_exists($key, $this->items))
|
if (array_key_exists($key, $this->items))
|
||||||
{
|
{
|
||||||
return $this->items[$key];
|
return $this->items[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------
|
|
||||||
// Attempt to the get the item from cache.
|
|
||||||
// --------------------------------------------------
|
|
||||||
$cache = apc_fetch(\System\Config::get('cache.key').$key);
|
$cache = apc_fetch(\System\Config::get('cache.key').$key);
|
||||||
|
|
||||||
// --------------------------------------------------
|
|
||||||
// Verify that the item was retrieved.
|
|
||||||
// --------------------------------------------------
|
|
||||||
if ($cache === false)
|
if ($cache === false)
|
||||||
{
|
{
|
||||||
return $default;
|
return $default;
|
||||||
|
|||||||
Reference in New Issue
Block a user