PHP code example of kodi-app / kodi-pandabase-provider

1. Go to this page and download the library: Download kodi-app/kodi-pandabase-provider 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/ */

    

kodi-app / kodi-pandabase-provider example snippets


$application->run([
    // ...
    KodiConf::SERVICES => [
        // List of Services
        [
            "class_name" => PandaBaseProvider::class,
            "parameters" => [
                "name"      =>  "test_connection",  // Connection's name.
                "driver"    =>  "mysql",            // Same as PDO parameter
                "dbname"    =>  "test_dbname",      // Same as PDO parameter
                "host"      =>  "127.0.0.1",        // Same as PDO parameter
                "user"      =>  "root",             // Same as PDO parameter
                "password"  =>  ""                  // Same as PDO parameter
                "attributes"=>  [
                    attributeName => value,
                    ...
                ]                                   // Optional, PDO attributes
            ]
        ]
        // ...
    ],
    // ...
]);


// You can get ConnectionManager via Application singleton instance
$db = Application::get("db");

// Or you can get it via ConnectionManager singleton instance
$db = ConnectionManager::getInstance();