You are here

function drush_acsf_init_test_htaccess_is_patched in Acquia Cloud Site Factory Connector 8

Determines whether htaccess allows access to our apc_rebuild.php script.

2 calls to drush_acsf_init_test_htaccess_is_patched()
drush_acsf_init_patch_htaccess in acsf_init/acsf_init.drush.inc
Patches the htaccess file to allow access to our apc_rebuild.php script.
drush_acsf_init_verify in acsf_init/acsf_init.drush.inc
Command callback: Verify that acsf-init was run against the current version.

File

acsf_init/acsf_init.drush.inc, line 828
Provides drush commands to set up a site for Acquia Site Factory.

Code

function drush_acsf_init_test_htaccess_is_patched() {
  if (!file_exists(drush_acsf_init_get_htaccess_path()) || !($content = file_get_contents(drush_acsf_init_get_htaccess_path()))) {

    // If the htaccess file does not exist or is empty, then it cannot forbid
    // access to apc_rebuild.php, so we can consider this a pass, albeit a weird
    // one.
    return TRUE;
  }

  // If a customer was for some reason really sure that they did not want
  // our line in their .htaccess file, then adding it verbatim, but
  // commented-out would suffice.
  return strpos($content, ACSF_HTACCESS_PATCH) !== FALSE;
}