-
-
Notifications
You must be signed in to change notification settings - Fork 673
/
polyfill.php
34 lines (27 loc) · 1.47 KB
/
polyfill.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php declare(strict_types=1);
namespace danog\MadelineProto\Db;
if (class_exists('\\danog\\MadelineProto\\Db\\NullCache\\MysqlArray')) {
return;
}
if (\PHP_OS_FAMILY === 'Windows') {
echo "WARNING: MadelineProto runs around 10x slower on windows due to OS and PHP limitations. Make sure to deploy MadelineProto in production only on Linux or Mac OS machines for maximum performance.".PHP_EOL;
}
use danog\AsyncOrm\Internal\Containers\CacheContainer;
use danog\AsyncOrm\Internal\Driver\MysqlArray;
use danog\AsyncOrm\Internal\Driver\PostgresArray;
use danog\AsyncOrm\Internal\Driver\RedisArray;
class_alias(MysqlArray::class, '\\danog\\MadelineProto\\Db\\NullCache\\MysqlArray');
class_alias(PostgresArray::class, '\\danog\\MadelineProto\\Db\\NullCache\\PostgresArray');
class_alias(RedisArray::class, '\\danog\\MadelineProto\\Db\\NullCache\\RedisArray');
class_alias(MysqlArray::class, '\\danog\\MadelineProto\\Db\\MysqlArray');
class_alias(PostgresArray::class, '\\danog\\MadelineProto\\Db\\PostgresArray');
class_alias(PostgresArray::class, '\\danog\\MadelineProto\\Db\\PostgresArrayBytea');
class_alias(RedisArray::class, '\\danog\\MadelineProto\\Db\\RedisArray');
class_alias(CacheContainer::class, '\\danog\\MadelineProto\\Db\\CacheContainer');
if ((PHP_MINOR_VERSION === 2 && PHP_VERSION_ID < 80204)
|| PHP_MAJOR_VERSION < 8
|| (PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2)
) {
echo('MadelineProto requires PHP 8.3.1+ (recommended) or 8.2.14+.'.PHP_EOL);
die(1);
}