通过 1 个月的开发,QueryPHP v1.0.0-beta.1 版本能够发布了,这也是 beta 3 个版本的开始部分。这个版本的主要是代码解耦和性能提高,文档开发。php
QueryPHP 是一款现代化的高性能 PHP 7 常驻框架,以工程师用户体验为历史使命,让每个 PHP 应用都有一个好框架。html
百分之百单元测试覆盖直面 Bug 一剑封喉,基于 Zephir 实现框架常驻,依托 Swoole 生态实现业务常驻,此刻将来逐步渐进。 咱们的愿景是 USE LEEVEL WITH SWOOLE DO BETTER, 让您的业务撑起更多的用户服务。git
PHP 的函数式特性已经逐步被纯对象所取代,函数库不少时候被包装为静态类,不少时候其实不须要一个类,为此 QueryPHP 底层框架提供了全局函数 fn 来实现了惰性加载。github
<?php declare(strict_types=1); fn('Leevel\\Support\\Str\\rand_num', 5);
精简框架自身助手函数库json
仅仅提供 4 个助手函数就彻底知足了系统的库函数的加载使用。架构
https://github.com/hunzhiwang...app
fn('Leevel\\Support\\Str\\rand_num', 5); hl('dump', 1, 2); app('request'); __('国际化');
例子函数composer
<?php declare(strict_types=1); namespace Leevel\Support\Str; /** * 随机数字. * * @param int $length * @param string $charBox * * @return string */ function rand_num(int $length, ?string $charBox = null): string { if (!$length) { return ''; } if (null === $charBox) { $charBox = '0123456789'; } return rand_str($length, $charBox); } // @codeCoverageIgnoreStart if (!function_exists('Leevel\\Support\\Str\\rand_str')) { include __DIR__.'/rand_str.php'; } // @codeCoverageIgnoreEnd
最开始采用的 Laravel 的继承一个基础的 Facade,方便单元测试,有必定性能损失。后来以为在作单元测试只须要清空容器注册的服务就能够因此优化了一版本。框架
<?php declare(strict_types=1); namespace Leevel\Encryption\Facade; use Leevel\Leevel\App; /** * 门面 encryption. * * @author Xiangmin Liu <635750556@qq.com> * * @since 2017.06.10 * * @version 1.0 */ class Encryption { /** * call. * * @param string $method * @param array $args * * @return mixed */ public static function __callStatic(string $method, array $args) { return App::singletons() ->make('encryption') ->{$method}(...$args); } }
系统新增了 20 个新的文档,后续会逐渐丰富起来。函数
https://www.queryphp.com/docs/
QueryPHP 实现了一套基于而且优化了 composer 的自动加载,而且屏蔽了助手函数的载入。
此次提供了白名单来让你选择部分函数的载入。
/** * --------------------------------------------------------------- * Composer * ---------------------------------------------------------------. * * 用于管理 PHP 依赖包 * 优化 composer 性能,提炼 composer 中的 autoload_static 中的咱们关注的 psr4 命名空间映射 * 咱们 classmap 须要经过 `php leevel autoload` 生成,包含命令 `composer dump-autoload -o` * 对于助手函数须要本身引入 */ $autoloadLeevel = __DIR__.'/../vendor/autoloadLeevel.php'; if (is_file($autoloadLeevel)) { $composer = require $autoloadLeevel; } else { $composer = require __DIR__.'/../vendor/autoload.php'; }
composer.json 部分代码
{ "name": "hunzhiwange/queryphp", "description": "The QueryPHP Application.", "require": { "php": "^7.3.2", "hunzhiwange/framework": "dev-master" }, "extra": { "leevel-console" : { "autoload": { "@namespaces": "The white of Psr4", "namespaces": [ "Leevel", "Dotenv", "Carbon", "Monolog", "Whoops", "Swagger" ], "@files": "The white of autoload files", "files": [ "common/Infra/functions.php", "hunzhiwange/framework/src/Leevel/Leevel/functions.php" ] } } } }
正在尝试更好地代码实现领域驱动设计分层架构。
https://github.com/hunzhiwang...
锁定 doctrine/annotations ~1.6.0 和 zendframework/zend-diactoros ^2.1.1 减小兼容性问题和修复用户安装报错的问题,持续集成系统在 composer 最低依赖情况下不会出错。
https://github.com/hunzhiwang...
QueryPHP 是在 2016 年 10 月开始基于一个我早年的 PHP 框架 DoYouHaoBaby 框架开发的。这个早年的框架是我在 2010 年 7.8 月开始的,那个时候在大二,开始的框架也主要用于自用。早年基于这个框架的一些应用做品以下:
DYHB.BLOG_X
DYHB.BLOG_X-2.0详细安装图文教程 http://www.knowsky.com/804758...
http://www.downcode.com/downc...
https://github.com/hunzhiwang...
WindsForce 社区
http://www.mycodes.net/code_p...
https://github.com/hunzhiwang...
https://www.oschina.net/p/win...
目前 QueryPHP 由本人一人负责开发,文档,logo 设计,视频,官网和宣传须要大量精力。
若是你以为能够,能够推荐朋友来试用一下,关注一哈,但愿吸引到有兴趣的一块儿开发,文档,。
用 10 年打造一个完美的做品,2010-present Xiangmin Liu。