本文整理汇总了PHP中Driver::getDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP Driver::getDriver方法的具体用法?PHP Driver::getDriver怎么用?PHP Driver::getDriver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Driver
的用法示例。
在下文中一共展示了Driver::getDriver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getDriver
/**
* Load database driver to query for results
**/
private function _getDriver()
{
require_once APPPATH . 'libraries/scaffolder/drivers/driver' . EXT;
return Driver::getDriver();
}
示例2: testDriver
/**
* Verify if database driver is functional
*/
public function testDriver()
{
require BASEPATH . 'codeigniter/Common' . EXT;
require BASEPATH . 'codeigniter/Compat' . EXT;
require APPPATH . 'config/constants' . EXT;
require BASEPATH . 'codeigniter/Base5' . EXT;
require_once APPPATH . 'libraries/scaffolder/drivers/driver' . EXT;
$test_table = 'cidade';
$num_fields = 4;
$pk = "id";
$driver = Driver::getDriver();
$tables = $driver->getTables();
$this->assert(in_array($test_table, $tables), true, "Show test table");
$fields = $driver->getFields($test_table);
$this->assert(count($fields), $num_fields, "Display {$num_fields} fields");
$primary_key = $this->getTablePK($fields);
$this->assertNotNull($primary_key, "Has primary key");
$this->assert($primary_key->getName(), $pk, "Primary Key equals {$pk}");
}