~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/Db/Adapter/Oracle/Exception.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Zend Framework
 
4
 *
 
5
 * LICENSE
 
6
 *
 
7
 * This source file is subject to the new BSD license that is bundled
 
8
 * with this package in the file LICENSE.txt.
 
9
 * It is also available through the world-wide-web at this URL:
 
10
 * http://framework.zend.com/license/new-bsd
 
11
 * If you did not receive a copy of the license and are unable to
 
12
 * obtain it through the world-wide-web, please send an email
 
13
 * to license@zend.com so we can send you a copy immediately.
 
14
 *
 
15
 * @category   Zend
 
16
 * @package    Zend_Db
 
17
 * @subpackage Adapter
 
18
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
19
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
20
 */
 
21
 
 
22
/**
 
23
 * Zend_Db_Adapter_Exception
 
24
 */
 
25
require_once 'Zend/Db/Adapter/Exception.php';
 
26
 
 
27
/**
 
28
 * Zend_Db_Adapter_Oracle_Exception
 
29
 *
 
30
 * @category   Zend
 
31
 * @package    Zend_Db
 
32
 * @subpackage Adapter
 
33
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
34
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
35
 */
 
36
class Zend_Db_Adapter_Oracle_Exception extends Zend_Db_Adapter_Exception
 
37
{
 
38
   protected $message = 'Unknown exception';
 
39
   protected $code = 0;
 
40
 
 
41
   function __construct($error = null, $code = 0) {
 
42
       if (is_array($error)) {
 
43
            if (!isset($error['offset'])) {
 
44
                $this->message = $error['code'] .' '. $error['message'];
 
45
            } else {
 
46
                $this->message = $error['code'] .' '. $error['message']." "
 
47
                               . substr($error['sqltext'], 0, $error['offset'])
 
48
                               . "*"
 
49
                               . substr($error['sqltext'], $error['offset']);
 
50
            }
 
51
            $this->code = $error['code'];
 
52
       } else if (is_string($error)) {
 
53
           $this->message = $error;
 
54
       }
 
55
       if (!$this->code && $code) {
 
56
           $this->code = $code;
 
57
       }
 
58
   }
 
59
}