PHP code example of janfish / phalcon-db-reconnection

1. Go to this page and download the library: Download janfish/phalcon-db-reconnection 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/ */

    

janfish / phalcon-db-reconnection example snippets



use Janfish\Phalcon\Db\Adapter\Pdo\Mysql as Mysql;

$di->setShared('db', function () {
    return new Mysql([
        'adapter' => 'Mysql',
        'host' => 'localhost',
        'port' => '3306',
        'username' => 'root',
        'password' => 'root',
        'dbname' => 'test',
        'max_retry_connect' => 2,
    ]);
});