Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Check if module is enabled from core.extension.yml instead of class_e… #305

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drupal/web/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
*/
if (!drupal_installation_attempted() && extension_loaded('memcached') && class_exists('Memcached')) {
// Define memcache settings only if memcache module enabled.
if (class_exists(MemcacheBackendFactory::class)) {
if (strpos(file_get_contents(getcwd().'/../sync/core.extension.yml'), 'memcache: 0') !== FALSE) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a bit too specific.
it might be "memcache: 1001" as well.
try preg_match(), which is slightly more expensive.

$settings['memcache']['extension'] = 'Memcached';
$settings['memcache']['bins'] = ['default' => 'default'];
$settings['memcache']['key_prefix'] = '';
Expand Down