當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBFactory::getInstance方法代碼示例

本文整理匯總了PHP中DBFactory::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBFactory::getInstance方法的具體用法?PHP DBFactory::getInstance怎麽用?PHP DBFactory::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBFactory的用法示例。


在下文中一共展示了DBFactory::getInstance方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __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

示例2: __construct

 /**
  * 構造方法
  * 
  * @access public
  * @param mixed $name
  */
 public function __construct($name = null)
 {
     $this->db = DBFactory::getInstance();
     $dbinfo = DBFactory::getDbInfo();
     $this->prefix = $dbinfo['tablePre'];
     $this->table($name);
 }
開發者ID:sammychan1981,項目名稱:quanpin,代碼行數:13,代碼來源:model_class.php

示例3: __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

示例4: update

 public function update()
 {
     $updateFile = Tiny::getPath('data') . 'update.php';
     $this->assign('status', '0');
     if (file_exists($updateFile)) {
         $updateInfo = (include $updateFile);
         if (isset($updateInfo['version'])) {
             $version = $updateInfo['version'];
             $versionFile = APP_CODE_ROOT . 'version.php';
             $currentVersion = (include $versionFile);
             if ($currentVersion == $version[0]) {
                 $do = Req::args('do');
                 if ($do == 'yes') {
                     $dbinfo = DBFactory::getDbInfo();
                     $this->assign('status', '1');
                     if (isset($updateInfo['sql'][$dbinfo['type']])) {
                         $sqls = $updateInfo['sql'][$dbinfo['type']];
                         $db = DBFactory::getInstance();
                         if (is_array($sqls)) {
                             foreach ($sqls as $sql) {
                                 $db->doSql($sql);
                             }
                         }
                         File::putContents($versionFile, "<?php return '{$version[1]}';?>");
                         unlink($updateFile);
                         $this->assign('info', '升級成功!');
                     } else {
                         $this->assign('info', '不支持' . $dbinfo['type'] . '數據庫類型的升級!');
                     }
                 } else {
                     $this->assign('info', '係統可從當前版本:' . $currentVersion . '升級到' . $version[1]);
                 }
             } else {
                 $this->assign('status', '-1');
                 $this->assign('info', '沒有可升級的信息!');
             }
         } else {
             $this->assign('status', '-1');
             $this->assign('info', '沒有可升級的信息!');
         }
     } else {
         $this->assign('status', '-1');
         $this->assign('info', '沒有可升級的信息!');
     }
     $this->redirect();
 }
開發者ID:sammychan1981,項目名稱:quanpin,代碼行數:46,代碼來源:admin.php

示例5: set_exception_handler

<?php

include 'variables.php';
include 'functions.php';
include 'DBFactory.php';
// Top Level Exception handler
set_exception_handler('uncaught_exception_handler');
// Datenbank Objekt holen
$db = DBFactory::getInstance();
// Wenn es die Tabelle nicht gibt, dann soll diese erzeugt werden
$sql = 'CREATE TABLE IF NOT EXISTS Statistics (
		`key` VARCHAR(50) NOT NULL,
		`index` VARCHAR(50) NOT NULL,
		`value` VARCHAR(50) NOT NULL)';
if (!($stmt = $db->prepare($sql))) {
    echo 'ERROR: ' . $db->error;
    return;
}
if (!$stmt->execute()) {
    echo 'ERROR: ' . $stmt->error;
    return;
}
$stmt->close();
// Variable zum auslesen des updatestrings
$update = "nothing defined";
// Wenn ein Updatestring übergeben wurde, ...
if (isset($_POST['update'])) {
    // dann diesen auslesen
    $update = $_POST['update'];
    // Den updatestring splitten
    $frags = array();
開發者ID:amjadtbssm,項目名稱:bomberfield,代碼行數:31,代碼來源:updateStatistics.php

示例6: __construct

 /**
  * 構造函數
  * 
  * @access public
  * @return mixed
  */
 public function __construct()
 {
     $this->db = DBFactory::getInstance();
 }
開發者ID:sammychan1981,項目名稱:quanpin,代碼行數:10,代碼來源:backup_class.php

示例7: __construct

 function __construct()
 {
     $this->_tableName = "ctoken";
     $this->_db = DBFactory::getInstance();
 }
開發者ID:ucev,項目名稱:WeChatFrame,代碼行數:5,代碼來源:STO.php


注:本文中的DBFactory::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。