Files
FamilyBook/config.example.php
T
laoyang ecafa110f2 阶段 0 起步:图标与环境自检脚手架
- assets/icons 全套图标:SVG 源文件 + maskable + 12 档 PNG
- favicon.ico / apple-touch-icon.png / site.webmanifest
- index.php 环境自检页(PHP 版本 / 必需扩展 / 配置 / 数据库连接),
  详情页默认不打印连接错误原文,避免泄露数据库账号名
- config.example.php:数据库与 app_key 的配置模板(config.php 不入库)
- README 补充项目定位与六阶段路线图;.gitignore 沿用既有约定
2026-09-29 23:48:45 +08:00

42 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* FamilyBook · 家书 —— 本地配置模板
*
* 使用:复制为 config.php,按注释填写。
* config.php 已在 .gitignore 中忽略,不会进 Git —— 换机器、换库都靠它。
*
* ⚠️ 仓库是公开的:这里不许出现真实域名、真实口令、真实密钥。
*/
declare(strict_types=1);
return [
// ---------------- 站点 ----------------
'site_name' => '家书',
// 站点对外根地址,末尾不要带斜杠。示例值,请替换成你自己的
'base_url' => 'https://example.com',
// ---------------- 数据库(MySQL)----------------
'db' => [
'host' => '127.0.0.1',
'port' => 3306,
'name' => 'familybook',
'user' => 'familybook',
'pass' => '',
'charset' => 'utf8mb4',
],
// ---------------- 敏感字段加密密钥 ----------------
// 用于身份证号、手机号的对称加密(openssl AES-256-CBC)。
// ⚠️ 开始记录数据之后这个值就不能再改:换掉它,已有数据就解不开了。
// ⚠️ 请单独备份它。密钥丢失 = 数据永久丢失,比数据库丢了还严重。
// 生成方式:openssl rand -hex 16
'app_key' => '请填写32位随机十六进制串',
// ---------------- 调试 ----------------
// true 时引导页会打印数据库连接错误的详情。
// ⚠️ 线上务必保持 false —— 错误详情里可能带数据库账号名。
'debug' => false,
];