summaryrefslogtreecommitdiffstats
path: root/sites
diff options
context:
space:
mode:
authorNathaniel Catchpole2015-04-16 13:46:51 (GMT)
committerNathaniel Catchpole2015-04-16 13:46:51 (GMT)
commite3573a2a241677a9e10c85d000d705b6154a5684 (patch)
tree78d26d713991efbb02136e270a5fd9bbacc601b8 /sites
parent773945306779a77baeab1863424598db058ee0c5 (diff)
Issue #2296009 by fgm, Fabianx, AjitS: Use APC Classloader by default (when available)
Diffstat (limited to 'sites')
-rw-r--r--sites/default/default.settings.php29
1 files changed, 20 insertions, 9 deletions
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index d4bb0de..3783d0a 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -383,18 +383,29 @@ $settings['update_free_access'] = FALSE;
/**
* Class Loader.
*
- * By default, Composer's ClassLoader is used, which is best for development, as
- * it does not break when code is moved in the file system. You can decorate the
- * class loader with a cached solution for better performance, which is
- * recommended for production sites.
- *
- * To do so, you may decorate and replace the local $class_loader variable.
- *
- * For example, to use Symfony's APC class loader, uncomment the code below.
+ * If the APC extension is detected, the Symfony APC class loader is used for
+ * performance reasons. Detection can be prevented by setting
+ * class_loader_auto_detect to false, as in the example below.
+ */
+# $settings['class_loader_auto_detect'] = FALSE;
+
+/*
+ * If the APC extension is not detected, either because APC is missing or
+ * because auto-detection has been disabled, auto-loading falls back to
+ * Composer's ClassLoader, which is good for development as it does not break
+ * when code is moved in the file system. You can also decorate the base class
+ * loader with another cached solution than the Symfony APC class loader, as
+ * all production sites should have a cached class loader of some sort enabled.
+ *
+ * To do so, you may decorate and replace the local $class_loader variable. For
+ * example, to use Symfony's APC class loader without automatic detection,
+ * uncomment the code below.
*/
/*
if ($settings['hash_salt']) {
- $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader('drupal.' . $settings['hash_salt'], $class_loader);
+ $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']);
+ $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader);
+ unset($prefix);
$class_loader->unregister();
$apc_loader->register();
$class_loader = $apc_loader;