galette.close()
#set galette nightly version
- includes_dir = os.path.join(src_dir, rel_name, 'galette', 'includes')
+ config_dir = os.path.join(src_dir, rel_name, 'galette', 'config')
if nightly_version != None:
- sed_cmd = 'sed -e "s/GALETTE_NIGHTLY\', false/GALETTE_NIGHTLY\', \'%s\'/" -i galette.inc.php' % nightly_version
+ sed_cmd = 'sed -e "s/GALETTE_NIGHTLY\', false/GALETTE_NIGHTLY\', \'%s\'/" -i versions.inc.php' % nightly_version
print(sed_cmd)
- p1 = subprocess.Popen(sed_cmd, shell=True, cwd=includes_dir)
+ p1 = subprocess.Popen(sed_cmd, shell=True, cwd=config_dir)
p1.wait()
#install npm modules
define('GALETTE_COMPILE_DIR', GALETTE_DATA_PATH . 'templates_c/');
}
if (!defined('GALETTE_CACHE_DIR')) {
- define('GALETTE_CACHE_DIR', GALETTE_DATA_PATH . 'cache/');
+ define('GALETTE_CACHE_DIR', GALETTE_DATA_PATH . 'cache/' . GALETTE_VERSION . '/');
}
if (!defined('GALETTE_EXPORTS_PATH')) {
define('GALETTE_EXPORTS_PATH', GALETTE_DATA_PATH . 'exports/');
define('GALETTE_PHP_MIN', '8.1');
define('GALETTE_MYSQL_MIN', '5.7');
define('GALETTE_MARIADB_MIN', '10.4');
-define('GALETTE_PGSQL_MIN', '11') ;
\ No newline at end of file
+define('GALETTE_PGSQL_MIN', '11') ;
+define('GALETTE_NIGHTLY', false);
+define('GALETTE_VERSION', 'v1.0.2');
+define('GALETTE_COMPAT_VERSION', '1.0.0');
+define('GALETTE_DB_VERSION', '0.960');
$profiler->start();
}
-define('GALETTE_NIGHTLY', false);
-define('GALETTE_VERSION', 'v1.0.2');
-
//Version to display
if (!defined('GALETTE_HIDE_VERSION')) {
define('GALETTE_DISPLAY_VERSION', \Galette\Core\Galette::gitVersion(false));
}
-define('GALETTE_COMPAT_VERSION', '1.0.0');
-define('GALETTE_DB_VERSION', '0.960');
if (!defined('GALETTE_MODE')) {
define('GALETTE_MODE', \Galette\Core\Galette::MODE_PROD);
}
public function cleanHtmlValue(string $value): string
{
$config = \HTMLPurifier_Config::createDefault();
- $config->set('Cache.SerializerPath', GALETTE_CACHE_DIR);
+ $cache_dir = rtrim(GALETTE_CACHE_DIR, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'htmlpurifier';
+ if (!file_exists($cache_dir)) {
+ mkdir($cache_dir, 0755, true);
+ }
+ $config->set('Cache.SerializerPath', $cache_dir);
$purifier = new \HTMLPurifier($config);
return $purifier->purify($value);
}
define('GALETTE_TPL_SUBDIR', 'templates/default/');
define('GALETTE_THEME', 'themes/default/');
define('GALETTE_DATA_PATH', GALETTE_TESTS_PATH . '/tests-data/');
+define('GALETTE_CACHE_DIR', GALETTE_DATA_PATH . 'cache/');
if (is_dir(GALETTE_DATA_PATH)) {
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(