This is a bit of an obscure use case but if you admin your site in a path based multisite but the public domain is not path based (ie, admins go to example.com/sitea/ while the public goes to sitea.com) then there is currently no way to remove the path from the URLs being constructed for purging. This is a feature request to add a drupal_alter call so that this use case is possible.

CommentFileSizeAuthor
#1 acquia_purge-alter_urls-2312117-1-7.patch444 bytestekante

Comments

tekante’s picture

StatusFileSize
new444 bytes
elijah lynn’s picture

Status: Active » Needs review
elijah lynn’s picture

Could you handle this by the domain override $conf var in your settings.php file?

nielsvm’s picture

Status: Needs review » Closed (fixed)

Chris actually has a point here, his use case won't be supported with the current code as Acquia Purge will always use and respect base_path() when purging things. Setting different domains won't make this any different as it will then be a different domain in the URL, with still the wrong base path appended to it (and prefixed to the path).

So I thought about this and decided that altering $request is too much power to be given away but that a setting could fix this easily:

[7.x-1.x 515c705] 2312117: allow site administrator to differentiate the base_path being purged.
 3 files changed, 13 insertions(+), 2 deletions(-)

This is added to README.txt as of version 7.x-1.0:

setting: acquia_purge_base_path
default: (automatic)

In some cases Drupal isn't served on the same URL as where its edited, which will cause different paths to be purged than necessary. By overriding this setting, Drupal's base_path() will no longer be used to construct purges. Use only when you know what you are doing.
$conf['acquia_purge_base_path'] = '/sub/';

So now you could do in settings.php:

$conf['acquia_purge_base_path'] = '/foo/';
$ drush --uri=http://mysite.com/ ap-purge '/ bar'

# 6 items left...
Purged: http://mysite.com/foo/
Purged: http://mysite.com/foo/index.php
Purged: http://mysite.com/foo/index.php/
Purged: http://mysite.com/foo/bar
Purged: http://mysite.com/foo/bar/
Queue processed successfully!