Exemplo n.º 1
0
 function __construct()
 {
     if (!isset(self::$PDO)) {
         $dsn = \woo\base\ApplicationRegistry::getDSN();
         if (is_null($dsn)) {
             throw new \woo\base\AppException("No DSN");
         }
         self::$PDO = new \PDO($dsn);
         self::$PDO->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     }
 }
Exemplo n.º 2
0
 function __construct()
 {
     if (!isset(self::$PDO)) {
         $dsn = ApplicationRegistry::getDSN();
         if (is_null($dsn)) {
             throw new AppException('DSN не определен');
         }
         self::$PDO = new \PDO($dsn);
         self::$PDO->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     }
 }