1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-09 22:56:46 +02:00
- from now no need to add plugin names manually to the site.yaml
- added ability to load plugins blueprints.yaml file
- from now plugins configurations stored in the plugin-name.yaml file
This commit is contained in:
Awilum
2018-06-29 16:38:50 +03:00
parent b8fc75b332
commit 69c21961a7
2 changed files with 10 additions and 7 deletions

View File

@@ -110,13 +110,14 @@ class Plugins
// Set empty plugins item
Registry::set('plugins', []);
$plugins_list = Filesystem::getDirList(PATH['plugins']);
// If Plugins List isnt empty then create plugin cache ID
if (is_array($plugins_list) && count($plugins_list) > 0) {
// Go through...
foreach ($plugins_list as $plugin) {
if (Filesystem::fileExists($_plugin = PATH['plugins'] . '/' . $plugin . '/' . $plugin . '.yaml')) {
if (Filesystem::fileExists($_plugin = PATH['plugins'] . '/' . $plugin . '/blueprints.yaml')) {
$_plugins_cache_id .= filemtime($_plugin);
}
}
@@ -135,11 +136,15 @@ class Plugins
// Go through...
foreach ($plugins_list as $plugin) {
if (Filesystem::fileExists($_plugin_manifest = PATH['plugins'] . '/' . $plugin . '/' . $plugin . '.yaml')) {
$plugin_manifest = Yaml::parseFile($_plugin_manifest);
if (Filesystem::fileExists($_plugin_blueprints = PATH['plugins'] . '/' . $plugin . '/blueprints.yaml')) {
$plugin_blueprints = Yaml::parseFile($_plugin_blueprints);
}
$_plugins_config[basename($_plugin_manifest, '.yaml')] = $plugin_manifest;
if (Filesystem::fileExists($_plugin_config = PATH['plugins'] . '/' . $plugin . '/'. $plugin. '.yaml')) {
$plugin_config = Yaml::parseFile($_plugin_config);
}
$_plugins_config[basename($_plugin_config, '.yaml')] = array_merge($plugin_blueprints, $plugin_config);
}
Registry::set('plugins', $_plugins_config);

View File

@@ -15,8 +15,6 @@ charset: UTF-8
theme: simple
plugins:
locale: "en"
pages:
@@ -26,7 +24,7 @@ errors:
display: true
cache:
enabled: true
enabled: false
prefix: flextype
driver: auto
lifetime: 604800