通過 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。