🥗 Configuration Options
Add configuration items to the config.php file in the root directory to enable more functionality. Currently supported configuration options are as follows:
Hide Admin Backend Login Page
const ADMIN_PATH_CODE = 'abcd';
- Replace abcd with 8-16 alphanumeric characters, no special characters allowed.
- After modification, you can only access: http://yourdomain/admin/account.php?action=signin&s=abcd to log in to the backend.
Disable Manual Upload Installation of Applications in Backend
const APP_UPLOAD_FORBID = true;
Most applications can be installed through the app store. For users who don't need to use the backend upload installation feature, it's recommended to disable this function for slightly better security.
Enable Developer Mode
const ENVIRONMENT = 'develop';
After configuration, the program will output more detailed error information, including warning and notice level errors, making it easier to debug and improve code.
Maximum File Upload Size for Administrators (including content editors)
If not configured, the system defaults to allowing administrators (including content editors) to upload files up to 2G.
const UPLOAD_MAX_SIZE = 1024000; // Unit: KB
File Type Restrictions for Administrator Uploads (including content editors)
- If not configured, the system defaults to allowing administrators (including content editors) to upload most common file types
- Set file extensions, separated by English commas, as follows:
const UPLOAD_ATT_TYPE = 'rar,zip,gif,jpg,jpeg,png,webp,txt,pdf,docx,doc,xls,xlsx,mp4,mp3';
Use PDO to Connect to Database
- The system uses mysqli extension to connect to the database by default. If you want to use PDO, configure the following constant.
- However, using PDO is not recommended as this method has not been fully tested and verified, and may have unknown issues.
const USE_MYSQL_PDO = true;
Use Relative Paths for Uploaded Images and Files
const UPLOAD_PATH_RELATIVE = true;
Disable Article Auto-Save
const ARTICLE_AUTOSAVE_OFF = true;
Enable Dynamic Template Theme Switching on Frontend
- After enabling, you can switch frontend site templates by visiting:
https://yourdomain/?theme=templateID. Template ID can be found in Backend - Appearance - Template Management page. - Design purpose: Convenient for developers to demonstrate multiple themes on one site
const SWITCH_TEMPLATE = true;
Complete Configuration Reference
<?php
// Database address, usually localhost or specified port localhost:3306
const DB_HOST = 'localhost';
// Database username
const DB_USER = 'emlog';
// Database user password
const DB_PASSWD = '12345678';
// Database name
const DB_NAME = 'emlog';
// Database table prefix, used to distinguish different tables when installing multiple Emlog instances in the same database.
const DB_PREFIX = 'emlog_';
// Auth key
const AUTH_KEY = 'xxxxxxx';
// Cookie name
const AUTH_COOKIE_NAME = 'xxxxxx';
// Hide admin backend login page
const ADMIN_PATH_CODE = 'abcd';
// Disable manual upload installation of applications in backend
const APP_UPLOAD_FORBID = true;
// Enable developer mode
const ENVIRONMENT = 'develop';
// Maximum file upload size for administrators (including content editors), Unit: KB
const UPLOAD_MAX_SIZE = 1024000;
// File type restrictions for administrator uploads (including content editors)
const UPLOAD_ATT_TYPE = 'rar,zip,gif,jpg,jpeg,png,webp,txt,pdf,docx,doc,xls,xlsx,mp4,mp3';
// Use PDO to connect to database
const USE_MYSQL_PDO = true;
// Use relative paths for uploaded images and files
const UPLOAD_PATH_RELATIVE = true;
// Disable article auto-save
const ARTICLE_AUTOSAVE_OFF = true;
// Enable dynamic theme switching on frontend
const SWITCH_TEMPLATE = true;