Download the PHP package riven/hyperf-callee without Composer

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

Callee 库使用文档

简介

Callee 是一个基于 Hyperf 框架的事件调用管理库,用于简化事件驱动的代码组织和调用。它提供了一种优雅的方式来注册和调用事件处理方法,支持注解方式和直接代码方式注册。

功能

安装

要通过 Composer 安装此包,请运行以下命令:

使用

配置

Callee\ConfigProvider::class服务提供者应该会自动注册。如果未自动注册,在你的 Hyperf 应用程序中启用 Callee,你需要在 config/autoload/dependencies.php 文件中注册它:

1. 定义事件枚举

首先,你需要定义事件枚举,实现 CalleeEvent 接口:

2. 注册事件处理方法

方式 1:使用注解注册

方式 2:直接代码注册

3. 调用事件处理方法

高级使用

作用域管理

你可以为事件处理方法指定作用域,以便在不同的上下文环境中使用不同的处理方法:

优先级管理

你可以为事件处理方法设置优先级,以便控制多个处理方法的执行顺序:

事务支持

你可以使用 afterCommit 参数来指定事件处理方法在事务提交后执行:

API 参考

注解参数

函数

收集器方法

完整代码示例

注意事项

  1. 确保在使用 call() 函数之前,已经设置了 Hyperf 的应用容器
  2. 对于异步事件处理方法,需要确保 Hyperf 的任务队列组件已正确配置
  3. 对于事务支持,需要确保在事务环境中使用 afterCommit 参数
  4. 优先级值越大,执行顺序越靠前

贡献

我们非常欢迎任何形式的贡献!如果你发现了问题或者有改进的想法,请先查看我们的 贡献指南。对于新功能的提案或错误修复,请直接提交 Pull Request。


All versions of hyperf-callee with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
hyperf/context Version ~3.1
hyperf/database Version ~3.1.0
hyperf/db-connection Version ~3.1.0
hyperf/di Version ~3.1
hyperf/event Version ~3.1
hyperf/framework Version ~3.1.0
hyperf/logger Version ~3.1.0
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 riven/hyperf-callee contains the following files

Loading the files please wait ...