1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

Overwriting registry for realtime

This commit is contained in:
Eldad Fux 2021-03-10 13:26:38 +02:00
parent de17d0d1d3
commit a3402b33f5
6 changed files with 127 additions and 114 deletions

View file

@ -15,6 +15,24 @@ use Utopia\CLI\Console;
// xdebug_start_trace('/tmp/trace');
Files::load(__DIR__ . '/../public');
include __DIR__ . '/controllers/general.php';
$domain = App::getEnv('_APP_DOMAIN', '');
Console::info('Issuing a TLS certificate for the master domain ('.$domain.') in 30 seconds.
Make sure your domain points to your server IP or restart your Appwrite server to try again.'); // TODO move this to installation script
ResqueScheduler::enqueueAt(\time() + 30, 'v1-certificates', 'CertificatesV1', [
'document' => [],
'domain' => $domain,
'validateTarget' => false,
'validateCNAME' => false,
]);
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$http = new Server("0.0.0.0", App::getEnv('PORT', 80));
$payloadSize = max(4000000 /* 4mb */, App::getEnv('_APP_STORAGE_LIMIT', 10000000 /* 10mb */));
@ -55,22 +73,6 @@ $http->on('start', function (Server $http) use ($payloadSize) {
});
});
Files::load(__DIR__ . '/../public');
include __DIR__ . '/controllers/general.php';
$domain = App::getEnv('_APP_DOMAIN', '');
Console::info('Issuing a TLS certificate for the master domain ('.$domain.') in 30 seconds.
Make sure your domain points to your server IP or restart your Appwrite server to try again.'); // TODO move this to installation script
ResqueScheduler::enqueueAt(\time() + 30, 'v1-certificates', 'CertificatesV1', [
'document' => [],
'domain' => $domain,
'validateTarget' => false,
'validateCNAME' => false,
]);
$http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) {
$request = new Request($swooleRequest);
$response = new Response($swooleResponse);

View file

@ -36,7 +36,6 @@ use Utopia\Registry\Registry;
use MaxMind\Db\Reader;
use PHPMailer\PHPMailer\PHPMailer;
use PDO as PDONative;
use Swoole\Runtime;
use Swoole\Database\PDOConfig;
use Swoole\Database\PDOPool;
use Swoole\Database\RedisConfig;
@ -161,7 +160,9 @@ $register->set('dbPool', function () { // Register DB connection
->withOptions([
PDONative::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
PDONative::ATTR_TIMEOUT => 3, // Seconds
PDONative::ATTR_PERSISTENT => true
PDONative::ATTR_PERSISTENT => true,
PDONative::ATTR_DEFAULT_FETCH_MODE => PDONative::FETCH_ASSOC,
PDONative::ATTR_ERRMODE => PDONative::ERRMODE_EXCEPTION,
]);
$pool = new PDOPool($config);
@ -169,15 +170,21 @@ $register->set('dbPool', function () { // Register DB connection
return $pool;
});
$register->set('db', function () use ($register) {
$pool = $register->get('dbPool');
$pdo = $pool->get()->__getObject();
$dbHost = App::getEnv('_APP_DB_HOST', '');
$dbUser = App::getEnv('_APP_DB_USER', '');
$dbPass = App::getEnv('_APP_DB_PASS', '');
$dbScheme = App::getEnv('_APP_DB_SCHEMA', '');
// Connection settings
$pdo->setAttribute(PDONative::ATTR_DEFAULT_FETCH_MODE, PDONative::FETCH_ASSOC); // Return arrays
$pdo->setAttribute(PDONative::ATTR_ERRMODE, PDONative::ERRMODE_EXCEPTION); // Handle all errors with exceptions
$pdo = new PDO("mysql:host={$dbHost};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array(
PDONative::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
PDONative::ATTR_TIMEOUT => 3, // Seconds
PDONative::ATTR_PERSISTENT => true,
PDONative::ATTR_DEFAULT_FETCH_MODE => PDONative::FETCH_ASSOC,
PDONative::ATTR_ERRMODE => PDONative::ERRMODE_EXCEPTION,
));
return $pdo;
}, true);
});
$register->set('influxdb', function () { // Register DB connection
$host = App::getEnv('_APP_INFLUXDB_HOST', '');
$port = App::getEnv('_APP_INFLUXDB_PORT', '');
@ -223,12 +230,13 @@ $register->set('redisPool', function () {
return $pool;
});
$register->set('cache', function () use ($register) { // Register cache connection
$redis = $register->get('redisPool')->get();
$register->set('cache', function () { // Register cache connection
$redis = new Redis();
$redis->pconnect(App::getEnv('_APP_REDIS_HOST', ''), App::getEnv('_APP_REDIS_PORT', ''));
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
return $redis;
}, true);
});
$register->set('smtp', function () {
$mail = new PHPMailer(true);

View file

@ -27,6 +27,20 @@ use Utopia\Abuse\Adapters\TimeLimit;
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$register->set('db', function () use ($register) {
$pool = $register->get('dbPool');
$pdo = $pool->get()->__getObject();
return $pdo;
}, true);
$register->set('cache', function () use ($register) { // Register cache connection
$redis = $register->get('redisPool')->get();
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
return $redis;
}, true);
$server = new Server('0.0.0.0', 80);
$server->set([

View file

@ -42,7 +42,7 @@
"utopia-php/cli": "0.10.0",
"utopia-php/config": "0.2.*",
"utopia-php/locale": "0.3.*",
"utopia-php/registry": "0.4.*",
"utopia-php/registry": "master",
"utopia-php/preloader": "0.2.*",
"utopia-php/domains": "0.2.*",
"utopia-php/swoole": "0.2.*",

143
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4159791237c3f67d8a3d9df77513bcd0",
"content-hash": "b579d6ac34eb119446727d63b21acca2",
"packages": [
{
"name": "adhocore/jwt",
@ -1850,16 +1850,16 @@
},
{
"name": "utopia-php/registry",
"version": "0.3.0",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/registry.git",
"reference": "8b05fe6f8af73bf77e1700212a28f36be6733d3a"
"reference": "7aebbc6c5f3f04ff7a35ac3dad39fa91c9bd7c2d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/registry/zipball/8b05fe6f8af73bf77e1700212a28f36be6733d3a",
"reference": "8b05fe6f8af73bf77e1700212a28f36be6733d3a",
"url": "https://api.github.com/repos/utopia-php/registry/zipball/7aebbc6c5f3f04ff7a35ac3dad39fa91c9bd7c2d",
"reference": "7aebbc6c5f3f04ff7a35ac3dad39fa91c9bd7c2d",
"shasum": ""
},
"require": {
@ -1869,6 +1869,7 @@
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.0.1"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -1896,9 +1897,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/registry/issues",
"source": "https://github.com/utopia-php/registry/tree/0.3.0"
"source": "https://github.com/utopia-php/registry/tree/0.4.0"
},
"time": "2021-03-09T17:38:40+00:00"
"time": "2021-03-10T06:50:09+00:00"
},
{
"name": "utopia-php/storage",
@ -3524,12 +3525,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "dae425925709122f7584cadeeb838edcaa491bb1"
"reference": "330949c62cbc3e44120990701c949e59a4f3e141"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/dae425925709122f7584cadeeb838edcaa491bb1",
"reference": "dae425925709122f7584cadeeb838edcaa491bb1",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/330949c62cbc3e44120990701c949e59a4f3e141",
"reference": "330949c62cbc3e44120990701c949e59a4f3e141",
"shasum": ""
},
"require": {
@ -3577,7 +3578,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:43+00:00"
"time": "2021-03-10T06:29:10+00:00"
},
{
"name": "phpunit/php-invoker",
@ -3585,12 +3586,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
"reference": "5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40"
"reference": "fe3276f5cd81d19a8e8ef90a32855545f7aae7cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40",
"reference": "5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/fe3276f5cd81d19a8e8ef90a32855545f7aae7cb",
"reference": "fe3276f5cd81d19a8e8ef90a32855545f7aae7cb",
"shasum": ""
},
"require": {
@ -3641,7 +3642,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:51+00:00"
"time": "2021-03-10T06:29:18+00:00"
},
{
"name": "phpunit/php-text-template",
@ -3649,12 +3650,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "4ec5a2ac79a19b35d0cf83cce30604f77743067a"
"reference": "11d864dc75b7f73d1e03361bff717894587f3987"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/4ec5a2ac79a19b35d0cf83cce30604f77743067a",
"reference": "4ec5a2ac79a19b35d0cf83cce30604f77743067a",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/11d864dc75b7f73d1e03361bff717894587f3987",
"reference": "11d864dc75b7f73d1e03361bff717894587f3987",
"shasum": ""
},
"require": {
@ -3701,7 +3702,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:49:24+00:00"
"time": "2021-03-10T06:29:48+00:00"
},
{
"name": "phpunit/php-timer",
@ -3709,12 +3710,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "705821b0927b5e69e9e016c84de68dc6195c71b9"
"reference": "95242c4aa540e9b3655c7edbe8f76d55ac237b7b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/705821b0927b5e69e9e016c84de68dc6195c71b9",
"reference": "705821b0927b5e69e9e016c84de68dc6195c71b9",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/95242c4aa540e9b3655c7edbe8f76d55ac237b7b",
"reference": "95242c4aa540e9b3655c7edbe8f76d55ac237b7b",
"shasum": ""
},
"require": {
@ -3761,7 +3762,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:59+00:00"
"time": "2021-03-10T06:29:26+00:00"
},
{
"name": "phpunit/phpunit",
@ -3920,12 +3921,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
"reference": "3a42d843af4d27ca1155e1d926881af162733655"
"reference": "c8472024d13a267ba49f4c1e194a01cba5b094f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/3a42d843af4d27ca1155e1d926881af162733655",
"reference": "3a42d843af4d27ca1155e1d926881af162733655",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c8472024d13a267ba49f4c1e194a01cba5b094f5",
"reference": "c8472024d13a267ba49f4c1e194a01cba5b094f5",
"shasum": ""
},
"require": {
@ -3969,7 +3970,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:49:50+00:00"
"time": "2021-03-10T06:30:16+00:00"
},
{
"name": "sebastian/code-unit",
@ -4033,12 +4034,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "5f5db0b35f586eb5bca0581a10bb42dd56575986"
"reference": "84710fb3a027eb62978539705a0cd00713d474c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5f5db0b35f586eb5bca0581a10bb42dd56575986",
"reference": "5f5db0b35f586eb5bca0581a10bb42dd56575986",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/84710fb3a027eb62978539705a0cd00713d474c8",
"reference": "84710fb3a027eb62978539705a0cd00713d474c8",
"shasum": ""
},
"require": {
@ -4081,7 +4082,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:47:39+00:00"
"time": "2021-03-10T06:28:05+00:00"
},
{
"name": "sebastian/comparator",
@ -4089,12 +4090,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "dbc5fb421f242a5749845dc8dd0dc8cde2979dd9"
"reference": "5dfac003e3be0ca24000cee2a2e19ba2f21aa8f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dbc5fb421f242a5749845dc8dd0dc8cde2979dd9",
"reference": "dbc5fb421f242a5749845dc8dd0dc8cde2979dd9",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5dfac003e3be0ca24000cee2a2e19ba2f21aa8f8",
"reference": "5dfac003e3be0ca24000cee2a2e19ba2f21aa8f8",
"shasum": ""
},
"require": {
@ -4156,7 +4157,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:47:47+00:00"
"time": "2021-03-10T06:28:15+00:00"
},
{
"name": "sebastian/complexity",
@ -4221,12 +4222,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90"
"reference": "08ab1620f0f35c41e50d847433193da76d33151e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90",
"reference": "93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/08ab1620f0f35c41e50d847433193da76d33151e",
"reference": "08ab1620f0f35c41e50d847433193da76d33151e",
"shasum": ""
},
"require": {
@ -4280,7 +4281,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:47:55+00:00"
"time": "2021-03-10T06:28:23+00:00"
},
{
"name": "sebastian/environment",
@ -4288,12 +4289,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "6e1743b808be9cfd33a716583ccb94b7d4d32e94"
"reference": "e34aa76b02666b7f12417f2000b6d4fbb9c2016c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e1743b808be9cfd33a716583ccb94b7d4d32e94",
"reference": "6e1743b808be9cfd33a716583ccb94b7d4d32e94",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/e34aa76b02666b7f12417f2000b6d4fbb9c2016c",
"reference": "e34aa76b02666b7f12417f2000b6d4fbb9c2016c",
"shasum": ""
},
"require": {
@ -4344,7 +4345,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:03+00:00"
"time": "2021-03-10T06:28:31+00:00"
},
{
"name": "sebastian/exporter",
@ -4352,12 +4353,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "eca7281ab29075df68b113a37a83be616b629b12"
"reference": "889b30136f9f8a6c0c4d71954b772ac8b8d7feab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/eca7281ab29075df68b113a37a83be616b629b12",
"reference": "eca7281ab29075df68b113a37a83be616b629b12",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/889b30136f9f8a6c0c4d71954b772ac8b8d7feab",
"reference": "889b30136f9f8a6c0c4d71954b772ac8b8d7feab",
"shasum": ""
},
"require": {
@ -4422,7 +4423,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:12+00:00"
"time": "2021-03-10T06:28:38+00:00"
},
{
"name": "sebastian/global-state",
@ -4430,12 +4431,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "0ac702e6d13725242edb9b294c5d20b92fcfb8b4"
"reference": "8a1428d5351ea5dae3aa386d3b321499ac23adea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ac702e6d13725242edb9b294c5d20b92fcfb8b4",
"reference": "0ac702e6d13725242edb9b294c5d20b92fcfb8b4",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/8a1428d5351ea5dae3aa386d3b321499ac23adea",
"reference": "8a1428d5351ea5dae3aa386d3b321499ac23adea",
"shasum": ""
},
"require": {
@ -4487,7 +4488,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:19+00:00"
"time": "2021-03-10T06:28:46+00:00"
},
{
"name": "sebastian/lines-of-code",
@ -4552,12 +4553,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "8cc80b4bda00a4c5997c3fc597a34872f3a1007d"
"reference": "b218fb1d63287edb7613b61122890f39e82ae8c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/8cc80b4bda00a4c5997c3fc597a34872f3a1007d",
"reference": "8cc80b4bda00a4c5997c3fc597a34872f3a1007d",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/b218fb1d63287edb7613b61122890f39e82ae8c2",
"reference": "b218fb1d63287edb7613b61122890f39e82ae8c2",
"shasum": ""
},
"require": {
@ -4602,7 +4603,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:28+00:00"
"time": "2021-03-10T06:28:54+00:00"
},
{
"name": "sebastian/object-reflector",
@ -4610,12 +4611,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "1d33587c2c3e636936f895e103a9e82dd8102a8e"
"reference": "cbf30bc9ed44451f5301480f668cd4fcf6bb225a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d33587c2c3e636936f895e103a9e82dd8102a8e",
"reference": "1d33587c2c3e636936f895e103a9e82dd8102a8e",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/cbf30bc9ed44451f5301480f668cd4fcf6bb225a",
"reference": "cbf30bc9ed44451f5301480f668cd4fcf6bb225a",
"shasum": ""
},
"require": {
@ -4658,7 +4659,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:48:35+00:00"
"time": "2021-03-10T06:29:02+00:00"
},
{
"name": "sebastian/recursion-context",
@ -4666,12 +4667,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "43f58a51e8f853aadb228ba818d2be388af7237b"
"reference": "c3333538e25ec932d0cbdce77b6ac846757b809d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/43f58a51e8f853aadb228ba818d2be388af7237b",
"reference": "43f58a51e8f853aadb228ba818d2be388af7237b",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c3333538e25ec932d0cbdce77b6ac846757b809d",
"reference": "c3333538e25ec932d0cbdce77b6ac846757b809d",
"shasum": ""
},
"require": {
@ -4722,7 +4723,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:49:08+00:00"
"time": "2021-03-10T06:29:33+00:00"
},
{
"name": "sebastian/resource-operations",
@ -4786,12 +4787,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
"reference": "557863473c1de00e165a288d5b547f1f83652e7e"
"reference": "1bba184dccb563769fab9bd69c623c1a353dec98"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/557863473c1de00e165a288d5b547f1f83652e7e",
"reference": "557863473c1de00e165a288d5b547f1f83652e7e",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1bba184dccb563769fab9bd69c623c1a353dec98",
"reference": "1bba184dccb563769fab9bd69c623c1a353dec98",
"shasum": ""
},
"require": {
@ -4835,7 +4836,7 @@
"type": "github"
}
],
"time": "2021-02-23T15:49:16+00:00"
"time": "2021-03-10T06:29:41+00:00"
},
{
"name": "sebastian/version",
@ -5658,12 +5659,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "728c611e8643a5dd44839ffa791e21763b04a694"
"reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/728c611e8643a5dd44839ffa791e21763b04a694",
"reference": "728c611e8643a5dd44839ffa791e21763b04a694",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/37e48403c21e06f63bc27d7ccd997fbb72b0ae2a",
"reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a",
"shasum": ""
},
"require": {
@ -5729,7 +5730,7 @@
"type": "tidelift"
}
],
"time": "2021-02-22T11:56:05+00:00"
"time": "2021-03-10T10:07:14+00:00"
},
{
"name": "vimeo/psalm",

View file

@ -18,28 +18,16 @@ abstract class Worker
public function setUp(): void
{
run(function() {
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$this->init();
});
$this->init();
}
public function perform()
{
run(function() {
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$this->execute();
});
$this->execute();
}
public function tearDown(): void
{
run(function() {
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$this->shutdown();
});
$this->shutdown();
}
}