1. Go to this page and download the library: Download piotr-cz/cockpit-sql-driver 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/ */
piotr-cz / cockpit-sql-driver example snippets
return [
# Cockpit configuration
# …
# Use SQL Driver as main data storage
'database' => [
'server' => 'sqldriver',
# Connection options
'options' => [
'connection' => 'mysql', # One of 'mysql'|'pgsql'
'host' => 'localhost', # Optional, defaults to 'localhost'
'port' => 3306, # Optional, defaults to 3306 (MySQL) or 5432 (PostgreSQL)
'dbname' => 'DATABASE_NAME',
'username' => 'USER',
'password' => 'PASSWORD',
'charset' => 'UTF8', # Optional, defaults to 'UTF8'
'tablePrefix' => '', # Optional, database tables prefix (ie. 'cockpit_')
'bootstrapPriority' => 999, # Optional, defaults to 999
],
# Connection specific options
# General: https://www.php.net/manual/en/pdo.setattribute.php
# MySQL specific: https://www.php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants
'driverOptions' => [],
],
];
return [];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.