diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8d25a..49a952a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Wireframe.module.php b/Wireframe.module.php index 807a501..caff57b 100644 --- a/Wireframe.module.php +++ b/Wireframe.module.php @@ -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 * @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/ */ @@ -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; }