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

Conversation

tharna
Copy link
Member

@tharna tharna commented Oct 11, 2018

…xists. Resolves #304

@tharna tharna requested a review from mitrpaka October 11, 2018 08:27
@tharna tharna force-pushed the feature/304-memcacheEnabled branch from 6af5e62 to 56efa64 Compare October 11, 2018 11:18
@@ -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.

@tharna
Copy link
Member Author

tharna commented Oct 11, 2018

Apparently this solution doesn't work on all cases either :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants