本文整理匯總了PHP中CI_Loader::dbforge方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Loader::dbforge方法的具體用法?PHP CI_Loader::dbforge怎麽用?PHP CI_Loader::dbforge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CI_Loader
的用法示例。
在下文中一共展示了CI_Loader::dbforge方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* Initialize both database and forge components
*/
public static function init($driver)
{
if (empty(static::$db) && empty(static::$forge)) {
$config = Mock_Database_DB::config($driver);
$connection = new Mock_Database_DB($config);
$db = Mock_Database_DB::DB($connection->set_dsn($driver), TRUE);
CI_TestCase::instance()->ci_instance_var('db', $db);
$loader = new CI_Loader();
$loader->dbforge();
$forge = CI_TestCase::instance()->ci_instance_var('dbforge');
static::$db = $db;
static::$forge = $forge;
static::$driver = $driver;
}
return static::$db;
}
示例2: init
/**
* Initialize both database and forge components
*/
public static function init($driver)
{
if (empty(self::$db) && empty(self::$forge)) {
// E_DEPRECATED notices thrown by mysql_connect(), mysql_pconnect()
// on PHP 5.5+ cause the tests to fail
if ($driver === 'mysql' && version_compare(PHP_VERSION, '5.5', '>=')) {
error_reporting(E_ALL & ~E_DEPRECATED);
}
$config = Mock_Database_DB::config($driver);
$connection = new Mock_Database_DB($config);
$db = Mock_Database_DB::DB($connection->set_dsn($driver), TRUE);
CI_TestCase::instance()->ci_instance_var('db', $db);
$loader = new CI_Loader();
$loader->dbforge();
$forge = CI_TestCase::instance()->ci_instance_var('dbforge');
self::$db = $db;
self::$forge = $forge;
self::$driver = $driver;
}
return self::$db;
}
示例3: dbforge
/** Load dbforge **/
public function dbforge()
{
parent::dbforge();
}