{"id":21365310,"url":"https://github.com/zhaotoday/rich-app","last_synced_at":"2026-04-16T01:32:54.128Z","repository":{"id":83249494,"uuid":"82032377","full_name":"zhaotoday/rich-app","owner":"zhaotoday","description":"A light PHP framework based on CodeIgniter. 一套基于 CodeIgniter 的轻量级 PHP MVC 框架，用于团队快速开发 CMS、商城和 RESTful API 服务。","archived":false,"fork":false,"pushed_at":"2017-07-16T14:28:28.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T09:31:08.318Z","etag":null,"topics":["cms","codeigniter","mvc","php","restful"],"latest_commit_sha":null,"homepage":"http://www.richapp.cn/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhaotoday.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T07:27:02.000Z","updated_at":"2017-11-03T10:59:12.000Z","dependencies_parsed_at":"2023-03-12T17:44:41.604Z","dependency_job_id":null,"html_url":"https://github.com/zhaotoday/rich-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhaotoday/rich-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaotoday%2Frich-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaotoday%2Frich-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaotoday%2Frich-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaotoday%2Frich-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhaotoday","download_url":"https://codeload.github.com/zhaotoday/rich-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaotoday%2Frich-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31867710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","codeigniter","mvc","php","restful"],"created_at":"2024-11-22T07:10:29.468Z","updated_at":"2026-04-16T01:32:54.117Z","avatar_url":"https://github.com/zhaotoday.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## 介绍\nPHP rich app 是一套基于 CodeIgniter 的轻量级 PHP MVC 框架，用于团队快速开发 CMS、商城和 RESTful API 服务。参照已有模块规范创建数据库表，编写模型、控制器和视图，就可以轻松扩展一个业务模块。\n\n## 项目地址\n出于安全考虑，本项目不开源，仅团队开发人员可见。地址：https://git.oschina.net/zhaojintian/rich-app 。\n\n## 官网\n- https://www.richapp.cn/\n\n## 案例\n- https://www.zjt.me/\n\n## 相关\n- [CodeIgniter 中国](http://codeigniter.org.cn/)\n- [CodeIgniter GitHub](https://github.com/bcit-ci/CodeIgniter)\n- [codeigniter-restserver](https://github.com/chriskacerguis/codeigniter-restserver)\n- [简易的 RESTful API 规范](https://github.com/zhaotoday/rest-api-guide)\n- [codeigniter3-translations](https://github.com/bcit-ci/codeigniter3-translations)\n\n## 下载代码\n```\ngit clone https://git.oschina.net/zhaojintian/rich-app.git\n```\n\n## 业务模块\n- 分类（categories）\n- 标签（tags）\n- 评论（comments）\n- 文章（articles）\n- 文件（files）\n- 商铺（shops）\n- 商品（products）\n- 订单（orders）\n- 岗位（jobs）\n- 会员（users）\n- 设置（settings）\n- 管理员（managers）\n- 滚动广告（sliders）\n\n## Redis 缓存\n框架采用 Redis 来减轻数据库访问压力，如果当前服务器的 PHP 环境未安装 Redis 扩展，则不启用 Redis。注意，如果访问页面响应时间较长，请检查服务器是否已启动 Redis 服务。\n\n## 移动端检测\n在 Front_Controller 的构造方法中调用 detect(); 可识别当前访问是否是来自移动端，并做相应跳转。\n\n## 访问图片文件\n```\nGET /images/1              [访问 ID 为 1 的图片]\nGET /images/1?w=200\u0026h=300  [访问 ID 为 1 的图片，并按高度 200px、宽度 300px 等比缩放]\n```\n\n## 配置\n修改 application/config/constants.php。\n\n#### 静态文件 CDN 域名\n为空时，启用当前网站域名，建议可以用七牛存储静态文件，如配置为：http://cncdn.cn/{domain}.cn 。\n```php\ndefine('CDN', '');\n```\n\n#### 静态文件版本号\n静态文件变更时，需修改此配置，以清除浏览器缓存。\n```php\ndefine('STATIC_VERSION', 'v1.1');\n```\n\n#### Redis\n配置是否启用 Redis、Redis 主机、端口、过期时间等。\n```php\ndefine('REDIS', [\n  'ENABLED' =\u003e TRUE,\n  'EXPIRE' =\u003e 60,\n  'HOST' =\u003e '127.0.0.1',\n  'PORT' =\u003e '6379',\n]);\n```\n\n## 数据库\ncategories 为可选的通用分类表，每个业务模块都可以引用，用 model 字段来区分业务模块。  \n数据库通用字段：\n```\nid         [自增 ID]\nlanguage   [国际化语言标识]\ncreated_at [发布时间]\nupdated_at [更新时间]\n```\n\n## RESTful API 服务\n如果接口需要鉴权，请在方法开头添加代码：\n```php\nif (!$this-\u003e_valid()) {\n  $this-\u003e_responseValidError();\n} else {\n  // do something.\n}\n```\n\n## 表单校验\n数据入库前，需校验合法性。  \n#### 加载校验类  \n```php\n$this-\u003eload-\u003elibrary('Validator', NULL, 'validator');\n```\n\n#### 中文\n```php\n$this-\u003evalidator-\u003eisChinese($test);\n```\n\n#### 邮箱\n```php\n$this-\u003evalidator-\u003eisEmail($test);\n```\n\n#### 身份证\n```php\n$this-\u003evalidator-\u003eisIDCard($test);\n```\n\n#### 手机\n```php\n$this-\u003evalidator-\u003eisMobilePhone($test);\n```\n\n#### 电话\n```php\n$this-\u003evalidator-\u003eisTelephone($test);\n```\n#### IP\n```php\n$this-\u003evalidator-\u003eisIP($test);\n```\n\n#### 邮编\n```php\n$this-\u003evalidator-\u003eisPostcode($test);\n```\n\n#### 长度不能小于\n```php\n$this-\u003evalidator-\u003emin($test, $length);\n```\n\n#### 长度不能大于\n```php\n$this-\u003evalidator-\u003emax($test, $length);\n```\n\n## 业务模块目录规范\n以下以 Articles 模块为例。\n\n#### 模型\n```\napplication/models/Articles_Model.php\n```\n\n#### 前台控制器\n```\napplication/controllers/Articles.php\n```\n\n#### API 控制器\n```\napplication/controllers/apis/Articles.php\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaotoday%2Frich-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhaotoday%2Frich-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaotoday%2Frich-app/lists"}