From 0b53d39cdb7ef9de6b63fe44c8e416ac8b8a32e1 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 19 Feb 2016 11:56:09 +0200 Subject: [PATCH] Refactor Blueprints object creation --- system/src/Grav/Common/Data/Blueprint.php | 2 -- system/src/Grav/Common/Data/Blueprints.php | 2 +- system/src/Grav/Common/User/Group.php | 6 +++--- system/src/Grav/Common/User/User.php | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index 0be3d5fea..60ac28308 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -40,7 +40,6 @@ class Blueprint extends BaseBlueprints implements ExportInterface if ($data) { $this->embed('', $data); - $this->init('static'); } } @@ -57,7 +56,6 @@ class Blueprint extends BaseBlueprints implements ExportInterface return $this; } - /** * Get meta value by using dot notation for nested arrays/objects. * diff --git a/system/src/Grav/Common/Data/Blueprints.php b/system/src/Grav/Common/Data/Blueprints.php index 0a6fe979a..e1d76581e 100644 --- a/system/src/Grav/Common/Data/Blueprints.php +++ b/system/src/Grav/Common/Data/Blueprints.php @@ -21,7 +21,7 @@ class Blueprints /** * @param string|array $search Search path. */ - public function __construct($search) + public function __construct($search = 'blueprints://') { $this->search = $search; } diff --git a/system/src/Grav/Common/User/Group.php b/system/src/Grav/Common/User/Group.php index f32402b5a..475090bd7 100644 --- a/system/src/Grav/Common/User/Group.php +++ b/system/src/Grav/Common/User/Group.php @@ -56,7 +56,7 @@ class Group extends Data $content = []; } - $blueprints = new Blueprints('blueprints://'); + $blueprints = new Blueprints; $blueprint = $blueprints->get('user/group'); if (!isset($content['groupname'])) { $content['groupname'] = $groupname; @@ -71,7 +71,7 @@ class Group extends Data */ public function save() { - $blueprints = new Blueprints('blueprints://'); + $blueprints = new Blueprints; $blueprint = $blueprints->get('user/group'); $fields = $blueprint->fields(); @@ -114,7 +114,7 @@ class Group extends Data */ public static function remove($groupname) { - $blueprints = new Blueprints('blueprints://'); + $blueprints = new Blueprints; $blueprint = $blueprints->get('user/group'); $groups = self::getGrav()['config']->get("groups"); diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index da51c1235..394f52d19 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -36,7 +36,7 @@ class User extends Data // force lowercase of username $username = strtolower($username); - $blueprints = new Blueprints('blueprints://'); + $blueprints = new Blueprints; $blueprint = $blueprints->get('user/account'); $file_path = $locator->findResource('account://' . $username . YAML_EXT); $file = CompiledYamlFile::instance($file_path);