-<?php
-/*=====================================================================*\
-|| ###################################################################
-|| # ISSO
-|| # Copyright (c)2005-2008 Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version 2 of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-class MyPDO extends PDO
-{
- public $history = array();
-
- public function __construct()
- {
- $args = func_get_args();
- call_user_func_array(array($this, 'parent::__construct'), $args);
- $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('MyStatement', array($this)));
- }
-
- public function exec()
- {
- $args = func_get_args();
- echo 'hi';
- call_user_func_array(array($this, 'parent::exec'), $args);
- $this->history[] = func_get_args();
- }
-
- public function query()
- {
- echo 'moo';
- $args = func_get_args();
- call_user_func_array(array($this, 'parent::query'), $args);
- $this->history[] = $args;
- }
-}
-
-class MyStatement extends PDOStatement
-{
- private $pdo;
-
- private function __construct($pdo)
- {
- $this->pdo = $pdo;
- }
-
- public function execute()
- {
- $args = func_get_args();
- call_user_func_array(array($this, 'parent::execute'), $args);
- $this->pdo->history[] = $this->queryString;
- }
-
- public function query()
- {
- $args = func_get_args();
- call_user_func_array(array($this, 'parent::query'), $args);
- $this->pdo->history[] = $this->queryString;
- }
-}
-
-$db = new MyPDO('mysql:host=localhost;dbname=test', 'mysql', 'elssur');
-
-$smt = $db->prepare("SELECT * FROM user WHERE userid = :hi");
-$smt->bindValue('hi', null);
-// echo $smt;
-// $smt->execute(array(1));
-
-$smt->execute();
-
-print_r($smt->fetch());
-
-print_r($db->history);
-
-?>
\ No newline at end of file