src/Database/Db.php
protected function initOptions(PDO $pdo)
    {
        // set time zone
        if (isset($this->config['timezone']))
        {
            $pdo->prepare('set time_zone="' . $this->config['timezone'] . '"')->execute();
        }

        //set charset
        if (isset($this->config['charset']))
        {
            $pdo->prepare('set names "' . $this->config['charset'] . '"')->execute();
        }

        // set strict mode
        if (isset($this->config['strict']) && $this->config['strict'])
        {
            $pdo->prepare("set session sql_mode='STRICT_ALL_TABLES'")->execute();
        }

        return $pdo;
    }
protected function initOptions(PDO $pdo)
    {
        // set time zone
        if (isset($this->config['timezone']))
        {
            $pdo->prepare('set time_zone="' . $this->config['timezone'] . '"')->execute();
        }

        //set charset
        if (isset($this->config['charset']))
        {
            $pdo->prepare('set names "' . $this->config['charset'] . '"')->execute();
        }

        // set strict mode
        if (isset($this->config['strict']) && $this->config['strict'])
        {
            $pdo->prepare("set session sql_mode='STRICT_ALL_TABLES'")->execute();
        }

        return $pdo;
    }
protected function initOptions ( PDO $ pdo ) { // set time zone if ( isset ( $ this -> config [ 'timezone' ] ) ) { $ pdo -> prepare ( 'set time_zone="' . $ this -> config [ 'timezone' ] . '"' ) -> execute ( ) ; } //set charset if ( isset ( $ this -> config [ 'charset' ] ) ) { $ pdo -> prepare ( 'set names "' . $ this -> config [ 'charset' ] . '"' ) -> execute ( ) ; } // set strict mode if ( isset ( $ this -> config [ 'strict' ] ) && $ this -> config [ 'strict' ] ) { $ pdo -> prepare ( "set session sql_mode='STRICT_ALL_TABLES'" ) -> execute ( ) ; } return $ pdo ; }
init pdo connection options after instance
@param PDO $pdo
@return PDO
init pdo connection options after instance