openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c91be1cf10cc94c434902ebb7811da5db30b70d3
parent 6403778287eeeb8c3c956d161f20219f4264048b
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 25 Sep 2012 21:34:08 +0200

Geänderte Voreinstellung: Theme-Compiler aktivieren.

Diffstat:
config/config-default.php | 11++++-------
config/config.ini.php | 71++++++++++++++++++++++++++++++++---------------------------------------
util/TemplateEngine.class.php | 10++++++----
3 files changed, 42 insertions(+), 50 deletions(-)

diff --git a/config/config-default.php b/config/config-default.php @@ -1,5 +1,5 @@ <?php -// DO NOT MAKE ANY CHANGES IN THIS FILE, please edit the configuration file instead. +// DO NOT MAKE ANY CHANGES IN THIS FILE, please edit the file 'config.ini.php' or 'config-<host>.ini.php' instead. // This file should only be changed by developers. $conf = array(); $conf['applications'] = array(); @@ -15,8 +15,6 @@ $conf['cache']['conditional_get']='true'; $conf['cache']['enable_cache']=false; $conf['cache']['tmp_dir']=""; $conf['config'] = array(); -$conf['config']['per_host_configuration']= true; -$conf['config']['per_host_configuration_dir']= "./config/virtual"; $conf['config']['auto_reload']= true; $conf['config']['session_destroy_on_config_reload']= true; $conf['content'] = array(); @@ -801,11 +799,10 @@ $conf['security']['user']['show_mail']=true; $conf['security']['user']['send_message']=true; $conf['theme'] = array(); $conf['theme']['compiler'] = array(); -$conf['theme']['compiler']['enable']=false; +$conf['theme']['compiler']['enable']=true; $conf['theme']['compiler']['cache']=true; -$conf['theme']['compiler']['chmod']='0'; -$conf['theme']['compiler']['compile_at_logout']=true; -$conf['theme']['compiler']['compile_to_tmp_dir']=false; +$conf['theme']['compiler']['chmod']=''; +$conf['theme']['compiler']['compile_at_logout']=false; $conf['webdav'] = array(); $conf['webdav']['enable']=false; $conf['webdav']['create']=true; diff --git a/config/config.ini.php b/config/config.ini.php @@ -51,16 +51,21 @@ cache.enable_cache=false ; Directory for temporary files. -; Default=blank (OpenRat uses the system temporary dir) -cache.tmp_dir="" -; -; converted from config.ini.php -; <?php exit('direct access denied') ?> +; Default: blank (means: OpenRat is using the system temporary dir) +;cache.tmp_dir= -config.per_host_configuration = true -config.per_host_configuration_dir = ./config/virtual +; Auto-Reload session. +; If the configuration file is changed, its content is reloaded automatically +; Default: true +;config.auto_reload= true; + +; +; If the configuration file is changed, a new session will be created. +; Default: true +;config.session_destroy_on_config_reload= true; + ; ; converted from content.ini.php ; <?php exit('direct access denied') ?> @@ -74,9 +79,8 @@ content.file.max_file_size=1500 -; next section: [revision-limit] -; This is your delete-strategy of old content. +; Delete-strategy of old content. ; Values are deleted, if ; a) max-age and min-revisions are reached OR @@ -95,20 +99,16 @@ content.revision-limit.min-revisions = 3 -; next section: [language] - -; If a text is empty, try using the default language +; If a textvalue is empty, try using the default language ; Default: true -content.language.use_default_language = true +;content.language.use_default_language = true ; -; -; converted from database.ini.php -; <?php exit('direct access denied') ?> -; Database configuration file + +; Database configuration. ; You have to have at least one database connection which has 'enabled=true'. -;database. +; ; Supported RDBMS-types: ; - 'mysql' the old PHP-mysql-driver ; - 'mysqli' PHP-mysql-driver with support for prepared statements (EXPERIMENTAL) (since PHP 5.0) @@ -126,8 +126,6 @@ database.default=sample_db_mysql -; next section: [sample_db_mysql] - ; This is a sample database connection. ; If you want to use it, just fill out the login data and set 'enabled' to 'true' @@ -172,8 +170,6 @@ database.sample_db_mysql.readonly = false -; next section: [sample_db_postgresql] - ; This is a sample database connection. ; If you want to use it, just fill out the login data and set 'enabled' to 'true' @@ -300,18 +296,17 @@ database.sample_pdo_sqlite.convert_to_lowercase = false ;database.sample_pdo_sqlite.option_myoption_b - ; Add here more sections with other database connections. ; next unused section: ;[another_db] ; type=... ; comment="My production DB ..." ; ... -; -; converted from date.ini.php -; <?php die('no access'); ?> -; date formats + + +; +; Date formats ; see http://www.php.net/manual/en/function.date.php for details ; next section: [format] @@ -1429,30 +1424,28 @@ security.user.show_mail=true ; (not yet implemented) security.user.send_message=true ; -; converted from theme.ini.php -; <?php exit('direct access denied') ?> + + ; Theme compiler. -; These settings are only useful for developers! -; next section: [compiler] ; Enable the Template Compiler -; files under themes/default/pages must be writable. -; default=false -theme.compiler.enable=false +; Templates files are written to a temporary directory. +; default=true +;theme.compiler.enable=true ; Only compile, if the file under themes/default/templates is changed. ; default=true -theme.compiler.cache=true +;theme.compiler.cache=true -; Do a CHMOD on a written file. -; default= +; Do a CHMOD on the output file. +; default: empty theme.compiler.chmod= ; Compile ALL templates at logout ; (only useful while developing) -; default=false -theme.compiler.compile_at_logout=true +; default: false +;theme.compiler.compile_at_logout=false ; Compile ALL templates to temporary directory ; only useful while developing! Not for production use. diff --git a/util/TemplateEngine.class.php b/util/TemplateEngine.class.php @@ -58,6 +58,8 @@ class TemplateEngine $tplName = $this->tplName; global $conf; + $confCompiler = $conf['theme']['compiler']; + $srcOrmlFilename = 'themes/default/templates/'.$tplName.'.tpl.src.'.PHP_EXT; $srcXmlFilename = 'themes/default/templates/'.$tplName.'.tpl.src.xml'; @@ -74,7 +76,7 @@ class TemplateEngine $filename = FileUtils::getTempDir().'/'.'or.cache.tpl.'.str_replace('/', '.',$tplName).'.tpl.'.PHP_EXT; // Wenn Vorlage gaendert wurde, dann Umwandlung erneut ausf�hren. - if ( $conf['theme']['compiler']['cache'] && is_file($filename) && filemtime($srcFilename) <= filemtime($filename)) + if ( $confCompiler['cache'] && is_file($filename) && filemtime($srcFilename) <= filemtime($filename)) return; if ( is_file($filename) && !is_writable($filename) ) @@ -123,9 +125,9 @@ class TemplateEngine fclose($outFile); - // CHMOD ausf�hren. - if ( !empty($conf['theme']['compiler']['chmod'])) - if ( !@chmod($filename,octdec($conf['theme']['compiler']['chmod'])) ) + // CHMOD ausfuehren. + if ( !empty($confCompiler['chmod'])) + if ( !@chmod($filename,octdec($confCompiler['chmod'])) ) die( "CHMOD failed on file ".$filename ); }