1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 15:51:15 +01:00
Daniil Gentili ca1ed4f4e3
Some checks failed
ci/woodpecker/push/build Pipeline failed
Fully test DB drivers
2022-06-23 14:37:54 +02:00

21 lines
800 B
PHP

<?php
// Switch to another database driver, for testing
use danog\MadelineProto\Settings\Database\Memory;
use danog\MadelineProto\Settings\Database\Mysql;
use danog\MadelineProto\Settings\Database\Postgres;
use danog\MadelineProto\Settings\Database\Redis;
$MadelineProto = new \danog\MadelineProto\API(__DIR__.'/../testing.madeline');
$MadelineProto->updateSettings(match ($argv[1]) {
'memory' => new Memory,
'mysql' => (new Mysql)->setUri('tcp://mariadb')->setUsername('MadelineProto')->setPassword('test'),
'postgres' => (new Postgres)->setUri('tcp://postgres')->setUsername('MadelineProto')->setPassword('test'),
'redis' => (new Redis)->setUri('tcp://redis'),
});
$MadelineProto->contacts->resolveUsername(username: 'danogentili');
$MadelineProto->getFullInfo('danogentili');