1 | <?php |
||
7 | abstract class ConnectionBase implements ConnectionInterface |
||
8 | { |
||
9 | /** |
||
10 | * The connection parameters for the database server. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $connection_params = array('host' => '127.0.0.1', 'port' => 9306, 'socket' => null); |
||
15 | |||
16 | /** |
||
17 | * Internal connection object. |
||
18 | */ |
||
19 | protected $connection = null; |
||
20 | |||
21 | /** |
||
22 | * Disables any warning outputs returned on the connection with @ prefix. |
||
23 | * |
||
24 | * @var boolean |
||
25 | */ |
||
26 | protected $silence_connection_warning = false; |
||
27 | |||
28 | /** |
||
29 | * Sets one or more connection parameters. |
||
30 | * |
||
31 | * @param array $params Associative array of parameters and values. |
||
32 | */ |
||
33 | public function setParams(Array $params) |
||
39 | |||
40 | /** |
||
41 | * Set a single connection parameter. Valid parameters include: |
||
42 | * |
||
43 | * * string host - The hostname, IP address, or unix socket |
||
44 | * * int port - The port to the host |
||
45 | * * array options - MySQLi options/values, as an associative array. Example: array(MYSQLI_OPT_CONNECT_TIMEOUT => 2) |
||
46 | * |
||
47 | * @param string $param Name of the parameter to modify. |
||
48 | * @param mixed $value Value to which the parameter will be set. |
||
49 | */ |
||
50 | public function setParam($param, $value) |
||
68 | |||
69 | /** |
||
70 | * Returns the connection parameters (host, port, connection timeout) for the current instance. |
||
71 | * |
||
72 | * @return array $params The current connection parameters |
||
73 | */ |
||
74 | public function getParams() |
||
78 | |||
79 | /** |
||
80 | * Returns the current connection established. |
||
81 | * |
||
82 | * @return object Internal connection object |
||
83 | * @throws ConnectionException If no connection has been established or open |
||
84 | */ |
||
85 | public function getConnection() |
||
93 | |||
94 | /** |
||
95 | * Adds quotes around values when necessary. |
||
96 | * Based on FuelPHP's quoting function. |
||
97 | * |
||
98 | * @param Expression|string $value The input string, eventually wrapped in an expression to leave it untouched |
||
99 | * |
||
100 | * @return Expression|string|int The untouched Expression or the quoted string |
||
101 | */ |
||
102 | public function quote($value) |
||
125 | |||
126 | /** |
||
127 | * Calls $this->quote() on every element of the array passed. |
||
128 | * |
||
129 | * @param array $array The array of strings to quote |
||
130 | * |
||
131 | * @return array The array of quotes strings |
||
132 | */ |
||
133 | public function quoteArr(Array $array = array()) |
||
143 | |||
144 | /** |
||
145 | * Establishes a connection if needed |
||
146 | * @throws ConnectionException |
||
147 | */ |
||
148 | protected function ensureConnection() |
||
156 | |||
157 | /** |
||
158 | * Forces the connection to suppress all errors returned. This should only be used |
||
159 | * when the production server is running with high error reporting settings. |
||
160 | * |
||
161 | * @param boolean $enable True if it should be enabled, false if it should be disabled |
||
162 | * @deprecated |
||
163 | * not good |
||
164 | */ |
||
165 | public function silenceConnectionWarning($enable = true) |
||
169 | } |
||
170 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.