PHP code example of invincible-tech-systems / easeamp-mysql-redis

1. Go to this page and download the library: Download invincible-tech-systems/easeamp-mysql-redis library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

invincible-tech-systems / easeamp-mysql-redis example snippets



\InvincibleTechSystems\EaseAmpMysql\EaseAmpMysql;
use \InvincibleTechSystems\EaseAmpRedis\EaseAmpRedis;
use \InvincibleTechSystems\EaseAmpMysqlRedis\EaseAmpMysqlRedis;


use \InvincibleTechSystems\EaseAmpMysqlRedis\CustomAmphpDnsConfigLoader;

$customAmphpDnsConfigValues = ["208.67.222.222:53", "208.67.220.220:53","8.8.8.8:53","[2001:4860:4860::8888]:53"];

$CustomAmphpDnsConfigLoader = new CustomAmphpDnsConfigLoader($customAmphpDnsConfigValues, 5000, 3);

\Amp\Dns\resolver(new \Amp\Dns\Rfc1035StubResolver(null, $CustomAmphpDnsConfigLoader));


$dbHost = "localhost";
$dbUsername = "database_username";
$dbPassword = "database_password_value";
$dbName = "database_name";

$dbConn = new EaseAmpMysql($dbHost, $dbUsername, $dbPassword, $dbName);

$redisHost = 'tcp://localhost:6379';
$redisKeyNamespacePrefix = "MyFirstApp";
$redisKeyExpiryTimeInSeconds = 240;

$redisConn = new EaseAmpRedis($redisHost);