You are here

function _imageapi_imagemagick_check_path in ImageAPI 6

Same name and namespace in other branches
  1. 5 imageapi_imagemagick.module \_imageapi_imagemagick_check_path()
3 calls to _imageapi_imagemagick_check_path()
imageapi_imagemagick_validate_path in ./imageapi_imagemagick.module
_imageapi_imagemagick_build_version in ./imageapi_imagemagick.module
_imageapi_imagemagick_convert_exec in ./imageapi_imagemagick.module

File

./imageapi_imagemagick.module, line 160
ImageMagick toolkit functions

Code

function _imageapi_imagemagick_check_path($path) {
  $errors = array();
  if (!is_file($path)) {
    $errors[] = t('The specified ImageMagick path %file does not exist.', array(
      '%file' => $path,
    ));
  }
  if (!$errors && !is_executable($path)) {
    $errors[] = t('The specified ImageMagick path %file is not executable.', array(
      '%file' => $path,
    ));
  }
  if ($errors && ($open_basedir = ini_get('open_basedir'))) {
    $errors[] = t('PHP\'s <a href="!open-basedir">open_basedir</a> security restriction is set to %open-basedir, which may be interfering with attempts to locate ImageMagick.', array(
      '%file' => $path,
      '%open-basedir' => $open_basedir,
      '!info-link' => url('http://php.net/features.safe-mode#ini.open-basedir'),
    ));
  }
  return $errors;
}