From 17cea816d83a1f8df04601f69137e17658df0e03 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 1 Jun 2019 12:40:17 +1000 Subject: [PATCH] enableDatabaseLayer -> databaseTemplates --- config/cms.php | 60 ++++++++++++++-------------- modules/cms/classes/Theme.php | 2 +- modules/system/console/ThemeSync.php | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/config/cms.php b/config/cms.php index 49e649c27..7d176c68f 100644 --- a/config/cms.php +++ b/config/cms.php @@ -56,7 +56,7 @@ return [ | Back-end login remember |-------------------------------------------------------------------------- | - | Define live duration of backend sessions : + | Define live duration of backend sessions: | | true - session never expire (cookie expiration in 5 years) | @@ -211,6 +211,32 @@ return [ 'enableAssetDeepHashing' => null, + /* + |-------------------------------------------------------------------------- + | Database-driven Themes + |-------------------------------------------------------------------------- + | + | Stores theme templates in the database instead of the filesystem. + | + | false - All theme templates are sourced from the filesystem. + | + | true - Source theme templates from the database with fallback to the filesytem. + | + | null - Setting equal to the inverse of app.debug: debug enabled, this disabled. + | + | The database layer stores all modified CMS files in the database. Files that are + | not modified continue to be loaded from the filesystem. The `theme:sync $themeDir` + | console command is available to populate the database from the filesystem with + | the `--toFile` flag to sync in the other direction (database to filesystem) and + | the `--paths="/path/to/file.md,/path/to/file2.md" flag to sync only specific files. + | + | Files modified in the database are cached to indicate that they should be loaded + | from the database. + | + */ + + 'databaseTemplates' => false, + /* |-------------------------------------------------------------------------- | Public plugins path @@ -346,20 +372,20 @@ return [ */ 'forceBytecodeInvalidation' => true, - + /* |-------------------------------------------------------------------------- | Twig Strict Variables |-------------------------------------------------------------------------- | - | If strict_variables is disabled, Twig will silently ignore invalid + | If strict_variables is disabled, Twig will silently ignore invalid | variables (variables and or attributes/methods that do not exist) and | replace them with a null value. When enabled, Twig throws an exception | instead. If set to null, it is enabled when debug mode (app.debug) is | enabled. | */ - + 'enableTwigStrictVariables' => false, /* @@ -381,30 +407,4 @@ return [ 'restrictBaseDir' => true, - /* - |-------------------------------------------------------------------------- - | CMS Database Layer - |-------------------------------------------------------------------------- - | - | Enables the database layer for the CMS content files. - | - | Allowed values: - | - false: Database layer is disabled, the FileDatasource is used - | - true: Database layer is enabled, the AutoDatasource is used - | - null: Setting equal to the inverse of app.debug: debug enabled, this disabled - | - | The database layer stores all modified CMS files in the database. - | Files that are not modified continue to be loaded from the filesystem. - | The `theme:sync $themeDir` console command is available to populate the - | database from the filesystem with the `--toFile` flag to sync in the - | other direction (database to filesystem) and the `--paths="/path/to/file.md,/path/to/file2.md" - | flag to sync only specific files. - | - | Files modified in the database are cached to indicate that they should - | be loaded from the database. - | - */ - - 'enableDatabaseLayer' => false, - ]; diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php index ab54a35ce..2b48e10e5 100644 --- a/modules/cms/classes/Theme.php +++ b/modules/cms/classes/Theme.php @@ -513,7 +513,7 @@ class Theme */ public static function databaseLayerEnabled() { - $enableDbLayer = Config::get('cms.enableDatabaseLayer', false); + $enableDbLayer = Config::get('cms.databaseTemplates', false); if (is_null($enableDbLayer)) { $enableDbLayer = !Config::get('app.debug', false); } diff --git a/modules/system/console/ThemeSync.php b/modules/system/console/ThemeSync.php index 9aee5c019..ca950a76a 100644 --- a/modules/system/console/ThemeSync.php +++ b/modules/system/console/ThemeSync.php @@ -72,7 +72,7 @@ class ThemeSync extends Command // Check to see if the DB layer is enabled if (!Theme::databaseLayerEnabled()) { - return $this->error("cms.enableDatabaseLayer is not enabled, enable it first and try again."); + return $this->error("cms.databaseTemplates is not enabled, enable it first and try again."); } // Check to see if the provided theme exists