本文整理汇总了PHP中DBFactory类的典型用法代码示例。如果您正苦于以下问题:PHP DBFactory类的具体用法?PHP DBFactory怎么用?PHP DBFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DBFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($id)
{
$myDB = new DBFactory();
$this->sql = $myDB->getMysqlConnexionWithPDO();
$this->classes = $this->getClasses();
$this->id = $id;
}
开发者ID:dexz,项目名称:dev-extaze,代码行数:7,代码来源:profile.php
示例2: getRole
function getRole($role)
{
$myDB = new DBFactory();
$sql = $myDB->getMysqlConnexionWithPDO();
$query = $sql->prepare("SELECT id, login, role FROM users WHERE role = :role AND login != :me");
$query->execute(array('role' => $role, 'me' => $_SESSION['user']));
return $query->fetchAll();
}
开发者ID:dexz,项目名称:dev-extaze,代码行数:8,代码来源:admin_accounts.php
示例3: getCharacters
function getCharacters()
{
$myDB = new DBFactory();
$sql = $myDB->getMysqlConnexionWithPDO();
$query = $sql->prepare("SELECT chars.*, class.name AS className, spec1.role_name AS role1, spec2.role_name AS role2 FROM chars, specs AS spec1, specs AS spec2, class WHERE chars.spec1 = spec1.id AND chars.spec2 = spec2.id AND spec1.class_id = class.id");
$query->execute();
return $query->fetchAll();
}
开发者ID:dexz,项目名称:dev-extaze,代码行数:8,代码来源:admin_add_raider.php
示例4: ec_update_value
/**
* Wrapper to do all to work. Updates the items table based on the cached or live data.
*/
function ec_update_value($item_id)
{
$query = DBFactory::getDBQuery();
// Don't try if we can't open URLs with fopen.
// Do to!
// if (1 != function_exists('curl_init')) {
// return;
// }
// Don't try if the item id isn't an integer.
if (!is_numeric($item_id)) {
return;
}
// Verify we have a sync table to use.
verify_sync_table();
// The destroyed items etc feed in the -internal- killboard item ID.
// EVE Central needs the external ID if we have it.
$query->execute("SELECT typeID FROM kb3_invtypes WHERE typeID={$item_id}");
$data = $query->getRow();
$e_item_id = $data['typeID'];
// Don't try if the item id isn't an integer or it's 0.
if (!is_numeric($e_item_id) or 0 == $e_item_id) {
return;
}
file_put_contents(KB_CACHEDIR . '/evecentral/activity.log', "Request for {$item_id} -> {$e_item_id}\n", FILE_APPEND);
$value = ec_get_value($e_item_id);
if (-99 != $value) {
$query->execute("update kb3_item_price set price='{$value}' WHERE typeID={$item_id}");
return true;
} else {
file_put_contents(KB_CACHEDIR . '/evecentral/activity.log', "Failed to find it.\n", FILE_APPEND);
}
return false;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:36,代码来源:eve_central_sync.php
示例5: getInstance
public static function getInstance()
{
if (!DBFactory::$_instance instanceof MysqliDb) {
DBFactory::$_instance = new MysqliDB();
}
return DBFactory::$_instance;
}
开发者ID:ucev,项目名称:WeChatFrame,代码行数:7,代码来源:DBFactory.php
示例6: updateChars
private function updateChars()
{
if (empty($this->chars)) {
return $this->chars;
}
foreach ($this->chars as $char) {
// check if chars eveid exists in kb
$sql = 'select plts.plt_id, plts.plt_externalid from kb3_pilots plts where plts.plt_name = "' . $char['Name'] . '"';
$qry = DBFactory::getDBQuery();
$qry->execute($sql);
if ($qry->recordCount() != 0) {
// pilot is in kb db, check he has his char id
$row = $qry->getRow();
$pilot_id = $row['plt_id'];
$pilot_external_id = $row['plt_externalid'];
if ($pilot_external_id == 0 && $pilot_id != 0) {
// update DB with ID
$qry->execute("UPDATE kb3_pilots SET plt_externalid = " . intval($char['charID']) . "\n WHERE plt_id = " . $pilot_id);
}
} else {
// pilot is not in DB
// Set Corp
$pilotscorp = Corporation::lookup($char['corpName']);
// Check Corp was set, if not, add the Corp
if (!$pilotscorp->getID()) {
$ialliance = Alliance::add('None');
$pilotscorp = Corporation::add($char['corpName'], $ialliance, gmdate("Y-m-d H:i:s"));
}
Pilot::add($char['Name'], $pilotscorp, gmdate("Y-m-d H:i:s"), intval($char['charID']));
}
}
return;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:class.char.php
示例7: update014
function update014()
{
global $url, $smarty;
//Checking if this Update already done
if (CURRENT_DB_UPDATE < "014") {
if (is_null(config::get('014updatestatus'))) {
config::set('014updatestatus', 0);
}
$qry = DBFactory::getDBQuery(true);
if (config::get('014updatestatus') < 1) {
// Add killmail summary. time, hash, trust.
$sql = 'CREATE TABLE IF NOT EXISTS `kb3_mails` (
`kll_id` int(11) NOT NULL auto_increment,
`kll_timestamp` datetime NOT NULL default "0000-00-00 00:00:00",
`kll_external_id` int(8) default NULL,
`kll_hash` BINARY(16) NOT NULL,
`kll_trust` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`kll_id`),
UNIQUE KEY `external_id` (`kll_external_id`),
UNIQUE KEY `time_hash` (`kll_timestamp`,`kll_hash`)
) Engine=InnoDB';
$qry->execute($sql);
}
killCache();
config::set("DBUpdate", "014");
$qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '014' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '014'");
config::del("014updatestatus");
$smarty->assign('refresh', 1);
$smarty->assign('content', "Update 014 completed.");
$smarty->display('update.tpl');
die;
}
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:update.php
示例8: getLanguage
public function getLanguage()
{
if (!$this->language instanceof Language && is_numeric($this->language)) {
$this->language = DBFactory::get('languages')->get($this->language);
}
return $this->language;
}
开发者ID:ben33,项目名称:framework,代码行数:7,代码来源:AdminCore.php
示例9: update016
/**
* @package EDK
*/
function update016()
{
global $url, $smarty;
//Checking if this Update already done
if (CURRENT_DB_UPDATE < "016") {
$qry = DBFactory::getDBQuery(true);
$sql = "ALTER TABLE `kb3_mails` ADD `kll_modified_time` DATETIME NOT NULL ";
$qry->execute("SHOW COLUMNS FROM kb3_mails LIKE 'kll_modified_time'");
if (!$qry->recordCount()) {
$qry->execute($sql);
}
$sql = "ALTER TABLE `kb3_mails` ADD INDEX ( `kll_modified_time` ) ";
$qry->execute("SHOW INDEXES FROM kb3_mails");
$indexexists = false;
while ($testresult = $qry->getRow()) {
if ($testresult['Column_name'] == 'kll_modified_time') {
$indexexists = true;
}
}
if (!$indexexists) {
$qry->execute($sql);
}
config::set("DBUpdate", "016");
$qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '016' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '016'");
$smarty->assign('refresh', 1);
$smarty->assign('content', "Update 016 completed.");
$smarty->display('update.tpl');
die;
}
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:update.php
示例10: __construct
/**
* 构造方法
*
* @access public
* @param mixed $name
* @return mixed
*/
public function __construct($name)
{
$dbinfo = DBFactory::getDbInfo();
$this->tablePre = $dbinfo['tablePre'];
$this->table = $name;
$this->dbo = DBFactory::getInstance();
}
开发者ID:sammychan1981,项目名称:quanpin,代码行数:14,代码来源:query_class.php
示例11: update034
/**
* @package EDK
*/
function update034()
{
global $url, $smarty;
//Checking if this Update already done
if (CURRENT_DB_UPDATE < "034") {
if (is_null(config::get('034updatestatus'))) {
config::set('034updatestatus', 0);
}
$qry = DBFactory::getDBQuery(true);
if (config::get('034updatestatus') < 1) {
$qry->execute("SHOW COLUMNS FROM kb3_invtypes LIKE 'radius'");
if ($qry->recordCount()) {
$sql = "ALTER TABLE `kb3_invtypes` DROP COLUMN `radius` ";
$qry->execute($sql);
}
}
config::set("DBUpdate", "034");
$qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '034' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '034'");
config::del("034updatestatus");
$smarty->assign('refresh', 1);
$smarty->assign('content', "Update 034 completed.");
$smarty->display('update.tpl');
die;
}
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:28,代码来源:update.php
示例12: getAdmin
public function getAdmin()
{
if (is_null($this->admin)) {
$this->admin = DBFactory::get('admins')->get($this->getSessionParam('admin'));
}
return $this->admin;
}
开发者ID:ben33,项目名称:framework,代码行数:7,代码来源:BackofficeController.php
示例13: execQuery
function execQuery()
{
$qry = DBFactory::getDBQuery();
$qry->execute("select * from kb3_regions where reg_id = " . $this->id);
$row = $qry->getRow();
$this->name = $row['reg_name'];
$this->coords = array($row['reg_x'], $row['reg_y'], $row['reg_z']);
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:8,代码来源:class.region.php
示例14: ItemList
/**
*
* @param array $itemarray
* @param float $price
*/
function ItemList($itemarray = null, $price = 0)
{
if (isset($itemarray)) {
$this->itemarray = $itemarray;
}
$this->price = $price;
$this->qry = DBFactory::getDBQuery();
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:13,代码来源:class.itemlist.php
示例15: getShipClassIDByName
public static function getShipClassIDByName($shipClassName)
{
$query = "SELECT scl_id FROM kb3_ship_classes WHERE scl_class = '{$shipClassName}'";
$qry = DBFactory::getDBQuery();
$qry->execute($query);
$shipClassId = $qry->getRow();
return $shipClassId["scl_id"];
}
开发者ID:Salvoxia,项目名称:highlight_capitals,代码行数:8,代码来源:init.php
示例16: logKill
/**
* Log a new kill.
*
* @param integer $killid
* @param string $note
*/
public static function logKill($killid, $note = null)
{
if (is_null($note)) {
$note = "IP:" . logger::getip();
}
$qry = DBFactory::getDBQuery(true);
$qry->execute("INSERT INTO kb3_log (log_kll_id, log_site," . " log_ip_address, log_timestamp) values(" . $killid . ",'" . KB_SITE . "','" . $qry->escape($note) . "', UTC_TIMESTAMP())");
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:14,代码来源:class.logger.php
示例17: delKill
public static function delKill($kill)
{
$qry = DBFactory::getDBQuery();
$qry->execute("BEGIN");
allianceSummary::delKill($kill);
corpSummary::delKill($kill);
pilotSummary::delKill($kill);
$qry->execute("COMMIT");
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:9,代码来源:class.summarycache.php
示例18: __construct
public function __construct()
{
$this->db = DBFactory::getInstance();
$this->resultModel = new Model("result");
$this->resultListModel = new Model("result_list");
$this->examineResultModel = new Model("examine_result");
$config = Config::getInstance();
$this->jkf = $config->get('jkf');
}
开发者ID:sammychan1981,项目名称:quanpin,代码行数:9,代码来源:GatewayModel.php
示例19: update022
function update022()
{
global $url, $smarty;
//Checking if this Update already done
if (CURRENT_DB_UPDATE < "022") {
if (is_null(config::get('022updatestatus'))) {
config::set('022updatestatus', 0);
}
$qry = DBFactory::getDBQuery(true);
if (config::get('022updatestatus') < 1) {
$qry->execute("DELETE FROM `kb3_ships` WHERE `shp_externalid` = 0 AND `shp_name` NOT LIKE '%Unknown%'");
$qry->execute("DELETE FROM `kb3_ships` WHERE `shp_id` IN (206, 497, 348, 349,352, 354, 606)");
config::set('022updatestatus', 1);
$smarty->assign('refresh', 1);
$smarty->assign('content', "22. Delete unused and duplicated ships from ships table.");
$smarty->display('update.tpl');
die;
}
if (config::get('022updatestatus') < 2) {
// Add timestamp column to kb3_inv_detail
$qry->execute("SHOW INDEX FROM `kb3_ships`");
$indextexists = false;
while ($testresult = $qry->getRow()) {
if ($testresult['Column_name'] == 'shp_externalid') {
$indextexists = true;
}
}
if (!$indextexists) {
$qry->execute("ALTER TABLE `kb3_ships` ADD UNIQUE `shp_externalid` ( `shp_externalid` ) ");
config::set('022updatestatus', 2);
$smarty->assign('refresh', 1);
$smarty->assign('content', "22. Ships table added unique index for external IDs.");
$smarty->display('update.tpl');
die;
}
}
if (config::get('022updatestatus') < 3) {
//not too happy about this one but it does force the ships to use *my* IDs, as it would be if i dumped it - FRK
$qry->execute("INSERT IGNORE INTO `kb3_ships` (`shp_id` ,`shp_name` ,`shp_class` ,`shp_externalid` ,`shp_rce_id` ,`shp_baseprice` ,`shp_techlevel` ,`shp_isfaction`) VALUES (704 , 'Guristas Shuttle', '11', '21628', '1', '10000000', '1', '1');");
$qry->execute("INSERT IGNORE INTO `kb3_ships` (`shp_id` ,`shp_name` ,`shp_class` ,`shp_externalid` ,`shp_rce_id` ,`shp_baseprice` ,`shp_techlevel` ,`shp_isfaction`) VALUES (705 , 'Civilian Gallente Shuttle', '11', '27303', '8', '0', '1', '0');");
config::set('022updatestatus', 3);
$smarty->assign('refresh', 1);
$smarty->assign('content', "22. Insert missing shuttles.");
$smarty->display('update.tpl');
die;
}
killCache();
config::set("DBUpdate", "022");
$qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '022' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '022'");
config::del("022updatestatus");
$smarty->assign('refresh', 1);
$smarty->assign('content', "Update 022 completed.");
$smarty->display('update.tpl');
die;
}
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:56,代码来源:update.php
示例20: stats
function stats()
{
global $smarty;
$qry = DBFactory::getDBQuery();
$qry->execute("SELECT COUNT(*) AS cnt FROM kb3_kills");
$row = $qry->getRow();
$kills = $row['cnt'];
$smarty->assign('kills', $kills);
return $smarty->fetch(get_tpl("about_stats"));
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:10,代码来源:about.php
注:本文中的DBFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论