You are here

function advagg_htaccess_rewritebase in Advanced CSS/JS Aggregation 7.2

See if the .htaccess file uses the RewriteBase directive.

Parameters

string $location: The location of the .htaccess file.

Return value

string The last active RewriteBase entry in htaccess.

2 calls to advagg_htaccess_rewritebase()
advagg_admin_settings_form in ./advagg.admin.inc
Form builder; Configure advagg settings.
advagg_install_chk_urls in ./advagg.install
Make sure http requests to css/js files work correctly.
4 string references to 'advagg_htaccess_rewritebase'
advagg_admin_settings_form in ./advagg.admin.inc
Form builder; Configure advagg settings.
advagg_admin_settings_form_submit in ./advagg.admin.inc
Clear out the advagg cache bin when the save configuration button is pressed.
advagg_htaccess_check_generate in ./advagg.missing.inc
Generate .htaccess rules and place them in advagg dir.
advagg_install_chk_urls in ./advagg.install
Make sure http requests to css/js files work correctly.

File

./advagg.module, line 5590
Advanced CSS/JS aggregation module.

Code

function advagg_htaccess_rewritebase($location = DRUPAL_ROOT) {
  if (is_readable($location . '/.htaccess')) {
    $htaccess = advagg_file_get_contents($location . '/.htaccess');
    $matches = array();
    $found = preg_match_all('/\\n\\s*RewriteBase\\s.*/i', $htaccess, $matches);
    if ($found && !empty($matches[0])) {
      $matches[0] = array_map('trim', $matches[0]);
      return array_pop($matches[0]);
    }
  }
  return '';
}