Skip to content
Snippets Groups Projects
Verified Commit 7ecadded authored by Alberto Paderno's avatar Alberto Paderno
Browse files

Issue #3469898: Change the name of the implemented classes and move the files...

Issue #3469898: Change the name of the implemented classes and move the files containing classes in includes/classes
parent ed724c42
No related branches found
No related tags found
1 merge request!78Issue #3469898: Change the name of the implemented classes and move the files containing classes in includes/classes
Pipeline #269614 passed
......@@ -34,19 +34,19 @@ Most of the configuration values are stored in the settings.php file.
### Cache backend
At least the following line must be added in the settings.php file to use this
module as cache backend. (Replace `'sites/all/modules/apc'` with the path for
the module, in the case the module is installed in a different directory.)
module as cache backend. (Replace *sites/all/modules/apc* with the path for the
module, in the case the module is installed in a different directory.)
```php
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/apc/includes/classes/apc_cache.inc';
```
Then lines like the following ones must be added for each cache bin to store on
APCu.
```php
$conf['cache_class_cache'] = 'DrupalApcCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalApcCache';
$conf['cache_class_cache'] = 'ApcCache';
$conf['cache_class_cache_bootstrap'] = 'ApcCache';
```
What follows `cache_class_` is the name of the cache bin. (In the given example,
......@@ -60,10 +60,10 @@ cache, instead of setting each single cache bin, you can use the following line,
which sets APCu as default backend for all the cache bins.
```php
$conf['cache_default_class'] = 'DrupalApcCache';
$conf['cache_default_class'] = 'ApcCache';
```
When `DrupalAPCCache` is used for the *cache_page* bin, the following lines can
When `ApcCache` is used for the *cache_page* bin, the following lines can
be added to the settings.php file used for the site.
```php
......@@ -72,14 +72,10 @@ $conf['page_cache_invoke_hooks'] = FALSE;
```
In case of multi-site installations, you can use one of the following lines in
the settings.php file for each site to avoid that values cached for a site are
returned for all the sites.
the settings.php file used by each site to avoid that values cached for a site
are returned for all the sites.
```php
// release 7.x-1.0
$conf['cache_prefix'] = drupal_random_bytes(8);
// release 7.x-2.0
$conf['apc_cache_prefix'] = drupal_random_bytes(8);
```
......@@ -106,11 +102,11 @@ conflicts in case of multi-site installations, but setting
To use the lock backend implemented by the Alternative PHP Cache module, the
following lines need to be added in the settings.php file. (Replace
`'sites/all/modules/apc'` with the path for the module, in the case the module
is installed in a different directory.)
*sites/all/modules/apc* with the path for the module, in the case the module is
installed in a different directory.)
```php
$conf['lock_inc'] = 'sites/all/modules/apc/drupal_apc_lock.inc';
$conf['lock_inc'] = 'sites/all/modules/apc/includes/classes/apc_lock.inc';
```
Differently from cache backends, only a single lock backend can be used at time.
......
......@@ -3,5 +3,5 @@ description = Integrates the APCu extension with Drupal.
package = Performance and scalability
core = 7.x
files[] = apc.test
files[] = drupal_apc_cache.inc
files[] = drupal_apc_lock.inc
files[] = includes/classes/apc_cache.inc
files[] = includes/classes/apc_lock.inc
......@@ -136,7 +136,7 @@ function apc_update_7200() {
}
/**
* Update the registry to include the new lock backend class.
* Update the registry to include the renamed classes.
*/
function apc_update_7201() {
registry_rebuild();
......
......@@ -24,7 +24,7 @@ function apc_permission() {
*/
function apc_page_alter(&$page) {
if (variable_get('apc_show_debug', FALSE) && user_access('access apc statistics')) {
$operations = DrupalApcCache::operations();
$operations = ApcCache::operations();
$rows = array();
if (!empty($operations) && is_array($operations)) {
......
......@@ -510,7 +510,7 @@ trait ApcCacheTestTrait {
$args = array('@bin' => $this->varExport($bin));
$message = format_string('Data for the @bin cache bin is stored on APCu.', $args);
if (!$this->assertTrue($backend instanceof DrupalApcCache, $message)) {
if (!$this->assertTrue($backend instanceof ApcCache, $message)) {
$result = FALSE;
}
}
......@@ -703,10 +703,10 @@ class ApcCacheBaseTestCase extends DrupalUnitTestCase {
parent::setUp();
$conf['cache_backends'][] = drupal_get_path('module', 'apc') . '/drupal_apc_cache.inc';
$conf['cache_backends'][] = drupal_get_path('module', 'apc') . '/includes/classes/apc_cache.inc';
foreach ($this->getCacheBins() as $cache_bin) {
$conf["cache_class_$cache_bin"] = 'DrupalApcCache';
$conf["cache_class_$cache_bin"] = 'ApcCache';
}
// The DrupalFakeCache class is a cache backend stub implementation used by
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains DrupalApcCache.
* Contains ApcCache.
*/
// phpcs:disable SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed
......@@ -13,7 +13,7 @@
* This is a Drupal cache implementation which uses the APCu extension to store
* cached data.
*/
class DrupalApcCache implements DrupalCacheInterface {
class ApcCache implements DrupalCacheInterface {
/**
* The list of all the operations done to the cache.
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment