Skip to content

Commit

Permalink
Added default prefix to cache configurations.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Jan 22, 2012
1 parent 9d0a67d commit 64d4387
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/Config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,16 @@
$duration = '+10 seconds';
}

// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
$prefix = 'myapp_';

/**
* Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => 'cake_core_',
'prefix' => $prefix . 'cake_core_',
'path' => CACHE . 'persistent' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
Expand All @@ -326,7 +329,7 @@
*/
Cache::config('_cake_model_', array(
'engine' => $engine,
'prefix' => 'cake_model_',
'prefix' => $prefix . 'cake_model_',
'path' => CACHE . 'models' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
Expand Down
7 changes: 5 additions & 2 deletions lib/Cake/Console/Templates/skel/Config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,16 @@
$duration = '+10 seconds';
}

// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
$prefix = 'myapp_';

/**
* Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => 'cake_core_',
'prefix' => $prefix . 'cake_core_',
'path' => CACHE . 'persistent' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
Expand All @@ -326,7 +329,7 @@
*/
Cache::config('_cake_model_', array(
'engine' => $engine,
'prefix' => 'cake_model_',
'prefix' => $prefix . 'cake_model_',
'path' => CACHE . 'models' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
Expand Down

0 comments on commit 64d4387

Please sign in to comment.