ECJiaWiki:ECJia到家后台配置文件解析
跳到导航
跳到搜索
目录
- 1 注意事项
- 2 .env配置文件
- 3 配置文件
- 3.1 database.php [数据库配置文件]
- 3.2 system.php [系统配置文件]
- 3.3 storage.php [文件系统磁盘组配置参数]
- 3.4 session.php [缓存配置文件]
- 3.5 route.php [路由配置文件]
- 3.6 cache.php [缓存配置文件]
- 3.7 cookie.php [缓存配置文件]
- 3.8 app.php [配置文件]
- 3.9 site.php [站点配置文件]
- 3.10 namespaces.php [命名空间配置文件]
- 3.11 facade.php [配置文件]
- 3.12 upload.php [上传选项配置参数]
- 3.13 queue.php [队列配置文件]
- 3.14 api.php [配置文件]
- 3.15 payment.php [付款配置文件]
注意事项
- 配置文件的 key 全部小写,注意在配置文件的数组Key。
- 子站点的配置文件会继承主站点的配置文件,所以子站点的配置文件只需指定你需要覆盖的配置选项即可。
- 本地环境测试的配置项移至 local 目录,位于 configs/local 位置,命名与主配置文件名称一致。
- 本地环境测试的配置项也继承当前站点的配置,只需指定你需要覆盖的配置选项即可。
- 使用本地环境测试,需要在主站点或者子站点的根目录下放入文件 .env 。
- 使用本地环境测试,.env 文件不需要提交到版本库中 。
.env配置文件
.env 文件的内容如下
- 该文件为隐藏文件,某些系统或者软件可能需要设置“显示隐藏文件”才可以显示、编辑该文件。
默认使用参数
- 程序默认 .env 文件的使用的参数内容如下:
//时区 TIMEZONE=Asia/Shanghai //认证密钥 AUTH_KEY=WQ5Px7Rl2OfNtkxFkDgBNZtsuTuxqDxg //数据库主机 DB_HOST=localhost //数据库端口 DB_PORT=3306 //数据库名称 DB_DATABASE=xxxx //数据库用户 DB_USERNAME=xxxx //数据库密码 DB_PASSWORD=xxxx //数据库前缀 DB_PREFIX=ecjia_
mysql.php [数据库配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
DB_HOST | string | localhost | 主机名或IP地址 |
DB_DATABASE | string | ecjia | 数据库 |
DB_USERNAME | string | ecjia | 数据库用户名 |
DB_PASSWORD | string | 数据库密码 | |
DB_PREFIX | string | ecjia_ | 数据表前缀 |
DB_PORT | string | 3306 | 数据库端口号 |
DB_SOCKET | string | unix_socket | |
REDIS_HOST | string | localhost | 主机名或IP地址 |
REDIS_PASSWORD | string | null | 数据库密码 |
REDIS_PORT | string | 6379 | redis端口号 |
REDIS_DEFAULT_DB | string | 0 | Redis_默认值\u db |
return array (
'mysql' => array(
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'ecjia'),
'username' => env('DB_USERNAME', 'ecjia'),
'password' => env('DB_PASSWORD', ''),
'prefix' => env('DB_PREFIX', 'ecjia_'),
'port' => env('DB_PORT', 3306),
'unix_socket'=> env('DB_SOCKET', ''),
),
'default'=> array(
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DEFAULT_DB', 0),
),
);
touch.php [系统配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
TOUCH_CACHE_DRIVER | string | file | 缓存驱动程序 |
return [
'cache_driver' => env('TOUCH_CACHE_DRIVER', 'file'),
];
system.php [系统配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
TIMEZONE | string | Etc/GMT-8 | 网站时区 |
LOCALE | string | zh_CN | 网站语言包 |
AUTH_KEY | string | UbGuq4G8uqk9yRKHhiRnUbGuq4G8uqk9 | 密钥 |
DEBUG | string | false | 调试开关 |
return array(
//网站时区,Etc/GMT-8 实际表示的是 GMT+8 timezone
'timezone' => env('TIMEZONE', 'Etc/GMT-8'),
//网站语言包
'locale' => env('LOCALE', 'zh_CN'), //zh_CN, en_US, zh_TW
//密钥
'auth_key' => env('AUTH_KEY', 'UbGuq4G8uqk9yRKHhiRnUbGuq4G8uqk9'),
//调试开关
'debug' => env('DEBUG', false),
);
session.php [配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
SESSION_DRIVER | string | mysql | 引擎:files,mysql,memcache,redis |
SESSION_DOMAIN | string | null | Cookie有效域名 |
SESSION_SECURE_COOKIE | string | false | 是否使用https |
return array(
'driver' => env('SESSION_DRIVER', 'mysql'),
'domain' => env('SESSION_DOMAIN', null),
'secure' => env('SESSION_SECURE_COOKIE', false),
);
配置文件
database.php [数据库配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
driver | string | mysql | 数据库 |
charset | string | utf8 | 数据库字符集只支持utf8 |
collation | string | utf8mb4_unicode_ci | 数据表前缀 |
return array(
'mysql' => array(
'driver' => 'mysql',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
),
);
system.php [系统配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
gzip | string | 0 | 是否Gzip压缩后输出 |
admin_entrance | string | admincp | 后台入口 admin_entrance |
admin_enable | string | true | 后台启用开关,默认启用 |
url_rewrite | string | false | URL重写模式 |
url_mode | string | normal | URL模式(normal:普通模式 pathinfo:PATHINFO模式 cli:命令行模式) |
tpl_force_specify | string | false | 模版强制自定义风格 |
tpl_style | string | default | 风格 |
tpl_message | string | showmessage.dwt.php | 信息提示模板 |
tpl_usedfront | string | false | 前台模板是否使用front模式 |
return array(
//是否Gzip压缩后输出
'gzip' => 0,
'admin_entrance' => 'admincp',
'admin_enable' => true,
//URL重写模式
'url_rewrite' => false,
//URL模式(normal:普通模式 pathinfo:PATHINFO模式 cli:命令行模式)
'url_mode' => 'normal',
'tpl_force_specify' => false,
//风格
'tpl_style' => 'default',
// 信息提示模板
'tpl_message' => 'showmessage.dwt.php',
'tpl_usedfront' => false,
);
storage.php [文件系统磁盘组配置参数]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
driver | string | local | 磁盘位置 |
root | string | SITE_UPLOAD_PATH | 文件系统根目录 |
url | string | SITE_UPLOAD_URL | 地址 |
driver | string | aliyunoss | 信息位置 |
key | string | 阿里云OSS访问AccessKeyId | |
secret | string | 阿里云OSS访问AccessKeySecret | |
bucket | string | 阿里云OSS访问Bucket | |
server | string | http://oss-cn-hangzhou.aliyuncs.com | 阿里云OSS访问外网地址,类似http://oss-cn-hangzhou.aliyuncs.com |
server_internal | string | http://oss-cn-hangzhou.aliyuncs.com | 阿里云OSS访问内网地址,类似http://oss-cn-hangzhou.aliyuncs.com |
is_internal | string | false | 阿里云OSS是否启用内网访问 |
return array(
'disks' => array(
'local' => array(
'driver' => 'local',
'root' => SITE_UPLOAD_PATH,
'url' => SITE_UPLOAD_URL,
),
'aliyunoss' => array(
'driver' => 'aliyunoss',
'key' => '',
'secret' => '',
'bucket' => '',
'server' => 'http://oss-cn-hangzhou.aliyuncs.com',
'server_internal' => 'http://oss-cn-hangzhou.aliyuncs.com',
'is_internal' => false,
),
),
);
session.php [缓存配置文件]
无法使用Cookie的 Secure 标记。配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
table | string | session | 表名 |
session_name | string | ecjia_token | 会话名称 |
session_admin_name | string | ecjia_admin_token | 会话管理员名称 |
lifetime | string | 43200 | 有效时间(秒) |
httponly | string | true | 他们只能发送给服务端,如果包含服务端 Session信息的Cookie 不想被客户端JavaScript脚本调用,那么就设置 HttpOnly 标记。 |
return array(
'table' => 'session',
'session_name' => 'ecjia_token',
'session_admin_name' => 'ecjia_admin_token',
'lifetime' => 43200,
'httponly' => true,
);
route.php [路由配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
m | string | main | 模块 |
c | string | index | 控制器 |
a | string | init | 方法 |
return array(
'default' => array(
'm' => 'main',
'c' => 'index',
'a' => 'init'
),
);
cache.php [缓存配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
prefix | string | cityo2o | 前缀 |
return [
'prefix' => 'cityo2o',
];
cookie.php [缓存配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
lifetime | int | 43200 | Cookie有效期 |
domain | string | null | Cookie有效域名 |
path | string | / | Cookie路径 |
return array(
// Cookie有效期
'lifetime' => 43200,
// Cookie有效域名
'domain' => null,
// Cookie路径
'path' => '/',
);
app.php [配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
adsense | string | adsense | 广告管理 |
affiliate | string | affiliate | 推荐分成 |
api | string | api | api |
article | string | article | 文章 |
agent | string | agent | 区域代理 |
bonus | string | bonus | 红包 |
captcha | string | captcha | 验证码 |
cart | string | cart | 购物车 |
comment | string | comment | 评论 |
commission | string | commission | 结算 |
connect | string | connect | 帐号连接 |
cron | string | cron | 计划任务 |
express | string | express | 配送中心 |
favourable | string | favourable | 优惠活动 |
finance | string | finance | 财务 |
franchisee | string | franchisee | 商家入驻 |
return array(
/*广告管理*/
'adsense' => 'adsense',
/* 推荐分成 */
'affiliate' => 'affiliate',
/* api */
'api' => 'api',
/* 文章 */
'article' => 'article',
/* 区域代理 */
'agent' => 'agent',
/* 红包 */
'bonus' => 'bonus',
/* 验证码 */
'captcha' => 'captcha',
/* 购物车 */
'cart' => 'cart',
/* 评论 */
'comment' => 'comment',
/* 结算 */
'commission' => 'commission',
/* 帐号连接 */
'connect' => 'connect',
/* 计划任务 */
'cron' => 'cron',
/* 配送中心 */
'express' => 'express',
/* 优惠活动 */
'favourable' => 'favourable',
/* 财务 */
'finance' => 'finance',
/* 商家入驻 */
'franchisee' => 'franchisee',
);
site.php [站点配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
shop_type | string | cityo2o | 商店类型 |
site_name | string | EC+到家 | 网站名称 |
store_delete_enabled | string | false | 是否启用店铺删除 |
return array(
'shop_type' => 'cityo2o',
'site_name' => 'EC+到家',
//是否启用店铺删除
'store_delete_enabled'=> false,
);
namespaces.php [命名空间配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
Ecjia\System | string | /system/classes | 系统 |
Ecjia\App\Adsense | string | /apps/adsense/classes | adsense |
Ecjia\App\Affiliate | string | /apps/affiliate/classes | affiliate |
Ecjia\App\Api | string | /apps/api/classes | api |
Ecjia\App\Article | string | /apps/article/classes | 文章 |
Ecjia\App\Attach | string | /apps/attach/classes | attach |
Ecjia\App\Agent | string | /apps/agent/classes | 代理人 |
Ecjia\App\Bonus | string | /apps/bonus/classes | 奖金 |
return array(
'Ecjia\System' => $contentDir . '/system/classes',
'Ecjia\App\Adsense' => $contentDir . '/apps/adsense/classes',
'Ecjia\App\Affiliate' => $contentDir . '/apps/affiliate/classes',
'Ecjia\App\Api' => $contentDir . '/apps/api/classes',
'Ecjia\App\Article' => $contentDir . '/apps/article/classes',
'Ecjia\App\Attach' => $contentDir . '/apps/attach/classes',
'Ecjia\App\Agent' => $contentDir . '/apps/agent/classes',
'Ecjia\App\Bonus' => $contentDir . '/apps/bonus/classes',
);
facade.php [配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
RC_Pay | string | Royalcms\Component\Pay\Facades\Pay | 外观 |
RC_Redis | string | Royalcms\Component\Redis\Facades\Redis | Redis |
RC_WeChat | string | Royalcms\Component\WeChat\Facades\WeChat | 微信 |
RC_Storage | string | Royalcms\Component\Storage\Facades\Storage | 保管部 |
RC_Image | string | Royalcms\Component\Image\Facades\Image | 图片 |
RC_Upload | string | Royalcms\Component\Upload\Facades\Upload | 上传 |
RC_Purifier | string | Royalcms\Component\Purifier\Facades\Purifier | 防XSS过滤 |
return array(
'RC_Pay' => 'Royalcms\Component\Pay\Facades\Pay',
'RC_Redis' => 'Royalcms\Component\Redis\Facades\Redis',
'RC_WeChat' => 'Royalcms\Component\WeChat\Facades\WeChat',
'RC_Storage' => 'Royalcms\Component\Storage\Facades\Storage',
'RC_Image' => 'Royalcms\Component\Image\Facades\Image',
'RC_Upload' => 'Royalcms\Component\Upload\Facades\Upload',
'RC_Purifier'=> 'Royalcms\Component\Purifier\Facades\Purifier',
);
upload.php [上传选项配置参数]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
path | string | main | 附件本地保存相对位置,相对于上传目录的位置 |
url_path | string | 空 | 附件访问url |
use_yearmonth_folders | string | false | 上传使用年/月文件夹 |
max_size | string | 2097152 | 允许上传大小限制Bytes 2M |
default_file_types | string | rar,zip,txt,pdf,doc,docx,xls,ppt,jpg,jpeg,png,gif | 允许上传的文件类型(不包含图片扩展) |
示例
return array(
'path' => '',
'url_path' => '',
'use_yearmonth_folders' => false,
'max_size' => '2097152',
//默认上传文件类型
'default_file_types' => array(
'rar' => 'application/x-rar-compressed',
'zip' => 'application/zip',
'txt' => 'text/plain',
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'jpg' => 'image/jpg',
'jpeg' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/x-png',
'bmp' => 'image/pjpeg',
),
);
queue.php [队列配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
driver | string | sync | 同步 |
driver | string | database | 同步 |
table | string | jobs | 数据表 |
queue | string | default | 数据同步 |
expire | int | 60 | 到期时间 |
driver | string | sqs | 同步 |
key | string | your-public-key | 公钥 |
secret | string | your-secret-key | 密钥 |
queue | string | your-queue-url | 队列URL |
region | string | us-east-1 | 区域 |
driver | string | redis | redis |
queue | string | default | 队列 |
expire | int | 60 | 到期时间 |
return (
'sync' =>(
'driver' => 'sync',
),
'database' =>(
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
),
'sqs' =>(
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'queue' => 'your-queue-url',
'region' => 'us-east-1',
),
'redis' => (
'driver' => 'redis',
'queue' => 'default',
'expire' => 60,
),
);
api.php [配置文件]
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
address/add | string | user::address/add | 添加地址 |
address/delete | string | user::address/delete | 删除地址 |
address/info | string | user::address/info_ | 地址具体信息 |
address/list | string | user::address/list | 地址列表 |
address/setDefault | string | user::address/setDefault_ | 默认地址 |
address/update | string | user::address/update | 地址修改 |
cart/create | string | cart::cart/create | 添加购物车 |
cart/delete | string | cart::cart/delete | 删除购物车 |
cart/list | string | cart::cart/list | 购物车列表 |
cart/update | string | cart::cart/update | 购物车修改 |
cart/buyagain | string | cart::cart/buyagain | 购物车更新 |
flow/checkOrder | string | cart::flow/checkOrder | 确认订单 |
flow/done | string | cart::flow/done | 确认订单完成 |
return array(
//address
'address/add' => 'user::address/add',
'address/delete' => 'user::address/delete',
'address/info' => 'user::address/info',
'address/list' => 'user::address/list',
'address/setDefault' => 'user::address/setDefault',
'address/update' => 'user::address/update',
//cart
'cart/create' => 'cart::cart/create',
'cart/delete' => 'cart::cart/delete',
'cart/list' => 'cart::cart/list',
'cart/update' => 'cart::cart/update',
'cart/buyagain' => 'cart::cart/buyagain',
'flow/checkOrder' => 'cart::flow/checkOrder',
'flow/done' => 'cart::flow/done',
);
payment.php [付款配置文件]
配置项 | 默认值 | 描述 |
---|---|---|
pay_balance | string | 支付余额 |
pay_cod | string | 货到付款 |
pay_alipay | string | 支付宝付费 |
pay_wxpay | string | 微信付费 |
pay_payease | string | 支付 |
return array(
'ecjia-cityo2o-h5' => array(
'pay_balance',
'pay_cod',
'pay_alipay',
'pay_wxpay',
'pay_payease',
),
);