summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoshe weitzman2008-03-23 19:09:49 (GMT)
committermoshe weitzman2008-03-23 19:09:49 (GMT)
commitf327a6ebfc25d7f180c2a32aa94fe4bd0ac7001d (patch)
treecd1590cc42f66c5d47ab271bd7ae19c2f54cef23
parente992eae6aaf33c0e192209e1c144fc009480fdaf (diff)
#126098 by RingoDS. Allowe Optimizer >= 3.2.8.5.x-0.3
-rw-r--r--devel.module41
1 files changed, 38 insertions, 3 deletions
diff --git a/devel.module b/devel.module
index 6b37448..b52e569 100644
--- a/devel.module
+++ b/devel.module
@@ -616,18 +616,53 @@ function devel_db_query($query) {
return mysql_query($query, $active_db);
}
+// See http://drupal.org/node/126098
+function devel_is_compatible_optimizer() {
+ ob_start();
+ phpinfo();
+ $info = ob_get_contents();
+ ob_end_clean();
+
+ // Match the Zend Optimezer version in the phpinfo information
+ $found = preg_match('/Zend Optimizer v([0-9])\.([0-9])\.([0-9])/', $info, $matches);
+
+ if ($matches) {
+ $major = $matches[1];
+ $minor = $matches[2];
+ $build = $matches[3];
+
+ if ($major >= 3) {
+ if ($minor >= 3) {
+ return TRUE;
+ }
+ elseif ($minor == 2 && $build >= 8) {
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+ }
+ else {
+ return FALSE;
+ }
+ }
+ else {
+ return TRUE;
+ }
+}
+
function devel_admin_settings() {
$form['queries'] = array('#type' => 'fieldset', '#title' => t('Query log'));
$description = t("Collect query info. If disabled, no query log functionality will work.");
- if (extension_loaded('Zend Optimizer')) {
- $description = t('You must disable the php Zend Optimizer extension in order to enable this feature. Zend Optimizer is <a href="!url">horribly buggy and segfaults your Apache</a> ... ', array('!url' => url('http://drupal.org/node/126098'))). $description;
+ if (!devel_is_compatible_optimizer()) {
+ $description = t('You must disable or upgrade the php Zend Optimizer extension in order to enable this feature. The minimum required version is 3.2.8. Earlier versions of Zend Optimizer are <a href="!url">horribly buggy and segfault your Apache</a> ... ', array('!url' => url('http://drupal.org/node/126098'))). $description;
}
$form['queries']['dev_query'] = array('#type' => 'checkbox',
'#title' => t('Collect query info'),
'#default_value' => variable_get('dev_query', 0),
'#description' =>$description,
- '#disabled' => extension_loaded('Zend Optimizer') ? TRUE : FALSE,
+ '#disabled' => !devel_is_compatible_optimizer() ? TRUE : FALSE,
);
$form['queries']['devel_query_display'] = array('#type' => 'checkbox',