Download the PHP package iry/php-event without Composer

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

Docs: English

简介

一个简单php异步事件引擎,以便解耦项目中的各模块

安装和使用

1. 安装

①.使用compser装载

②.传统/手动装载:在你的公共代码中加入如下代码 示例

2. 配置设置

在公共文件(单入口文件的项目建议在入口文件 )中加入如下代码. 示例

3. 创建 Class \MyNamespace\event\Setting

Setting: ./src/interfaces/Setting.php

接口实现示例请参考: ./example/event/Setting.php

方法

public function getPoolDriver()

该应用中内置了 Db (Sql DB),Sqlite,Redis,DbForLaravel ,DbForTp等驱动。
内置驱动使用方法:'store_driver'=>'@DbForLaravel?table=event_store', 表示使用内置的驱动(DbForLaravel)参数(表)为event_store
更多内置驱动请参考./src/drivers/RADME.md

public function getSubscribers()

返回类型 array(推荐) class列表: ['class1','class2'];
或者返回string
如: files:subscriber目录/*.php (会自动从这些文件的代码中分析出来Class全名)

public function getEventRules()

返回类型:"string", 返回一个 事件规则的Class名称,请参考./example/event/Event.php

返回类型:"string"

public function getTempPath()

返回类型:"string",返回一个目录路径的,结尾不要加“/”。 如:/tmp


3.启动事件服务(服务端 在命令行下执行)

参考 example/service.php

4. 触发事件 (客户端)

快捷使用方法

对象使用方法

会自动形成一条事件依赖链,用于保证事件成功广播出去的顺序

这种用法自动形成一条事件依赖链,用于保证事件成功广播出去的顺序 complete 依赖 afterRequest complete会自动等待afterRequest被所有监听者确认之后 才会真正广播出去。 afterRequest 依赖 beforeRequest afterRequest会自动等待 beforeRequest 被所有监听者确认之后 才会真正广播出去。

4.事件的使用模式

  1. 事件订阅模式
  2. 事件绑定模式
  3. 代码注入模式

事件订阅模式 通过订阅者自主监听事件 (推荐) 请参考 /example/subscribers/README.md;

事件绑定模式 通过事件绑定动作,绑定方法:查看/example/event/event.php; 和 /example/event/actions/README.md;

代码注入模式 同步注入代码到事件触发处。 查看事件配置的 exec=>[''] 请参考 /example/event/scripts/README.md;


All versions of php-event with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
iry/cli Version ^1.0
ext-json Version *
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 iry/php-event contains the following files

Loading the files please wait ....