PHP code example of connehito / cakephp-master-replica
1. Go to this page and download the library: Download connehito/cakephp-master-replica 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/ */
connehito / cakephp-master-replica example snippets
// as default, connect with `master` role.
$usersTable->save($usersTable->newEntity(['name' => 'hoge']));
// switch to `replica` role
\Cake\Datasource\ConnectionManager::get('default')->switchRole('secondary');
// Or you can get Connection via Table
$usersTable->getConnection()->switchRole('tertiary');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.