Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
/*
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">