本文整理汇总了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();
}