Download the PHP package swoft-laravel/database without Composer
On this page you can find all versions of the php package swoft-laravel/database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package database
swoft-laravel-databases
集成 laravel orm 组件至 swoft
php >7.2, swoole > 4.0.3, swoft > v1.9 (暂不支持v2.x)
技术细节
- 技术目标:
- 独立使用 laravel database, 文档和使用方式参考lavarl 社区文档
- 在不扩大代码量的情况下,尽可能地迁移 laravel database 的功能: QueryBuilder, Model, ORM, 配置项
- 支持swoole Coroutine\MySQL 异步客户端
- 支持coroutine mysql连接池
- 实现
- 代码部分主要参照 官方文档 ,在它的基础之上,整合laravel database数据库配置加载方式
- 参考 database 本身的mysql driver实现,对Coroutine\MySQL的相关调用做了一层代理封装, 使其可以与复用mysql driver部分的代码
安装
在composer.json require 中添加如依赖
更新依赖
在根目录下新建文件 config\database.php
如果需要使用 swoole 异步客户端,需要绑定命名空间下的事件监听器 在配置文件 config\properties\app.php 添加如下配置
或者手工管理 初始化连接
连接生命周期结束则自动回收
使用
All versions of database with dependencies
PHP Build Version
Package Version
Requires
swoft/framework Version
~1.0
illuminate/database Version ~5.7.2
illuminate/config Version ~5.7.2
illuminate/database Version ~5.7.2
illuminate/config Version ~5.7.2
The package swoft-laravel/database contains the following files
Loading the files please wait ....