Add Pico::VERSION constant

This commit is contained in:
Daniel Rudolf 2016-03-06 00:38:51 +01:00
parent 43705d0f76
commit 479926eeb4
2 changed files with 13 additions and 2 deletions

View File

@ -5,8 +5,8 @@ Description: Pico is a stupidly simple, blazing fast, flat file CMS.
## Welcome to Pico
Congratulations, you have successfully installed [Pico](http://picocms.org/).
%meta.description% <!-- replaced by the above Description meta header -->
Congratulations, you have successfully installed [Pico](http://picocms.org/)
%version%. %meta.description% <!-- replaced by the above Description header -->
## Creating Content

View File

@ -26,6 +26,13 @@
*/
class Pico
{
/**
* Pico version
*
* @var string
*/
const VERSION = '1.1.0-dev';
/**
* Sort files in alphabetical ascending order
*
@ -907,6 +914,9 @@ class Pico
. "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s";
$content = preg_replace($metaHeaderPattern, '', $rawContent, 1);
// replace %version%
$content = str_replace('%version%', static::VERSION, $content);
// replace %site_title%
$content = str_replace('%site_title%', $this->getConfig('site_title'), $content);
@ -1267,6 +1277,7 @@ class Pico
'current_page' => $this->currentPage,
'next_page' => $this->nextPage,
'is_front_page' => ($this->requestFile === $frontPage),
'version' => static::VERSION
);
}