You are here

function drush_expire_path in Cache Expiration 7

Same name and namespace in other branches
  1. 6 expire.drush.inc \drush_expire_path()

Callback for expire-path drush command.

Parameters

string $urls a space separated list of paths.:

1 string reference to 'drush_expire_path'
expire_drush_command in ./expire.drush.inc
Implementation of hook_drush_command().

File

./expire.drush.inc, line 79
This is the drush integration for the expire module

Code

function drush_expire_path() {
  global $base_path;
  $internal = array();
  $paths = array();
  $paths = drush_get_arguments();
  unset($paths[0]);
  foreach ($paths as $path) {

    // Strip base path from path.
    $path_nobase = preg_replace('/^' . preg_quote($base_path, '/') . '/i', '', $path);
    if ($path == 'FRONT') {
      $internal[] = variable_get('site_frontpage', 'node');
    }
    else {
      $normal = expire_normal_path_check($path_nobase);
      if (is_array($normal)) {
        $internal[] = $path;
      }
      else {
        $normal = drupal_get_normal_path($path_nobase);
        $internal[] = $normal;
      }
    }
  }
  $flushed = expire_cache_derivative($internal);
}