matthewlefevre/ken-framework
Composer 安装命令:
composer require matthewlefevre/ken-framework
包简介
Ken is a backend rest api framework for single page applications.
README 文档
README
Ken Framework
Ken is a simple PHP framework adapted to create custom REST API's. Ken provides a simple way to create secure API endpoints and the space needed to build out business logic in a scalable way. This Framework is still in a rapid development stage and we have not created a base stable version as of yet.
Table of Contents
Installation
Official installation is through composer.
composer require matthewlefevre/Ken-Framework
Usage
Use Ken Framework to create rest applications with php. The following steps can be followed to get started quickly.
Setup
- Create an api.php file that follows the pattern in
api.php.example
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php'; /** * Sample Server File * * This outlines the general structure of the * server file. */ use KenFramework\Ken; // CSRF (cross-site request forgery) vulnerability // due to serving spa's on seprate local server for // development. Remove headers before launching // product header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"); header("Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS"); // Always returns JSON to the client header("Content-Type: application/json"); // Instantiate app $app = new Ken(); $app->start();
- Require vlucas/phpdotenv package to manage global variables ken uses
composer require vlucal/phpdotenv
- Create .env file with the following attributes after the manner of .env.example
KEN_SECRET=""
KEN_DB=""
KEN_DB_USER=""
KEN_DB_PASSWORD=""
KEN_SERVER=""
- Ensure that you have phpMyAdmin installed and configured in your local enviornment. The built in model class is only compatable with mySQL.
- Create a new database
- Fill in the correct enviornment variables
- If you have XAMPP installed either require composer into your htdocs folder. If you don't have XAMPP installed or do not want to run the server on localhost be sure to create virtual hosts on your operating system and in your apache server configuration.
Contributing
Pull requests are welcome!
License
Take a look at the LICENSE.md
matthewlefevre/ken-framework 适用场景与选型建议
matthewlefevre/ken-framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 matthewlefevre/ken-framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 matthewlefevre/ken-framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-13
