mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-16 10:44:55 +02:00
Settings [WIP]
New Settings class New Plugins::load() method Move config.php to settings.php MyAAC Settings will have plugin_name = 'core' Add compat_config.php
This commit is contained in:
@@ -88,9 +88,6 @@ if(isset($config['lua']['servername']))
|
||||
if(isset($config['lua']['houserentperiod']))
|
||||
$config['lua']['houseRentPeriod'] = $config['lua']['houserentperiod'];
|
||||
|
||||
if($config['item_images_url'][strlen($config['item_images_url']) - 1] !== '/')
|
||||
$config['item_images_url'] .= '/';
|
||||
|
||||
// localize data/ directory based on data directory set in config.lua
|
||||
foreach(array('dataDirectory', 'data_directory', 'datadir') as $key) {
|
||||
if(!isset($config['lua'][$key][0])) {
|
||||
@@ -124,6 +121,20 @@ require_once SYSTEM . 'libs/pot/OTS.php';
|
||||
$ots = POT::getInstance();
|
||||
require_once SYSTEM . 'database.php';
|
||||
|
||||
// settings
|
||||
require_once LIBS . 'Settings.php';
|
||||
$settings = Settings::getInstance();
|
||||
$settings->load();
|
||||
|
||||
// deprecated config values
|
||||
require_once __DIR__ . '/compat_config.php';
|
||||
|
||||
$settingsItemImagesURL = $settings['core.item_images_url'];
|
||||
if($settingsItemImagesURL['value'][strlen($settingsItemImagesURL['value']) - 1] !== '/') {
|
||||
$settingsItemImagesURL['value'] .= '/';
|
||||
$settings['core.item_images_url'] = $settingsItemImagesURL;
|
||||
}
|
||||
|
||||
define('USE_ACCOUNT_NAME', $db->hasColumn('accounts', 'name'));
|
||||
// load vocation names
|
||||
$tmp = '';
|
||||
@@ -207,4 +218,4 @@ else {
|
||||
config(['towns', $towns]);
|
||||
//////////////////////////////////////////////
|
||||
// END - load towns from database (TFS 1.3) //
|
||||
//////////////////////////////////////////////
|
||||
//////////////////////////////////////////////
|
Reference in New Issue
Block a user