You are here

function imageapi_optimize_update_7000 in Image Optimize (or ImageAPI Optimize) 7

Same name and namespace in other branches
  1. 7.2 imageapi_optimize.install \imageapi_optimize_update_7000()

Upgrade variables.

File

./imageapi_optimize.install, line 21
Install, update and uninstall functions.

Code

function imageapi_optimize_update_7000() {
  $variable_names = array(
    'imageapi_optimize_advpng',
    'imageapi_optimize_optipng',
    'imageapi_optimize_jpegtran',
    'imageapi_optimize_jfifremove',
    'imageapi_optimize_pngcrush',
  );
  foreach ($variable_names as $variable_name) {
    $value = variable_get($variable_name, '');
    variable_del($variable_name);
    if (!empty($value)) {
      variable_set($variable_name, array(
        'status' => TRUE,
        'path' => $value,
      ));
    }
  }
  drupal_flush_all_caches();
}