This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d9151c
commit cefc716
Showing
2 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
* @author David Sanchez <[email protected]> | ||
* @copyright 2008-2013 Jordi Boggiano | ||
* @copyright 2013-2017 David Sanchez | ||
* @license http://dwoo.org/LICENSE Modified BSD License | ||
* @license http://dwoo.org/LICENSE LGPLv3 | ||
* @version 1.4.0 | ||
* @date 2017-03-09 | ||
* @date 2017-03-16 | ||
* @link http://dwoo.org/ | ||
*/ | ||
|
||
|
@@ -42,7 +42,7 @@ class File extends Str | |
* | ||
* @var array | ||
*/ | ||
protected $includePath = []; | ||
protected $includePath = array(); | ||
|
||
/** | ||
* Resolved path cache when looking for a file in multiple include paths. | ||
|
@@ -66,7 +66,7 @@ class File extends Str | |
* template from others, if null it defaults to the filename+bits of the path | ||
* @param mixed $includePath a string for a single path to look into for the given file, or an array of paths | ||
*/ | ||
public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = []) | ||
public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = array()) | ||
{ | ||
parent::__construct($file, $cacheTime, $cacheId, $compileId); | ||
$this->template = null; | ||
|
@@ -84,7 +84,7 @@ public function __construct($file, $cacheTime = null, $cacheId = null, $compileI | |
public function setIncludePath($paths) | ||
{ | ||
if (is_array($paths) === false) { | ||
$paths = [$paths]; | ||
$paths = array($paths); | ||
} | ||
|
||
$this->includePath = $paths; | ||
|
@@ -144,7 +144,7 @@ public function getResourceIdentifier() | |
{ | ||
if ($this->resolvedPath !== null) { | ||
return $this->resolvedPath; | ||
} elseif (array_filter($this->getIncludePath()) == []) { | ||
} elseif (array_filter($this->getIncludePath()) == array()) { | ||
return $this->file; | ||
} else { | ||
foreach ($this->getIncludePath() as $path) { | ||
|
@@ -202,13 +202,13 @@ public static function templateFactory(Core $core, $resourceId, $cacheTime = nul | |
$compileId = null, ITemplate $parentTemplate = null) | ||
{ | ||
if (DIRECTORY_SEPARATOR === '\\') { | ||
$resourceId = str_replace(["\t", "\n", "\r", "\f", "\v"], [ | ||
$resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array( | ||
'\\t', | ||
'\\n', | ||
'\\r', | ||
'\\f', | ||
'\\v' | ||
], $resourceId); | ||
), $resourceId); | ||
} | ||
$resourceId = strtr($resourceId, '\\', '/'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
* @author David Sanchez <[email protected]> | ||
* @copyright 2008-2013 Jordi Boggiano | ||
* @copyright 2013-2017 David Sanchez | ||
* @license http://dwoo.org/LICENSE Modified BSD License | ||
* @license http://dwoo.org/LICENSE LGPLv3 | ||
* @version 1.4.0 | ||
* @date 2017-03-09 | ||
* @date 2017-03-16 | ||
* @link http://dwoo.org/ | ||
*/ | ||
|
||
|
@@ -77,10 +77,10 @@ class Str implements ITemplate | |
* | ||
* @var array | ||
*/ | ||
protected static $cache = [ | ||
'cached' => [], | ||
'compiled' => [] | ||
]; | ||
protected static $cache = array( | ||
'cached' => array(), | ||
'compiled' => array() | ||
); | ||
|
||
/** | ||
* Holds the compiler that built this template. | ||
|
@@ -370,7 +370,7 @@ public function getCompiledTemplate(Core $core, ICompiler $compiler = null) | |
if ($compiler === null) { | ||
$compiler = $core->getDefaultCompilerFactory($this->getResourceName()); | ||
|
||
if ($compiler === null || $compiler === ['Dwoo\Compiler', 'compilerFactory']) { | ||
if ($compiler === null || $compiler === array('Dwoo\Compiler', 'compilerFactory')) { | ||
$compiler = Compiler::compilerFactory(); | ||
} else { | ||
$compiler = call_user_func($compiler); | ||
|