コード例 #1
0
ファイル: db.php プロジェクト: Combustible/core
 /**
  * The existing database connection is closed and connected again
  */
 public static function reconnect()
 {
     if (self::$connection) {
         self::$connection->close();
         self::$connection->connect();
     }
 }
コード例 #2
0
ファイル: mdb2schemamanager.php プロジェクト: Romua1d/core
 /**
  * @param \Doctrine\DBAL\Schema\Schema|\Doctrine\DBAL\Schema\SchemaDiff $schema
  * @return bool
  */
 private function executeSchemaChange($schema)
 {
     $this->conn->beginTransaction();
     foreach ($schema->toSql($this->conn->getDatabasePlatform()) as $sql) {
         $this->conn->query($sql);
     }
     $this->conn->commit();
     if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) {
         $this->conn->close();
         $this->conn->connect();
     }
     return true;
 }
コード例 #3
0
ファイル: mdb2schemamanager.php プロジェクト: hjimmy/owncloud
 /**
  * @param \OC\DB\Connection $conn
  */
 public function __construct($conn)
 {
     $this->conn = $conn;
     $this->conn->close();
     $this->conn->connect();
 }