mirror of
https://github.com/flextype/flextype.git
synced 2025-08-04 20:27:35 +02:00
feat(core): add new tmp constant #470
This commit is contained in:
@@ -33,8 +33,7 @@ define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd()));
|
||||
*/
|
||||
define('PATH', [
|
||||
'project' => ROOT_DIR . '/project',
|
||||
'cache' => ROOT_DIR . '/var/cache',
|
||||
'logs' => ROOT_DIR . '/var/logs',
|
||||
'tmp' => ROOT_DIR . '/var/tmp',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
@@ -124,7 +124,7 @@ flextype()->container()['cache'] = static function () {
|
||||
|
||||
foreach (flextype('registry')->get('flextype.settings.cache.drivers.'. $driver_name) as $key => $value) {
|
||||
if ($key == 'path' && in_array($driver_name, ['files', 'sqlite', 'leveldb'])) {
|
||||
$config['path'] = (!empty($value)) ? ROOT_DIR . '/var/tmp/' . $value : sys_get_temp_dir();
|
||||
$config['path'] = (!empty($value)) ? PATH['tmp'] . '/' . $value : sys_get_temp_dir();
|
||||
} else {
|
||||
$config[Strings::camel($key)] = $value;
|
||||
}
|
||||
@@ -257,7 +257,7 @@ flextype()->container()['images'] = static function () {
|
||||
|
||||
// Set cache filesystem
|
||||
$cache = new Filesystem(
|
||||
new Local(ROOT_DIR . '/var/tmp/glide')
|
||||
new Local(PATH['tmp'] . '/glide')
|
||||
);
|
||||
|
||||
// Set watermarks filesystem
|
||||
|
@@ -8,7 +8,7 @@ use Symfony\Component\Yaml\Yaml as SymfonyYaml;
|
||||
$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';
|
||||
$preflight_flextype_path = PATH['cache'] . '/preflight/flextype/';
|
||||
$preflight_flextype_path = PATH['tmp'] . '/preflight/flextype/';
|
||||
$custom_flextype_settings_path = PATH['project'] . '/config/flextype/';
|
||||
|
||||
! Filesystem::has($preflight_flextype_path) and Filesystem::createDir($preflight_flextype_path);
|
||||
|
Reference in New Issue
Block a user