本文整理汇总了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;
}
}
示例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">