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

Issue #2979423: Drush commands fail with "Error: Call to undefined function module_exists()"

parent b1e2347a
No related branches found
No related tags found
1 merge request!24Issue #2979423: Drush commands fail with "Error: Call to undefined function module_exists()"
Pipeline #231451 passed
......@@ -11,18 +11,26 @@
function apc_drush_exit() {
global $base_url;
if (!module_exists('apc')) {
drush_log(
dt('You need to enable the Alternative PHP Cache module for remote cache clearing to work. Run drush pm-enable apc.'),
'error'
);
return;
}
if (class_exists('DrupalApcCache')) {
$requests = DrupalApcCache::pendingRequests();
if (!empty($requests)) {
if (!empty($requests) && is_array($requests)) {
if (!function_exists('module_exists')) {
// Drupal bootstrap did not reach the DRUPAL_BOOTSTRAP_VARIABLES phase,
// or module_exists() would be defined. This means it is not possible to
// check if the Alternative PHP Cache module is available.
// Exit silently.
return;
}
if (!module_exists('apc')) {
drush_log(
dt('You need to enable the Alternative PHP Cache module to clear the cache on the server.'),
'error'
);
return;
}
$star = serialize('*');
foreach (array_keys($requests) as $key) {
......@@ -54,7 +62,7 @@ function apc_drush_exit() {
if ($base_url == 'http://' . basename(conf_path())) {
drush_log(
dt('$base_url might not be set correctly. Try using the -l/--uri option for Drush.'),
dt('$base_url might not be set correctly.'),
'warning'
);
}
......
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