Download the PHP package reactphp-x/cycle-database without Composer

On this page you can find all versions of the php package reactphp-x/cycle-database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cycle-database

reactphp-x/cycle-database

使用 ReactPHP 的 MySQL 连接池为 Cycle Database 提供异步驱动,在非阻塞环境下保持 Cycle 风格的同步 API($db->query() / $db->execute() / 查询构建器等)。

基于组件:

特性

仅支持 MySQL(AsyncMysqlDriver)。


安装

要求:PHP 8.1+(代码使用 BackedEnum 等特性),MySQL 5.7+/8.0+。


快速开始(Basic)

更多可运行示例见 examples/


运行示例

环境变量(可选,均有默认值):

变量 默认值 说明
DB_HOST 127.0.0.1 MySQL 地址
DB_PORT 3306 MySQL 端口
DB_NAME test 数据库名
DB_USER root 用户名
DB_PASSWORD 123456 密码
DB_CHARSET utf8mb4 字符集
DB_POOL_MIN 1 连接池最小连接数
DB_POOL_MAX 10 连接池最大连接数
DB_POOL_QUEUE 100 等待队列容量
DB_POOL_TIMEOUT 0 获取连接超时(毫秒,0 表示不超时)

使用方式

同步风格查询

查询构建器(兼容 Cycle Database)

事务(使用驱动回调)

注意:不支持 begin/commit/rollback 三个方法;请使用驱动的 transaction(callable)

流式查询(大结果集)


UPSERT 用法(updates)

示例(更多见 examples/mysql_upsert.php):

实现参考:ReactphpX\CycleDatabase\MySQLCompiler::upsertQuery() 会将未显式指定的更新列默认回落为 columns() 中的全部列。


连接池与可选项

AsyncMySQLDriverConfigoptions 中传入:

驱动还提供:


与 Cycle Database 的差异

API 命名与行为尽量保持与 Cycle Database 一致,迁移成本低。


License

MIT


All versions of cycle-database with dependencies

PHP Build Version
Package Version
Requires reactphp-x/mysql-pool Version ^2.0
react/async Version ^4
wpjscc/database Version ^2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reactphp-x/cycle-database contains the following files

Loading the files please wait ...