PHP code example of tafhyseni / php-multi-tenancy

1. Go to this page and download the library: Download tafhyseni/php-multi-tenancy 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/ */

    

tafhyseni / php-multi-tenancy example snippets

bash
composer 
 php
use Tafhyseni\PhpMultiTenancy\Tenancy;
$tenancy = new Tenancy(
    array(
        'hostname' => '127.0.0.1',
        'username' => 'root',
        'password' => '',
        'database' => 'test',
        'tenancy_hostname' => '127.0.0.1',
        'tenancy_username' => 'root',
        'tenancy_password' => ''
    )
);
 php
$name = $tenancy->generate(NULL, array(), true);
 php
$name = $tenancy->generate('my_tenancy_db', array('table_to_clone_1'), data);