gouuse / core
gouuse core files
Requires
- php: >=7
- elasticsearch/elasticsearch: ~5.0
- illuminate/redis: ^5.4
- ixudra/curl: 6.*
- laravel/lumen-framework: >=5.4
- mk-j/php_xlsxwriter: ^0.32.0
- phpoffice/phpspreadsheet: ^1.0@beta
- predis/predis: 1.0.*
- sayid/aliyun-mns-php-sdk: dev-master
- zircote/swagger-php: ^2.0
Requires (Dev)
- fzaninotto/faker: ~1.4
- mockery/mockery: ~0.9
- phpunit/phpunit: ~5.0
- 1.2.21
- 1.2.20
- 1.2.19
- 1.2.18
- 1.2.17
- 1.2.16
- 1.2.15
- 1.2.14
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.1.172
- 1.1.171
- 1.1.170
- 1.1.169
- 1.1.168
- 1.1.167
- 1.1.166
- 1.1.165
- 1.1.164
- 1.1.163
- 1.1.161
- 1.1.160
- 1.1.159
- 1.1.158
- 1.1.157
- 1.1.156
- 1.1.155
- 1.1.154
- 1.1.153
- 1.1.152
- 1.1.151
- 1.1.150
- 1.1.149
- 1.1.148
- 1.1.147
- 1.1.146
- 1.1.145
- 1.1.144
- 1.1.143
- 1.1.142
- 1.1.141
- 1.1.140
- 1.1.139
- 1.1.138
- 1.1.137
- 1.1.136
- 1.1.135
- 1.1.134
- 1.1.133
- 1.1.132
- 1.1.131
- 1.1.130
- 1.1.129
- 1.1.128
- 1.1.127
- 1.1.126
- 1.1.125
- 1.1.124
- 1.1.123
- 1.1.122
- 1.1.121
- 1.1.120
- 1.1.119
- 1.1.118
- 1.1.117
- 1.1.116
- 1.1.115
- 1.1.113
- 1.1.112
- 1.1.111
- 1.1.110
- 1.1.109
- 1.1.108
- 1.1.107
- 1.1.104
- 1.1.103
- 1.1.102
- 1.1.101
- 1.1.100
- 1.1.99
- 1.1.97
- 1.1.96
- 1.1.95
- 1.1.94
- 1.1.93
- 1.1.92
- 1.1.91
- 1.1.90
- 1.1.89
- 1.1.88
- 1.1.87
- 1.1.86
- 1.1.85
- 1.1.84
- 1.1.83
- 1.1.81
- 1.1.80
- 1.1.79
- 1.1.78
- 1.1.77
- 1.1.76
- 1.1.75
- 1.1.74
- 1.1.73
- 1.1.71
- 1.1.70
- 1.1.69
- 1.1.68
- 1.1.67
- 1.1.66
- 1.1.65
- 1.1.64
- 1.1.63
- 1.1.62
- 1.1.61
- 1.1.60
- 1.1.59
- 1.1.58
- 1.1.57
- 1.1.55
- 1.1.53
- 1.1.52
- 1.1.51
- 1.1.50
- 1.1.49
- 1.1.48
- 1.1.47
- 1.1.46
- 1.1.45
- 1.1.44
- 1.1.43
- 1.1.42
- 1.1.39
- 1.1.37
- 1.1.36
- 1.1.35
- 1.1.34
- 1.1.32
- 1.1.29
- 1.1.28
- 1.1.26
- 1.1.25
- 1.1.24
- 1.1.23
- 1.1.22
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.8
- 1.1.7
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- dev-revert-16-master
This package is auto-updated.
Last update: 2025-03-06 19:55:55 UTC
README
使用方法:
1、第一步在composer文件中引入该包
"gouuse/core":"1.1.*"
2、在自己项目框架中,将controller继承为
use GouuseCore\Controllers\Controller
3、将model继承为
use GouuseCore\Models\BaseModel;
4、将lib继承为
use GouuseCore\Libraries\Lib; 如果将自己library放入到公共包并且希望使用$this->方式调用,需要将公共包的BaseGouuse.php中的33行加上自己的library。公共类可以自定加入到lib文件夹下。 注意:自己模块的私有类库请放在自己项目的library下
5、使用helper时 使用
GouuseCore\Helpers\ArrayHelper
6、使用数据库日志、返回数据使用数组
在app.php中注册EventServiceProvider $app->register(GouuseCore\Providers\EventServiceProvider::class);
7、swoole服务管理 端口信息配置在.env文件中 vendor/bin/Swoole start | stop | reload | restart | quit 注意:Windows环境需要使用php -f vendor/gouuse/core/src/bin/Swoole start | stop | reload | restart | quit
8、自己开发的服务如果要对其他应用提供内部调用,请在Rpcs文件夹下编写自己的rpc客户端,参照memberrpc.php。使用rpc服务需要在网关层面定义要负载、API规则协议,rpc会自动拉取网关路由规则
9、阿里消息订阅服务 在.env中配置: QUEUE_PREFIX=dev- QUEUE_MNS_ACCESS_KEY= QUEUE_MNS_SECRET_KEY= QUEUE_MNS_ENDPOINT=http://xxxxxxxxxxxxxxxxx.mns.cn-beijing.aliyuncs.com/ 发送消息到消息中心: $messge_data = [消息体组合数组]; $this->sendMessageCenter->sendMessageCenter($messge_data);
发送通用订阅消息: $messge_data = ['topic_name' => 'user-message-center', 'message_body' => json_encode($messge_data)]; $this->sendMessageCenter->sendMessageTopic($messge_data);
获取订阅消息: $this->MessageCenterLib->getMessageData($request);
10、通用日志方法 成功日志:$this->LogLib->info(['param' => '提交数据', 'result' => '返回数据', 'startTime' => '开始时间戳']); 错语日志:$this->LogLib->log_err(['param' => '提交数据', 'result' => '返回数据', 'startTime' => '开始时间戳']);
11、CodeTool工具是自动将CodeLib.php文件的注释自动转换成数组配置文件 执行方式vendor/bin/CodeTool ,生成的文件error_code.inc.php在resources/options/zh_cn/目录下 注意:Windows开发环境下需要使用php -f vendor/gouuse/core/src/bin/CodeTool error_c ode.inc.php执行
12、加密解密 使用$this->EncryptLib->encrypt() / $this->EncryptLib->decrypt()
13、生成文档 php vendor/zircote/swagger-php/bin/swagger app/Http/Controllers -o public/swagger-docs
14、rpc调用远程方法