1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00

Bump to 3.0.97 and update to add a Pagefile::HTTPURL to accompany the existing Pagefile::URL property (uppercase implies cache busting URLs).

This commit is contained in:
Ryan Cramer
2018-03-30 10:48:40 -04:00
parent 2722345aac
commit c5c7ae4232
2 changed files with 14 additions and 7 deletions

View File

@@ -12,11 +12,13 @@
* Pagefile objects are contained by a `Pagefiles` object.
* #pw-body
*
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
* ProcessWire 3.x, Copyright 2018 by Ryan Cramer
* https://processwire.com
*
* @property-read string $url URL to the file on the server.
* @property-read string $URL Same as $url property but with browser cache busting query string appended that represents the file's modification time. #pw-group-other
* @property-read string $url URL to the file on the server.
* @property-read string $httpUrl URL to the file on the server including scheme and hostname.
* @property-read string $URL Same as $url property but with browser cache busting query string appended. #pw-group-other
* @property-read string $HTTPURL Same as the cache-busting uppercase “URL” property, but includes scheme and hostname. #pw-group-other
* @property-read string $filename full disk path to the file on the server.
* @property-read string $name Returns the filename without the path, same as the "basename" property.
* @property-read string $hash Get a unique hash (for the page) representing this Pagefile.
@@ -37,7 +39,8 @@
*
* @method void install($filename)
* @method string httpUrl()
*
* @method string noCacheURL($http = false)
*
*/
class Pagefile extends WireData {
@@ -499,6 +502,9 @@ class Pagefile extends WireData {
// nocache url
$value = $this->noCacheURL();
break;
case 'HTTPURL':
$value = $this->noCacheURL(true);
break;
case 'pagefiles':
$value = $this->pagefiles;
break;
@@ -533,11 +539,12 @@ class Pagefile extends WireData {
*
* #pw-internal
*
* @param bool $http Include scheme and hostname?
* @return string
*
*/
protected function ___noCacheURL() {
return $this->url() . '?nc=' . @filemtime($this->filename());
public function ___noCacheURL($http = false) {
return ($http ? $this->httpUrl() : $this->url()) . '?nc=' . @filemtime($this->filename());
}
/**

View File

@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
* Reversion revision number
*
*/
const versionRevision = 96;
const versionRevision = 97;
/**
* Version suffix string (when applicable)