File config.php

Last commit: Thu Nov 7 22:42:13 2019 +0100	Jan Dankert	Cleanup: Clean default configuration and empty logfile.
1 <?php 2 3 // Default-Configuration. 4 $config = array( 5 'dav.enable' => false, 6 'dav.create' => true, 7 'dav.readonly' => false, 8 'dav.expose_openrat' => true, 9 'dav.compliant_to_redmond' => true, 10 'dav.redirect_collections_to_trailing_slash' => true, 11 'dav.realm' =>'OpenRat CMS WebDAV Login', 12 'dav.anonymous' => false, 13 'cms.host' => 'localhost', 14 'cms.port' => 80, 15 'cms.username' => null, 16 'cms.password' => null, 17 'cms.database' => 'db1', 18 'cms.path' => '/', 19 'cms.max_file_size' => 1000, 20 'log.level' => 'info', 21 'log.file' => null 22 ); 23 24 // Configuration-Loader 25 foreach( array( 26 'dav.ini', 27 'dav.custom.ini', 28 '/etc/openrat-webdav.ini', 29 'dav-'.$_SERVER['HTTP_HOST'].'.ini', 30 @$_ENV['DAV_CONFIG_FILE'] 31 ) as $iniFile ) 32 if ( is_file($iniFile)) 33 $config = array_merge($config,parse_ini_file( $iniFile) ); 34 35 36 // Config values are overwritable by Environment variables. 37 array_walk($config, function(&$value,$key) { 38 $envkey = strtoupper(str_replace('.','_',$key)); 39 if ( @$_ENV[$envkey] ) 40 $value = $_ENV[$envkey]; 41 } );
Download config.php
History Thu, 7 Nov 2019 22:42:13 +0100 Jan Dankert Cleanup: Clean default configuration and empty logfile. Wed, 6 Nov 2019 23:14:55 +0100 Jan Dankert Refactoring: Externalize config reader