Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test.php :
- try
- {
- $mydb = new DBWrapper(false);
- $mydb->test1("select * from...", null, null);
- }
- catch ( Exception $ex )
- {
- die($ex->getMessage());
- }
- ---------------------
- DBWrapper.php
- public function test1($sql, $paramData = null, $paramDataInclConfigs = null)
- {
- try
- {
- $this->test2($sql, $paramData, $paramDataInclConfigs);
- }
- catch ( Exception $ex )
- {
- error_log($this->getConfig('PROJECT_NAME') . ": test1() : caught Exception! Re-throwing...", 0);
- throw $ex;
- }
- }
- private function test2()
- {
- try
- {
- $conn = &$this->getConnection();
- $dbWrapperStmt = new DBWrapperStatement($conn, $sql, $paramData, $paramDataInclConfigs, self::$debug);
- }
- catch ( Exception $ex )
- {
- error_log($this->getConfig('PROJECT_NAME') . ": test2() : caught Exception! Re-throwing...", 0);
- throw $ex;
- }
- }
- ---------------------
- DBWrapperStatement.php
- public function __construct(&$conn, $sql, $paramData = null, $paramConfig = null, $debug = false)
- {
- self::$conn = &$conn;
- self::$sql = trim($sql);
- self::$paramData = $paramData;
- self::$paramConfig = $paramConfig;
- self::$debug = $debug;
- throw new DBWrapperStatementException("TEST!!!", 0, $this->getConfig('PROJECT_NAME'), self::$debug);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement