You are here

function acquia_spi_check_files_present in Acquia Connector 7.2

Same name and namespace in other branches
  1. 6.2 acquia_spi/acquia_spi.module \acquia_spi_check_files_present()
  2. 7.3 acquia_spi/acquia_spi.module \acquia_spi_check_files_present()

Check to see if the unneeded release files with Drupal are removed

Parameters

n/a:

Return value

True if they are removed, false if they aren't

1 call to acquia_spi_check_files_present()
acquia_spi_get in acquia_spi/acquia_spi.module
Gather site profile information about this site.

File

acquia_spi/acquia_spi.module, line 1049
Send site profile information (NSPI) and system data to Acquia Insight.

Code

function acquia_spi_check_files_present() {
  $store = acquia_spi_data_store_get(array(
    'platform',
  ));
  $server = !empty($store) && isset($store['platform']) ? $store['platform']['php_quantum']['SERVER'] : $_SERVER;
  $files_exist = FALSE;
  $url = url(NULL, array(
    'absolute' => TRUE,
  ));
  $files_to_remove = array(
    'CHANGELOG.txt',
    'COPYRIGHT.txt',
    'INSTALL.mysql.txt',
    'INSTALL.pgsql.txt',
    'INSTALL.txt',
    'LICENSE.txt',
    'MAINTAINERS.txt',
    'README.txt',
    'UPGRADE.txt',
    'PRESSFLOW.txt',
    'install.php',
  );
  foreach ($files_to_remove as $file) {
    $path = $server['DOCUMENT_ROOT'] . base_path() . $file;
    if (file_exists($path)) {
      $files_exist = TRUE;
    }
  }
  return $files_exist ? 1 : 0;
}