Пример #1
0
 public function __construct($usePropel = true)
 {
     $this->usePropel = $usePropel;
     if ($this->usePropel) {
         $this->logger = Tlog::getInstance();
         $this->logger->setLevel(Tlog::DEBUG);
     } else {
         $this->logs = [];
     }
     $dbConfig = null;
     try {
         $dbConfig = $this->getDatabaseConfig();
     } catch (ParseException $ex) {
         throw new UpdateException("database.yml is not a valid file : " . $ex->getMessage());
     }
     try {
         $this->connection = new \PDO($dbConfig['dsn'], $dbConfig['user'], $dbConfig['password']);
     } catch (\PDOException $ex) {
         throw new UpdateException('Wrong connection information' . $ex->getMessage());
     }
 }