本文整理匯總了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">