SimpleCachePublisher::urlsToPaths
Transforms relative or absolute URLs to their static path equivalent.
This needs to be the same logic that's used to look up these paths through framework/static-main.php. Does not include the prefix. URL filtering will have already taken place for direct SiteTree links via SiteTree->generateURLSegment()). For all other links (e.g. custom controller actions), we assume that they're pre-sanitized to suit the filesystem needs, as its impossible to sanitize them without risking to break the underlying naming assumptions in URL routing (e.g. controller method names). Examples (without $domain_based_caching): - http://mysite.com/mywebroot/ => /index.html (assuming your webroot is in a subfolder) - http://mysite.com/about-us => /about-us.html - http://mysite.com/parent/child => /parent/child.html Examples (with $domain_based_caching): - http://mysite.com/mywebroot/ => /mysite.com/index.html (assuming your webroot is in a subfolder) - http://mysite.com/about-us => /mysite.com/about-us.html - http://myothersite.com/about-us => /myothersite.com/about-us.html - http://subdomain.mysite.com/parent/child => /subdomain.mysite.com/parent/child.html
Signature
public function urlsToPaths(Array
$urls )
Parameters
$urls
— object- Absolute or relative URLs
Returns
- Array
- Map of original URLs to filesystem paths (relative to {@link $destFolder}).