for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rougin\Describe\Driver;
/**
* CodeIgniter Driver
*
* A database driver specifically used for CodeIgniter.
* @package Describe
* @category Driver
* @author Rougin Royce Gutib <[email protected]>
*/
class CodeIgniterDriver implements DriverInterface
{
* @var \Rougin\Describe\Driver\DriverInterface|null
protected $driver = null;
* Gets the specified driver from the specified database connection.
* @param array $database
public function __construct(array $database)
switch ($database['dbdriver']) {
case 'mysql':
case 'mysqli':
$dsn = 'mysql:host=' . $database['hostname'] . ';dbname=' . $database['database'];
$pdo = new \PDO($dsn, $database['username'], $database['password']);
$this->driver = new MySQLDriver($pdo, $database['database']);
break;
case 'pdo':
case 'sqlite':
case 'sqlite3':
$pdo = new \PDO($database['hostname']);
$this->driver = new SQLiteDriver($pdo);
}
* Returns the result.
* @return array
public function getTable($table)
return $this->driver->getTable($table);
* Shows the list of tables.
public function showTables()
return $this->driver->showTables();