You are here

function devel_is_compatible_optimizer in Devel 7

Same name and namespace in other branches
  1. 5 devel.module \devel_is_compatible_optimizer()
  2. 6 devel.module \devel_is_compatible_optimizer()

Returns whether the optimizer is compatible.

Return value

boolean TRUE if compatible, FALSE otherwise.

1 call to devel_is_compatible_optimizer()
devel_admin_settings in ./devel.admin.inc
Form constructor for the settings form.

File

./devel.module, line 1380
This module holds functions useful for Drupal development.

Code

function devel_is_compatible_optimizer() {

  // See http://drupal.org/node/126098.
  ob_start();
  phpinfo();
  $info = ob_get_contents();
  ob_end_clean();

  // Match the Zend Optimizer 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;
  }
}