-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request]: Use a cleaner format in e107_config.php #5120
Comments
RFC:
|
Thank you for this @Deltik . Since e107's inception by Jalist over 20 years ago, I, and the other developers through the years, have tried our best to follow his lead, by maintaining the KISS principal "keep-it-simple, stupid!" that he worked by. Not just with the user experience of e107, but also in how it is coded. The goal has always been to minimize complexity, take a minimalist approach, while still trying to maintain a balance, so that the CMS remains both flexible and powerful. Particularly in the areas of plugins, themes and files that users may need to edit, we've always strived to reduce complexity, in order to make the code feel intuitive, even to a non-coder or novice. So, while I appreciate all the time and effort that must have gone into your proposal, after careful consideration, I don’t find it to be a good fit for e107. btw. I also took some time to research the format of similar config files for other CMSes while considering your proposal.
/** The name of the database for WordPress */
define('DB_NAME', 'database_name');
/** MySQL database username */
define('DB_USER', 'database_username');
/** MySQL database password */
define('DB_PASSWORD', 'database_password');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
public $dbtype = 'mysqli';
public $host = 'localhost';
public $user = 'database_user';
public $password = 'database_password';
public $db = 'database_name';
public $dbprefix = 'jos_';
<?php
/**
* Database settings:
*/
$databases['default']['default'] = [
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'port' => '3306',
'driver' => 'mysql',
'prefix' => '',
];
/**
* Salt for one-time login links, cancel links, form tokens, etc.
*/
$settings['hash_salt'] = 'YOUR_HASH_SALT';
/**
* Access control for update.php script
*/
$settings['update_free_access'] = FALSE;
/**
* Default theme
*/
$settings['default_theme'] = 'bartik';
...
'db' => [
'table_prefix' => '',
'connection' => [
'default' => [
'host' => 'localhost',
'dbname' => 'magento',
'username' => 'root',
'password' => ‘root’,
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;',
'active' => '1'
]
]
],
...
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'database_name');
define('_DB_USER_', 'database_user');
define('_DB_PASSWD_', 'database_password');
define('_DB_PREFIX_', 'ps_');
// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'user');
define('DB_PASSWORD', 'pass');
define('DB_DATABASE', 'opencart');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] = 'your-database-name';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] = 'database-user';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] = 'password';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['port'] = '3306';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] = 'localhost';
ExpressionEngine utilizes a $config['app_version'] = "305";
$config['install_lock'] = "";
$config['license_number'] = "";
$config['debug'] = "1";
$config['cp_url'] = "";
$config['doc_url'] = "http://ellislab.com/expressionengine/user-guide/";
$config['site_label'] = 'My Site';
$config['cookie_prefix'] = '';
In Concrete5, the configuration details are stored as PHP constants inside the define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'your_db_username');
define('DB_PASSWORD', 'your_db_password');
define('DB_DATABASE', 'your_database');
define('PASSWORD_SALT', 'random_string_for_encryption');
Craft CMS utilizes a # The environment Craft is currently running in
ENVIRONMENT="dev"
# The secure key Craft will use for hashing and encrypting data
SECURITY_KEY="your_security_key"
# The data source name (DSN) for connecting to the database
DB_DSN="mysql:host=localhost;dbname=craft"
# The database username
DB_USER="your_db_username"
# The database password
DB_PASSWORD="your_db_password"
# The database table prefix
DB_TABLE_PREFIX="craft"
In this flat-file CMS, the system configuration is stored as a YAML file in home:
alias: '/home'
cache:
enabled: true
system:
pages:
theme: mytheme
cache:
gzip: true |
Be aware that f.e. lgsl plugin uses e107_config this way:
|
Tested: |
Motivation
Currently it's a mess of different formats.
Proposed Solution
Return a multi-dimensional array. As an example:
or an Object:
Alternatives
Additional Context
No response
The text was updated successfully, but these errors were encountered: