当前位置: 首页>>代码示例>>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;未经允许,请勿转载。