You are here

function devel_is_compatible_optimizer in Devel 5

Same name and namespace in other branches
  1. 6 devel.module \devel_is_compatible_optimizer()
  2. 7 devel.module \devel_is_compatible_optimizer()
1 call to devel_is_compatible_optimizer()
devel_admin_settings in ./devel.module

File

./devel.module, line 679

Code

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;
  }
}