_____________ _______________
______/ \__ _____ ____ ______ / /_ _________
____/ __ / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
__/ / / / /_/ / __/ / \ / /_/ / / / / /_/ /__
\_\ \_/\____/\___/_/ / / .___/_/ /_/ .___/
\_\ /_/_/ /_/
composer create-project hunzhiwange/queryphp myapp
php leevel server <Visite http://127.0.0.1:9527/>
CREATE DATABASE IF NOT EXISTS myapp DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
vim .env
...
// Database
DATABASE_DRIVER = mysql
DATABASE_HOST = 127.0.0.1
DATABASE_PORT = 3306
DATABASE_NAME = queryphp_development_db
DATABASE_USER = root
DATABASE_PASSWORD =
...
to
...
// Database
DATABASE_DRIVER = mysql
DATABASE_HOST = 127.0.0.1
DATABASE_PORT = 3306
DATABASE_NAME = myapp
DATABASE_USER = root
DATABASE_PASSWORD = 123456
...
- $php leevel migrate:migrate
+ $composer migrate
$php leevel server
http://127.0.0.1:9527/api/entity
{
count: 4,
:trace: {
...
}
}
Frontend project https://github.com/hunzhiwange/queryvue。
First to install the frontend,see more detail on README.md
.
cd cd data/codes/queryvue/
npm install -g cnpm --registry=https://registry.npm.taobao.org // Just once
cnpm install
npm run serve # npm run dev
Then visite it. http://127.0.0.1:9528/#/login
user: admin
password: 123456
CREATE DATABASE IF NOT EXISTS test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
vim .env.phpunit
...
// Database
DATABASE_DRIVER = mysql
DATABASE_HOST = 127.0.0.1
DATABASE_PORT = 3306
DATABASE_NAME = test
DATABASE_USER = root
DATABASE_PASSWORD =
...
to
...
// Database
DATABASE_DRIVER = mysql
DATABASE_HOST = 127.0.0.1
DATABASE_PORT = 3306
DATABASE_NAME = test
DATABASE_USER = root
DATABASE_PASSWORD = 123456
...
- $php leevel migrate:migrate -e env.phpunit
+ $composer migrate-phpunit
$cd /data/codes/queryphp/
$vim .env.phpunit # modify database redis and other
- $php leevel migrate:migrate -e env.phpunit
+ $composer migrate-phpunit
+ $php assets/build/phpunit
+ $composer test
+ $composer test-coverage
Modify .env or bootstrap/config.php.
// Environment production、testing and development
ENVIRONMENT = production
// Debug
DEBUG = false
DEBUG_JSON = false
DEBUG_CONSOLE = false
DEBUG_JAVASCRIPT = false
The commands below can make queryphp faster.
php leevel router:cache
php leevel config:cache
php leevel i18n:cache
php leevel view:cache
php leevel autoload (Equivalent to `composer dump-autoload --optimize --no-dev`)
Or
php leevel production
Modify .env or bootstrap/config.php.
// Environment production、testing and development
ENVIRONMENT = development
// Debug
DEBUG = true
DEBUG_JSON = true
DEBUG_CONSOLE = true
DEBUG_JAVASCRIPT = true
php leevel i18n:clear
php leevel log:clear
php leevel config:clear
php leevel router:clear
php leevel session:clear
php leevel view:clear
php leevel autoload --dev (Equivalent to `composer dump-autoload --optimize`)
Or
php leevel development
RoadRunner is an open source high-performance PHP application server, load balancer and process manager. It supports running as a service with the ability to extend its functionality on a per-project basis.
You can download the binary file.
cd /data/server
wget https://github.com/spiral/roadrunner/releases/download/2.12.1/roadrunner-1.8.2-darwin-amd64.zip
unzip roadrunner-2.12.1-darwin-amd64.zip
cd /data/codes/queryphp
Install dependency package
composer require spiral/roadrunner ^2.12.1
composer require spiral/dumper ^2.14.1.
composer require symfony/psr-http-message-bridge ^2.0
composer require nyholm/psr7 ^1.5
/data/server/roadrunner-2.12.1-darwin-amd64/rr serve
/data/server/roadrunner-2.12.1-darwin-amd64/rr http:reset
The same with php-fpm
root@vagrant-ubuntu-10-0-2-5:/data/codes/queryphp# /data/server/roadrunner-2.12.1-darwin-amd64/rr serve
2022-12-10T16:43:30.226+0800 DEBUG rpc plugin was started {"address": "tcp://127.0.0.1:6001", "list of the plugins with RPC methods:": ["app", "informer", "resetter"]}
[INFO] RoadRunner server started; version: 2.12.1, buildtime: 2022-12-01T12:41:50+0000
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9522, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9525, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9523, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9529, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9528, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9526, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9527, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.524+0800 DEBUG server worker is allocated {"pid": 9524, "internal_event_name": "EventWorkerConstruct"}
2022-12-10T16:43:30.525+0800 DEBUG http http server was started {"address": "0.0.0.0:9527"}
2022-12-10T16:44:08.664+0800 INFO http http log {"status": 200, "method": "GET", "URI": "/", "remote_address": "127.0.0.1:56516", "read_bytes": 0, "write_bytes": 18441, "start": "2022-12-10T16:44:08.644+0800", "elapsed": "19.623241ms"}
https://github.com/friendsofphp/php-cs-fixer
It can be used without installation,we download a version for you.
$cd /data/codes/queryphp
- $php-cs-fixer fix --config=.php_cs.dist
+ $php assets/build/php-cs-fixer fix --config=.php_cs.dist
+ $composer php-cs-fixer
Add a pre-commit for it.
cp assets/build/pre-commit.sh .git/hooks/pre-commit
chmod 777 .git/hooks/pre-commit
Pass hook
# git commit -h
# git commit -n -m 'pass hook' #bypass pre-commit and commit-msg hooks
- $php assets/build/phpstan analyse
+ $composer phpstan
The QueryPHP framework is open-sourced software licensed under the MIT license.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。