Skip to content

Commit

Permalink
* 3.50 see changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecc committed Feb 25, 2021
1 parent b30021e commit e5f7bde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "eftec/bladeone",
"description": "The standalone version Blade Template Engine from Laravel in a single php file",
"type": "library",
"version": "3.49.1",
"version": "3.50",
"keywords": [
"blade",
"template",
Expand Down
16 changes: 8 additions & 8 deletions lib/BladeOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @copyright Copyright (c) 2016-2020 Jorge Patricio Castro Castillo MIT License.
* Don't delete this comment, its part of the license.
* Part of this code is based in the work of Laravel PHP Components.
* @version 3.49.1
* @version 3.50
* @link https://github.com/EFTEC/BladeOne
*/
class BladeOne
Expand Down Expand Up @@ -239,7 +239,7 @@ public function __construct($templatePath = null, $compiledPath = null, $mode =
return false;
};

if (!\file_exists($this->compiledPath)) {
if (!\is_dir($this->compiledPath)) {
$ok = @\mkdir($this->compiledPath, 0777, true);
if ($ok === false) {
$this->showError(
Expand Down Expand Up @@ -1193,7 +1193,7 @@ public function compile($templateName = null, $forced = false)
// compile the original file
$contents = $this->compileString($this->getFile($template));
$dir = \dirname($compiled);
if (!\file_exists($dir)) {
if (!\is_dir($dir)) {
$ok = @\mkdir($dir, 0777, true);
if ($ok === false) {
$this->showError(
Expand Down Expand Up @@ -1298,7 +1298,7 @@ private function locateTemplate($name)
$this->notFoundPath = '';
foreach ($this->templatePath as $dir) {
$path = $dir . '/' . $name;
if (\file_exists($path)) {
if (\is_file($path)) {
return $path;
}

Expand Down Expand Up @@ -1333,7 +1333,7 @@ public function isExpired($fileName)
{
$compiled = $this->getCompiledFile($fileName);
$template = $this->getTemplateFile($fileName);
if (!\file_exists($template)) {
if (!\is_file($template)) {
if ($this->mode == self::MODE_DEBUG) {
$this->showError('Read file', 'Template not found :' . $this->fileName . " on file: $template", true);
} else {
Expand All @@ -1343,7 +1343,7 @@ public function isExpired($fileName)
// If the compiled file doesn't exist we will indicate that the view is expired
// so that it can be re-compiled. Else, we will verify the last modification
// of the views is less than the modification times of the compiled views.
if (!$this->compiledPath || !\file_exists($compiled)) {
if (!$this->compiledPath || !\is_file($compiled)) {
return true;
}
return \filemtime($compiled) < \filemtime($template);
Expand Down Expand Up @@ -1436,7 +1436,7 @@ public function includeFirst($views = [], $value = [])
private function templateExist($templateName)
{
$file = $this->getTemplateFile($templateName);
return \file_exists($file);
return \is_file($file);
}

/**
Expand Down Expand Up @@ -3674,7 +3674,7 @@ protected function compileIncludeFast($expression)
$exp = \explode(',', $ex);
$file = $this->stripQuotes(isset($exp[0]) ? $exp[0] : null);
$fileC = $this->getCompiledFile($file);
if (!@\file_exists($fileC)) {
if (!@\is_file($fileC)) {
// if the file doesn't exist then it's created
$this->compile($file, true);
}
Expand Down

0 comments on commit e5f7bde

Please sign in to comment.