本文整理汇总了PHP中loader::database方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::database方法的具体用法?PHP loader::database怎么用?PHP loader::database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loader
的用法示例。
在下文中一共展示了loader::database方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createtable
function _createtable($sql)
{
$db =& loader::database();
$type = strtoupper(preg_replace("/^\\s*CREATE TABLE\\s+.+\\s+\\(.+?\\).*(ENGINE|TYPE)\\s*=\\s*([a-z]+?).*\$/isU", "\\2", $sql));
$type = in_array($type, array('MYISAM', 'HEAP', 'MEMORY')) ? $type : 'MYISAM';
return preg_replace("/^\\s*(CREATE TABLE\\s+.+\\s+\\(.+?\\)).*\$/isU", "\\1", $sql) . ($db->version() > '4.1' ? " ENGINE={$type} DEFAULT CHARSET=utf8" : " TYPE={$type}");
}
示例2: __constuct
function __constuct()
{
parent::__constuct();
// Call the Model constructor
loader::database();
// Connect to current database setting.
}
示例3: plugin
function plugin($config = null)
{
if (!is_null($config)) {
$this->config = array_merge($this->config, $config);
}
$this->db =& loader::database();
$this->plugin_mgr =& loader::lib('plugin');
}
示例4: pagecore
function pagecore()
{
$this->output =& loader::lib('output');
$this->db =& loader::database();
$this->user =& loader::model('user');
$this->setting =& loader::model('setting');
$this->plugin =& loader::lib('plugin');
$this->plugin->trigger('controller_init');
}
示例5: __construct
public function __construct()
{
loader::database("db");
}
示例6: modelfactory
function modelfactory()
{
$this->db =& loader::database();
}
示例7: plugin_cla
function plugin_cla()
{
$this->db =& loader::database();
}
示例8: show_header
$step = $step + 1;
show_header();
show_install();
$tablepre = 'meu_';
$CONFIG['database']['default']['adapter'] = 'sqlite';
$CONFIG['database']['default']['dbpath'] = $dst_dbfile;
$CONFIG['database']['default']['pre'] = $tablepre;
$CONFIG['cookie_name'] = 'MPIC_' . random(4);
$CONFIG['cookie_auth_key'] = random(12);
$CONFIG['img_engine'] = class_exists('imagick') ? 'imagick' : 'gd';
save_config_file($confile, $CONFIG, $default_config);
if (file_exists(ROOTDIR . $dst_dbfile)) {
@unlink(ROOTDIR . $dst_dbfile);
}
@touch(ROOTDIR . $dst_dbfile);
$db =& loader::database();
$sql = file_get_contents($sqlite_sqlfile);
$sql = str_replace("\r\n", "\n", $sql);
runquery($sql);
}
$datasql = file_get_contents($datasqlfile);
runquery($datasql);
$sql = $db->insert('#@nav', array('type' => 0, 'name' => lang('home'), 'url' => 'default', 'sort' => '100'));
$db->query($sql);
$sql = $db->insert('#@nav', array('type' => 0, 'name' => lang('tags'), 'url' => 'tags', 'sort' => '100'));
$db->query($sql);
$sql = $db->insert('#@nav', array('type' => 0, 'name' => lang('category'), 'url' => 'category', 'sort' => '100'));
$db->query($sql);
showjsmessage(lang('install_data_sql') . lang('succeed'));
cleardir(ROOTDIR . 'cache/data');
cleardir(ROOTDIR . 'cache/templates');