config.php and lepton.ini
In LEPTON 4.x we introduce the new config directory in the root of your installation. The config directory holds the lepton.ini file which contains all information for the database connection, and the config.php. This prevents both files from being overwritten accidently.
The big advantage of the lepton.ini procedure is, that the db-data is not available as constants during the whole session.
The lepton.ini is created during installation in config directory and looks like this:
; DB-setup for LEPTON-CMS
[database]
type = 'mysql'
host = 'localhost'
port = '3306'
user = 'db_user'
pass = 'db-password'
name = 'db-name'
prefix = 'table_prefix'
mode = 'STRICT_ALL_TABLES'
key = '4b9f6c43fe444a5eb04ca460b2b679a1'
cipher = 'AES-256-CBC'
iv = '9l@kCVBe|TWXwZ8F'
options = '0'
[system_const]
AUTH_MIN_LOGIN_LENGTH = 3
AUTH_MAX_LOGIN_LENGTH = 128
AUTH_MIN_PASS_LENGTH = 6
AUTH_MAX_PASS_LENGTH = 128
SUBVERSION = ''
MAX_REGISTRATION_TIME = 3600
MAX_WYSIWYG_HISTORY = 6
; Set allowed additional chars for email and usernames (extends LEPTON_handle methods)
[custom_vars]
additional_email_chars = ''
additional_usernames_chars = 'äöüÄÖÜ'
Some values in lepton.ini.php are needed for de-/encryption and define lenghts and subversion (if needed for customers).
The config file - also created during installation - looks like:
if(defined('LEPTON_PATH')) { die('By security reasons it is not permitted to load 'config.php' twice!! Forbidden call from ''.\\\\$_SERVER['SCRIPT_NAME'].''!'); }
// config file created by LEPTON 6.1.0
define('LEPTON_PATH', dirname(dirname(__FILE__)));
define('LEPTON_URL', 'https://my_domain.tld');
define('ADMIN_PATH', LEPTON_PATH.'/backend');
define('ADMIN_URL', LEPTON_URL.'/backend');
define('LEPTON_GUID', '05a62567-3a5f-47d3-b8c3-d1c6130ca9bf');
if (!defined('LEPTON_INSTALL')) require_once(LEPTON_PATH.'/framework/initialize.php');
- DB_TYPE
- Indicates the database type; nothing to change
- DB_HOST
- The IP to database; if the same server provides db and apache, you should use localhost
- DB_PORT
- Port which should be used for connection; default is 3306
- DB_USERNAME
- Username which can access to the database
- DB_PASSWORD
- Password for database
- DB_NAME
- Name of the database; if the user has MySQL creation right, a DB will be created during installation
- TABLE_PREFIX
- Sets the table prefix; used for several installations of LEPTON with one database, just use a different prefix
- LEPTON_PATH
- LEPTON_URL
- Complete URL with domain to your LEPTON installation
- ADMIN_PATH
- Relative (from
LEPTON_PATH
) path to your admin folder; Renaming admins directory, you have to change this as well. - ADMIN_URL
- Complete URL to your admin directory; Renaming admins directory, you have to change this as well.
- LEPTON_GUID
- A unique GUID