Solar_Sql_Adapter::_postConnect PHP Method

_postConnect() protected method

After connection, set various connection attributes.
protected _postConnect ( ) : void
return void
    protected function _postConnect()
    {
        // always emulate prepared statements; this is faster, and works
        // better with CREATE, DROP, ALTER statements.  requires PHP 5.1.3
        // or later. note that we do this *first* (before using exceptions)
        // because not all adapters support it.
        $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
        $this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
        // always use exceptions
        $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        // force names to lower case
        $this->_pdo->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
    }

Usage Example

コード例 #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);
 }
All Usage Examples Of Solar_Sql_Adapter::_postConnect