_postConnect() protected method

After connection, set various connection attributes.
protected _postConnect ( ) : void
return void
コード例 #1
0
ファイル: Oracle.php プロジェクト: kalkin/solarphp
 /**
  * 
  * Extend base adapter function to add stringify to the calls.
  * 
  * After connection, set various connection attributes.
  * 
  * @return void
  * 
  */
 protected function _postConnect()
 {
     parent::_postConnect();
     $alter = "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'";
     $this->query($alter);
     $this->_pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
 }
コード例 #2
0
ファイル: Sqlite.php プロジェクト: agentile/foresmo
 /**
  * 
  * After connection, set various connection attributes.
  * 
  * @return void
  * 
  */
 protected function _postConnect()
 {
     parent::_postConnect();
     $this->query("PRAGMA encoding = 'UTF-8';");
     // // these don't actually work in 3.x yet :-/
     // $this->query("PRAGMA short_column_names = 1;");
     // $this->query("PRAGMA full_column_names = 0;");
 }