You are here

function _acquia_migrate_check_env in Acquia Connector 6.2

Same name and namespace in other branches
  1. 7.2 acquia_agent/acquia_agent.migrate.inc \_acquia_migrate_check_env()

Check server for migration capabilities.

Return value

Array of environment capabilities or 'error' is set.

3 calls to _acquia_migrate_check_env()
acquia_agent_migrate_check in acquia_agent/acquia_agent.migrate.inc
Menu callback for checking client upload.
acquia_migrate_prepare in acquia_agent/acquia_agent.migrate.inc
Setup archive directory and internal migrate data struct.
_acquia_migrate_process_setup in acquia_agent/acquia_agent.migrate.inc
Ensure this response can work through migration.

File

acquia_agent/acquia_agent.migrate.inc, line 26
Upload to Acquia Cloud.

Code

function _acquia_migrate_check_env() {
  $env = array(
    'error' => FALSE,
  );
  if (!class_exists('Archive_Tar')) {
    module_load_include('inc', 'acquia_agent', 'archive_tar');
  }
  if (!function_exists('json_decode')) {
    $env['error'] = t('Requires PHP 5.2');
    return $env;
  }

  // Check available compression libs.
  if (function_exists('gzopen')) {
    $env['compression_ext'] = 'gz';
  }
  elseif (function_exists('bzopen')) {
    $env['compression_ext'] = 'bz2';
  }
  elseif (class_exists('ZipArchive')) {
    $env['compression_ext'] = 'zip';
  }
  else {
    $env['error'] = t('No compression libraries available');
  }
  return $env;
}