mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge branch '1.6.x' of https://github.com/appwrite/appwrite into feat-custom-cf-hostnames
This commit is contained in:
commit
c8c4576bbc
13 changed files with 66 additions and 1 deletions
|
|
@ -121,6 +121,10 @@ class Audit extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,10 @@ class Build extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@ class Certificate extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,10 @@ class Database extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$dsn = new DSN($this->getProject()->getAttribute('database'));
|
$dsn = new DSN($this->getProject()->getAttribute('database'));
|
||||||
} catch (\InvalidArgumentException) {
|
} catch (\InvalidArgumentException) {
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,10 @@ class Delete extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,24 @@ class Event
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set paused state for this event.
|
||||||
|
*/
|
||||||
|
public function setPaused(bool $paused): self
|
||||||
|
{
|
||||||
|
$this->paused = $paused;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get paused state for this event.
|
||||||
|
*/
|
||||||
|
public function getPaused(): bool
|
||||||
|
{
|
||||||
|
return $this->paused;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set queue used for this event.
|
* Set queue used for this event.
|
||||||
*
|
*
|
||||||
|
|
@ -302,6 +320,10 @@ class Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,10 @@ class Func extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
$events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null;
|
$events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null;
|
||||||
|
|
|
||||||
|
|
@ -404,6 +404,10 @@ class Mail extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,10 @@ class Messaging extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string | bool
|
public function trigger(): string | bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,9 @@ class Migration extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Realtime extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
if (empty($this->event)) {
|
if ($this->paused || empty($this->event)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@ class Usage extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
'project' => $this->getProject(),
|
'project' => $this->getProject(),
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@ class UsageDump extends Event
|
||||||
*/
|
*/
|
||||||
public function trigger(): string|bool
|
public function trigger(): string|bool
|
||||||
{
|
{
|
||||||
|
if ($this->paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$client = new Client($this->queue, $this->connection);
|
$client = new Client($this->queue, $this->connection);
|
||||||
|
|
||||||
return $client->enqueue([
|
return $client->enqueue([
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue