- optimize compile check handling

This commit is contained in:
Uwe Tews
2015-07-01 03:27:06 +02:00
parent 86783c857d
commit a9f0b8ad1f
9 changed files with 68 additions and 33 deletions
+26 -9
View File
@@ -76,6 +76,19 @@ class Smarty_Template_Source
* @var string
*/
public $filepath = null;
/**
* Source Timestamp
*
* @var integer
*/
public $timestamp = null;
/**
* Source Existence
*
* @var boolean
*/
public $exists = false;
/**
* Source File Base name
*
@@ -233,6 +246,18 @@ class Smarty_Template_Source
}
}
/**
* Get source time stamp
*
* @return int
*/
public function getTimeStamp() {
if (!isset($this->timestamp)) {
$this->handler->populateTimestamp($this);
}
return $this->timestamp;
}
/**
* <<magic>> Generic Setter.
*
@@ -245,9 +270,7 @@ class Smarty_Template_Source
{
switch ($property_name) {
// regular attributes
case 'timestamp':
case 'exists':
case 'content':
case 'content':
// required for extends: only
case 'template':
$this->$property_name = $value;
@@ -269,12 +292,6 @@ class Smarty_Template_Source
public function __get($property_name)
{
switch ($property_name) {
case 'timestamp':
case 'exists':
$this->handler->populateTimestamp($this);
return $this->$property_name;
case 'content':
return $this->content = $this->handler->getContent($this);