clue/framework-x
Composer 安装命令:
composer require clue/framework-x
包简介
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.
README 文档
README
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.
Support us
We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by becoming a sponsor on GitHub. Sponsors get numerous benefits in return, see our sponsoring page for details.
Let's take these projects to the next level together! 🚀
Quickstart
Start by creating an empty project directory.
Next, we can start by taking a look at a simple example application.
You can use this example to get started by creating a new public/ directory with
an index.php file inside:
<?php require __DIR__ . '/../vendor/autoload.php'; $app = new FrameworkX\App(); $app->get('/', function () { return React\Http\Message\Response::plaintext( "Hello wörld!\n" ); }); $app->get('/users/{name}', function (Psr\Http\Message\ServerRequestInterface $request) { return React\Http\Message\Response::plaintext( "Hello " . $request->getAttribute('name') . "!\n" ); }); $app->run();
Next, we need to install X and its dependencies to actually run this project. In your project directory, simply run the following command:
$ composer require clue/framework-x:^0.17
See also the CHANGELOG for details about version upgrades.
That's it already! The next step is now to serve this web application. One of the nice properties of this project is that is works both behind traditional web server setups as well as in a stand-alone environment.
For example, you can run the above example using the built-in web server like this:
$ php public/index.php
You can now use your favorite web browser or command line tool to check your web application responds as expected:
$ curl http://localhost:8080/
Hello wörld!
Documentation
Hooked? See website for full documentation.
Found a typo or want to contribute? The website documentation is built from the source documentation files in the docs/ folder.
Contribute
You want to contribute to the Framework X source code or documentation? You've come to the right place!
To contribute to the source code just locate the src/ folder and you'll find all content in there. Additionally, our tests/ folder contains all our unit tests and acceptance tests to assure our code works as expected. For more information on how to run the test suite check out our testing chapter.
If you want to contribute to the documentation of Framework X
found on the website, take a look inside the docs/ folder. You'll find further
instructions inside the README.md in there.
Found a typo on our website? Simply go to our
website repository
and follow the instructions found in the README.
Tests
To run the test suite, you first need to clone this repo and then install all dependencies through Composer:
$ composer install
To run the test suite, go to the project root and run:
$ vendor/bin/phpunit
The test suite is set up to always ensure 100% code coverage across all supported environments. If you have the Xdebug extension installed, you can also generate a code coverage report locally like this:
$ XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text
Additionally, you can run our sophisticated integration tests to verify the framework examples work as expected behind your web server. Use your web server of choice (see deployment documentation) and execute the tests with the URL to your installation like this:
$ php tests/integration/public/index.php $ tests/integration.bash http://localhost:8080/
On top of this, we use PHPStan on max level to ensure type safety across the project:
$ vendor/bin/phpstan
License
This project is released under the permissive MIT license.
Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.
clue/framework-x 适用场景与选型建议
clue/framework-x 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 744.97k 次下载、GitHub Stars 达 938, 最近一次更新时间为 2021 年 11 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「microframework」 「http」 「web」 「micro」 「async」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 clue/framework-x 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 clue/framework-x 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 clue/framework-x 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
repository php library
A lightweight, secure-by-default PHP microframework built on Slim – providing Laravel-like features (ORM, authentication, migrations, caching) without the bloat. Perfect for building REST APIs and small-to-medium PHP applications.
http客户端
Easily add Excepct-CT header to your project
Build mini web servers in PHP for testing
统计信息
- 总下载量: 744.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 938
- 点击次数: 26
- 依赖项目数: 12
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-23