irpcpro/testcrud
Composer 安装命令:
composer create-project irpcpro/testcrud
包简介
A project to management Products and Orders
README 文档
README
Version: 1.0.1
A project for managing Products & Orders with JWT authentication
+ Installation
Install this project via Composer:
composer create-project irpcpro/testcrud
+ Requirements
- PHP:
^8.1 - mongodb/laravel-mongodb:
^4.3 - tymon/jwt-auth:
^2.1 - Redis Driver (windows):
v4.2.1 - MongoDB (windows):
7.2.5
+ MongoDB Installation & Configuration
installing MongoDB
- first you need to install the
MongoDB 7.2.5for windows. - after installing, you have to insert your DB connection to the
.envfile. to connect the project to the database.
Download MongoDB Extension .dll file
- next step, you have to install the Ext of the MongoDB for PHP and enable it through the
php.inifile. - for downloading, go to the packages PHP official website, and base on your windows, download the version of the
.dllwhich is compatible with your windows and the PHP version which is installed on your PC. - MongoDB PHP Package (https://pecl.php.net/package/mongodb)
Install the extension
- 1- go to your PHP folders where you've installed. (for finding the path of the PHP file, execute this command on CommandPrompt:
where php) - go to this path and copy the
php_mongodb.dll
{drive}:\php\php-{version}\ext
- next step, you have to add the extension name to
php.inifile. go to this path and open thephp.inifile withnotepad:
{drive}:\php\php-{version}\
- in the part of the
Dynamic Extensions(you can search it) add this command and save the file and restart your PHP server
..
..
extension=mongodb
- you can check in the terminal to see if it is installed. open your CommandPrompt and run this command :
> php -m | find "mongo"
- the output should be
mongodb - or just execute this code via PHP :
<?php echo phpinfo(); ?>
config Replica Set and run the database
- first open the
CommandPromptas administrator and run this command to start the Replica Set
mongod --dbpath "C:\data\db" --logpath "C:\data\log\mongod.log" --replSet "rs0"
- now, open another
CommandPromptas administrator and run this command to enter to the MongoDB environment
mongo
- now you can initiate the Replica and see the status of this with these two commands:
> rs.initiate()
> rs.status()
Debugging
- if you have a problem for running Replica Set and you face a problem like this :
> rs.initiate()
{
"ok" : 0,
"errmsg" : "This node was not started with the replSet option",
"code" : 76,
"codeName" : "NoReplicationEnabled"
}
- it's because you're port of the MongoDB is reserved. and you have to stop the process which is run on the port of
27017
Killing the port
- 1- Open the
CommandPromptas administrator. - 2- run this command:
> netstat -aon | find "27017". - 3- then you see something like this :
TCP 127.0.0.1:27017 0.0.0.0:0 LISTENING 13936
- 4- the
13936is thePIDthat you have to kill it. - 5- next step, run this command to abort this process:
taskkill /pid {PID} /f
like :
taskkill /pid 13936 /f
+ Redis Installation & Configuration
Installing Redis
- installing Redis v4.2.1 for windows. you can download the release version from the Redis Github
- Redis GitHub (https://github.com/redis-windows/redis-windows)
- after downloading, you have to run 2 service. first run the
redis-server.exeand next run theredis-cli.exe - your redis driver is running
Install Redis PHP Extension
- for downloading, go to the packages PHP official website, and base on your windows, download the version of the
.dllwhich is compatible with your windows and the PHP version which is installed on your PC. - Redis PHP Package (https://pecl.php.net/package/redis)
Install the extension
- 1- go to your PHP folders where you've intsalled. (for finding the path of the PHP file, execute this command on CommandPrompt:
where php) - go to this path and copy the
php_redis.dll
{drive}:\php\php-{version}\ext
- next step, you have to add the extension name to
php.inifile. go to this path and open thephp.inifile withnotepad:
{drive}:\php\php-{version}\
- in the part of the
Dynamic Extensions(you can search it) add this command and save the file and restart your PHP server`
..
..
extension=redis
- you can check in the terminal to see if it is installed. open your CommandPrompt and run this command :
php -m | find "redis"- the output should be
redis - or just execute this code via PHP :
<?php echo phpinfo(); ?>
changing the cache driver
- for chaning the
Cache Driverof the project, if you don't have Redis Driver on your system, open the.envfile and change theCACHE_DRIVERtofilelike this : CACHE_DRIVER=file- also you can set it with Redis
CACHE_DRIVER=redis
+ Postman Collection & Environment
- there are the Postman Collection and Environment for importing.
- collections are available on
DEVELOPMENTfolder Collection => DEVELOPMENT/CRUD.postman_collection.jsonEnvironment => DEVELOPMENT/CRUD.postman_environment.json
irpcpro/testcrud 适用场景与选型建议
irpcpro/testcrud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「test」 「testcrud」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 irpcpro/testcrud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 irpcpro/testcrud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 irpcpro/testcrud 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
Specification-oriented BDD helpers for PHPUnit
KissTest is command-line free, fast, simple and beautiful unit test framework.
PWWEB Artomator
raxon/test see https://raxon.org for detailed usage
Test emails easily
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-01