Fix blueprints loading (regression from #38)

This commit is contained in:
Matias Griese
2015-08-20 20:45:39 +03:00
parent c4cd355f5b
commit 26d1973110
4 changed files with 7 additions and 6 deletions

View File

@@ -37,6 +37,7 @@ class Blueprints
public function get($type)
{
if (!isset($this->instances[$type])) {
$parents = [];
if (is_string($this->search)) {
$filename = $this->search . $type . YAML_EXT;

View File

@@ -113,8 +113,8 @@ class Plugins extends Iterator
public static function get($name)
{
$blueprints = new Blueprints("plugins://{$name}");
$blueprint = $blueprints->get('blueprints');
$blueprints = new Blueprints('plugins://');
$blueprint = $blueprints->get("{$name}/blueprints");
$blueprint->name = $name;
// Load default configuration.

View File

@@ -90,8 +90,8 @@ class Themes extends Iterator
throw new \RuntimeException('Theme name not provided.');
}
$blueprints = new Blueprints("themes://{$name}");
$blueprint = $blueprints->get('blueprints');
$blueprints = new Blueprints('themes://');
$blueprint = $blueprints->get("{$name}/blueprints");
$blueprint->name = $name;
// Find thumbnail.

View File

@@ -32,8 +32,8 @@ class User extends Data
$locator = self::getGrav()['locator'];
// TODO: validate directory name
$blueprints = new Blueprints('blueprints://user');
$blueprint = $blueprints->get('account');
$blueprints = new Blueprints('blueprints://');
$blueprint = $blueprints->get('user/account');
$file_path = $locator->findResource('account://' . $username . YAML_EXT);
$file = CompiledYamlFile::instance($file_path);
$content = $file->content();