Download the PHP package lzpeng/hyperf-cycle without Composer

On this page you can find all versions of the php package lzpeng/hyperf-cycle. 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 hyperf-cycle

hyperf-cycle

Cycle ORM 在 Hyperf 中的连接池支持。

该库基于 hyperf/pool 为 Cycle ORM 提供协程安全的数据库连接复用能力,同时尽量保持与原生 Cycle ORM 一致的配置和使用方式。

特性

安装

发布配置

安装后可发布默认配置:

发布后会生成数据库配置文件,你可以在其中维护连接信息和连接池参数。

配置示例

连接池参数

参数 说明
min_connections 最小连接数
max_connections 最大连接数
connect_timeout 建立连接超时时间
wait_timeout 从连接池获取连接的等待时间
heartbeat 心跳检测间隔
max_idle_time 连接最大空闲时间

使用方式

推荐:从容器获取

该库通过 ConfigProvider 注册了 DatabaseManager 与 ORMFactory,通常直接从容器取用即可:

手动创建

说明

注意事项

由于hyperf是一个长驻进程框架,连接对象不要作为对象类的属性进行持久化,否则会导致连接泄露问题或事务问题。建议在需要使用数据库连接的地方通过容器获取 DatabaseManager 或 ORMFactory 来获取连接实例,确保连接能够正确回收。

错误使用示例:

正确例子:


All versions of hyperf-cycle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
cycle/orm Version ^2.8
hyperf/pool Version ^3.1
cycle/entity-behavior Version ^1.3
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 lzpeng/hyperf-cycle contains the following files

Loading the files please wait ...