1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

fix(core): fix flextype config loading.

BREAKING CHANGES

1. /project/config/settings.yaml move to /project/config/flextype/settings.yaml
2. remove constant PATH['config'], use - PATH['project'] . '/config/'
This commit is contained in:
Awilum
2020-06-27 09:19:21 +03:00
parent 7b722673ce
commit cd89c9e1a4
6 changed files with 5 additions and 6 deletions

View File

@@ -33,7 +33,6 @@ define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd()));
*/
define('PATH', [
'project' => ROOT_DIR . '/project',
'config' => ROOT_DIR . '/src/flextype/config',
'cache' => ROOT_DIR . '/var/cache',
'logs' => ROOT_DIR . '/var/logs',
]);

View File

@@ -43,12 +43,12 @@ $registry = new Registry();
* 3. Merge settings.
* 4. Store settings in the flextype registry.
*/
$flextype_manifest_file_path = PATH['config'] . '/flextype.yaml';
$default_flextype_settings_file_path = PATH['config'] . '/settings.yaml';
$custom_flextype_settings_file_path = PATH['project'] . '/config/settings.yaml';
$flextype_manifest_file_path = ROOT_DIR . '/src/flextype/flextype.yaml';
$default_flextype_settings_file_path = ROOT_DIR . '/src/flextype/settings.yaml';
$custom_flextype_settings_file_path = PATH['project'] . '/config/flextype/settings.yaml';
// Create config dir
! Filesystem::has(PATH['project'] . '/config/') and Filesystem::createDir(PATH['project'] . '/config/');
! Filesystem::has(PATH['project'] . '/config/flextype/') and Filesystem::createDir(PATH['project'] . '/config/flextype/');
// Set settings if Flextype Default settings config files exist
if (! Filesystem::has($default_flextype_settings_file_path)) {

View File

@@ -44,7 +44,7 @@ class Plugins
public function __construct($flextype, $app)
{
$this->flextype = $flextype;
$this->locales = $this->flextype['serializer']->decode(Filesystem::read(ROOT_DIR . '/src/flextype/config/locales.yaml'), 'yaml');
$this->locales = $this->flextype['serializer']->decode(Filesystem::read(ROOT_DIR . '/src/flextype/locales.yaml'), 'yaml');
}
/**