Skip to content

Commit

Permalink
Autoload Factory if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Mar 13, 2020
1 parent 6c1f712 commit 36ebbf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.10.1] - 2020-03-13

### Fixed
- Autoload Factory class in cases where it's methods are called before Wireframe has been initiated.

## [0.10.0] - 2020-03-03

### Added
Expand Down
5 changes: 4 additions & 1 deletion Wireframe.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @method static string|Page|NullPage page($source, $args = []) Static getter (factory) method for Pages.
* @method static string|null partial(string $partial_name, array $args = []) Static getter (factory) method for Partials.
*
* @version 0.10.0
* @version 0.10.1
* @author Teppo Koivula <[email protected]>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down Expand Up @@ -931,6 +931,9 @@ public static function __callStatic($method, $arguments) {
case 'component':
case 'page':
case 'partial':
if (!class_exists('\Wireframe\Factory')) {
include_once __DIR__ . '/lib/Factory.php';
}
return \call_user_func_array(['\Wireframe\Factory', $method], $arguments);
break;
}
Expand Down

0 comments on commit 36ebbf7

Please sign in to comment.