예제 #1
0
 /**
  * Overloaded constructor, allows us to set up error codes and connect to
  * the database.
  *
  * @param   Container $container Configuration array
  */
 public function __construct(Container $container)
 {
     parent::__construct($container);
     // Set up allowed error codes
     $this->allowedErrorCodes = array();
     // Set up allowed comment delimiters
     $this->comment = array('#', '\'-- ', '---', '/*!');
     // Connect to the database
     $this->getDatabase();
     // Suppress foreign key checks
     if ($this->getParam('foreignkey', 1)) {
         // Nothing. PostgreSQL does not support that
     }
 }
예제 #2
0
파일: Mysqli.php 프로젝트: edrdesigner/awf
 /**
  * Overloaded constructor, allows us to set up error codes and connect to
  * the database.
  *
  * @param   Container $container The container we are attached to
  */
 public function __construct(Container $container)
 {
     parent::__construct($container);
     // Set up allowed error codes
     $this->allowedErrorCodes = array(1262, 1263, 1264, 1265, 1266, 1287, 1299);
     // Set up allowed comment delimiters
     $this->comment = array('#', '\'-- ', '---', '/*!');
     // Connect to the database
     $this->getDatabase();
     // Suppress foreign key checks
     if ($this->getParam('foreignkey', 1)) {
         $this->db->setQuery('SET FOREIGN_KEY_CHECKS = 0');
         try {
             $this->db->execute();
         } catch (\Exception $exc) {
             // Do nothing if that fails. Maybe we can continue with the restoration.
         }
     }
 }
예제 #3
0
파일: Sqlsrv.php 프로젝트: edrdesigner/awf
 /**
  * Overloaded constructor, allows us to set up error codes and connect to
  * the database.
  *
  * @param   Container $container Configuration array
  */
 public function __construct(Container $container)
 {
     parent::__construct($container);
     // Set up allowed error codes
     $this->allowedErrorCodes = array();
     // Set up allowed comment delimiters
     $this->comment = array('#', '\'-- ', '---', '/*!');
     // Connect to the database
     $this->getDatabase();
     // Suppress foreign key checks
     if ($this->getParam('foreignkey')) {
         $this->db->setQuery('EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"');
         try {
             $this->db->execute();
         } catch (\Exception $exc) {
             // Do nothing if that fails. Maybe we can continue with the restoration.
         }
     }
 }