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


PHP Driver::loadDriver方法代碼示例

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


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

示例1: connectDB

 private function connectDB()
 {
     $this->settings = $this->config->getDBAccess();
     $settings = $this->settings;
     try {
         $this->db = new PDO(Driver::loadDriver($settings['db']['type'], $settings['db']['host'], $settings['db']['db_name'], $settings['db']['path']), $settings['db']['username'], $settings['db']['password']);
         $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
     } catch (PDOException $ex) {
         echo $ex->getMessage();
         exit;
     }
 }
開發者ID:soarmorrow,項目名稱:kindergarden,代碼行數:13,代碼來源:db.class.php

示例2: ini_set

/*
NOTE : Some of the code has been trimmed due to security reasons. 
*/
ini_set('max_execution_time', 60 * 60 * 2);
ini_set('post_max_size', '100M');
ini_set('upload_max_filesize', '100M');
ini_set('max_input_time', 5000);
ini_set('memory_limit', '1000M');
require_once "./class/config.class.php";
require_once "./class/driver.class.php";
require_once "./class/functions.class.php";
define('APPLICATION_PATH', __DIR__);
$config = new Config();
$settings = $config->getDBAccess();
try {
    $db = new PDO(Driver::loadDriver($settings['db']['type'], $settings['db']['host'], $settings['db']['db_name'], $settings['db']['path']), $settings['db']['username'], $settings['db']['password']);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
    $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $ex) {
    echo $ex->getMessage();
    exit;
}
?>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Video upload</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="custom video uploader">
    <meta name="author" content="SoarMorrow Solutions">
開發者ID:vineethkrishnan,項目名稱:video_manager,代碼行數:31,代碼來源:index.php


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