mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 12:14:12 +02:00
- optimize compile check handling
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user