ansas/slim-skeleton
Composer 安装命令:
composer require ansas/slim-skeleton
包简介
Slim 3 framework skeleton - skeleton for a web service or an application
README 文档
README
Skeleton for a web service or an application (based on Slim 3 framework).
This skeleton follows several PHP Standards Recommendations (PSR):
- PSR-1 / PSR-2 (Coding standards)
- PSR-3 (Logging) via Monolog
- PSR-4 (Autoloading) via Composer
- PSR-7 (HTTP message) via Slim
Included components
- Slim 3.x incl. Flash messages & Twig view (MIT License)
- Twig template engine 1.x (BSD License)
- Monolog logger 1.x (MIT License)
- Custom Error and NotFound handler
- Middlewares: Cors, ForceRoute, Runtime, NoTrailingSlash, etc.
- Provider: ConsoleLoggerProvider, ExtendedRequestProvider, PdoProvider, ProfilerProvider, etc.
- Tests: PHPUnit bootstrap and AppTestCase prepared
Directory structure
path/to/project
|-- app <- Application config files
| |-- slim <- Slim config files
| `-- twig <- Twig templates
|-- bin <- Own scripts
|-- etc <- Own config files (like Apache)
|-- lib <- Vendor files (for composer)
|-- log <- Log files
|-- pub <- Webserver document root
| |-- css
| |-- img
| |-- js
| `-- lib
|-- src <- Application classes
| `-- App
| |-- Controller
| |-- Handler <- Put custom handlers here
| |-- Middleware <- Put custom middlewares here
| |-- Model
| |-- Provider <- Put custom providers here
| `-- Tests <- Put custom tests (unit and integration tests) here
`-- tmp <- Temporary files
| |-- session
| `-- twig
`-- var <- Put other data in here
Requirements
- PHP 7
- Composer (MIT License)
Usage
Install / Create project
$ composer create-project ansas/slim-skeleton path/to/project
Develop / Run PHP build-in server
$ cd path/to/project
$ composer server
Open web browser with address http://any-domain-pointing-to-server:8888
Call controller from console
$ cd path/to/project $ composer run The\Controller\YouWantToRun <- calls __invoke() $ composer run The\Controller\YouWantToRun:methodWanted $ composer run The\Controller\YouWantToRun:methodWanted parem1=yes param2=hi
Test / Check coding style and test code
$ cd path/to/project $ composer test
Contribute
Everybody can contribute to this package. Just:
- fork it,
- make your changes and
- send a pull request.
Please make sure to follow PSR-1 and PSR-2 coding conventions.
License
MIT license (see the LICENSE file for more information).
ansas/slim-skeleton 适用场景与选型建议
ansas/slim-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ansas/slim-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ansas/slim-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-06