Skip to content

Commit

Permalink
release 5.1.1: reflection of child with namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rafageist committed Jul 23, 2019
1 parent c75fda3 commit a187802
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Jul 22, 2019
--------------------------
- `release` version 5.1.1
- `improvement` support namespaces of div's child
- `release` version 5.1.0
- `improvement`: Better resolution of default template for
child classes of div, using Reflection!
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Div PHP Template Engine 5.1.0
# Div PHP Template Engine 5.1.1

[![Build Status](http://divengine.com/status.png)](https://github.com/divengine/div)
[![License](http://divengine.com/license.png)](https://www.gnu.org/licenses/gpl-3.0.txt)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"code generator"
],
"homepage": "https://divengine.com",
"version": "5.1.0",
"version": "5.1.1",
"authors": [
{
"name": "Rafa Rodriguez",
Expand Down
13 changes: 5 additions & 8 deletions src/div.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
*
* @package divengine/div
* @author Rafa Rodriguez @rafageist [https://rafageist.github.io]
* @version 5.1.0
* @version 5.1.1
*
* @link https://divengine.com/div
* @link https://github.com/divengine/div
* @link https://github.com/divengine/div/wiki
*
*/

use ReflectionClass;
Expand Down Expand Up @@ -738,7 +737,7 @@ class div
// ----- Internals -----
// current version of Div
private static $__version = '5.1.0';
private static $__version = '5.1.1';
// name of the super class
private static $__super_class;
Expand Down Expand Up @@ -887,11 +886,9 @@ public function __construct($src = null, $items = null, $ignore = [])
if ($class_name !== self::$__super_class && $this->__src === null) {
$reflection = new ReflectionClass($class_name);
$dir = pathinfo($reflection->getFileName(), PATHINFO_DIRNAME);
if ($dir === __DIR__) {
$src = $class_name;
} else {
$src = $dir.'/'.$class_name;
}
$filename = pathinfo($reflection->getFileName(), PATHINFO_BASENAME);
$ext = pathinfo($reflection->getFileName(), PATHINFO_EXTENSION);
$src = $dir.'/'.substr($filename,0,0 - strlen($ext) - 1);
}
if ($this->__src !== null) {
Expand Down

0 comments on commit a187802

Please sign in to comment.