Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into …

…develop
  • Loading branch information...
commit e641f2268ab35222879e456cfd44c65f80427790 2 parents 76a188c + 2f56fba
Timothy Warren authored
142 system/database/drivers/oci8/oci8_driver.php
... ... @@ -1,13 +1,13 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  1 +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 2 /**
3 3 * CodeIgniter
4 4 *
5 5 * An open source application development framework for PHP 5.2.4 or newer
6 6 *
7 7 * NOTICE OF LICENSE
8   - *
  8 + *
9 9 * Licensed under the Open Software License version 3.0
10   - *
  10 + *
11 11 * This source file is subject to the Open Software License (OSL 3.0) that is
12 12 * bundled with this package in the files license.txt / license.rst. It is
13 13 * also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
25 25 * @filesource
26 26 */
27 27
28   -// ------------------------------------------------------------------------
29   -
30 28 /**
31 29 * oci8 Database Adapter Class
32 30 *
@@ -50,42 +48,40 @@
50 48 * @author Kelly McArdle
51 49 *
52 50 */
53   -
54 51 class CI_DB_oci8_driver extends CI_DB {
55 52
56   - var $dbdriver = 'oci8';
  53 + public $dbdriver = 'oci8';
57 54
58 55 // The character used for excaping
59   - var $_escape_char = '"';
  56 + protected $_escape_char = '"';
60 57
61 58 // clause and character used for LIKE escape sequences
62   - var $_like_escape_str = " escape '%s' ";
63   - var $_like_escape_chr = '!';
  59 + protected $_like_escape_str = " ESCAPE '%s' ";
  60 + protected $_like_escape_chr = '!';
64 61
65 62 /**
66 63 * The syntax to count rows is slightly different across different
67 64 * database engines, so this string appears in each driver and is
68 65 * used for the count_all() and count_all_results() functions.
69 66 */
70   - var $_count_string = "SELECT COUNT(1) AS ";
71   - var $_random_keyword = ' ASC'; // not currently supported
  67 + protected $_count_string = 'SELECT COUNT(1) AS ';
  68 + protected $_random_keyword = ' ASC'; // not currently supported
72 69
73 70 // Set "auto commit" by default
74   - var $_commit = OCI_COMMIT_ON_SUCCESS;
  71 + protected $_commit = OCI_COMMIT_ON_SUCCESS;
75 72
76 73 // need to track statement id and cursor id
77   - var $stmt_id;
78   - var $curs_id;
  74 + public $stmt_id;
  75 + public $curs_id;
79 76
80 77 // if we use a limit, we will add a field that will
81 78 // throw off num_fields later
82   - var $limit_used;
  79 + public $limit_used;
83 80
84 81 /**
85 82 * Non-persistent database connection
86 83 *
87   - * @access private called by the base class
88   - * @return resource
  84 + * @return resource
89 85 */
90 86 public function db_connect()
91 87 {
@@ -97,8 +93,7 @@ public function db_connect()
97 93 /**
98 94 * Persistent database connection
99 95 *
100   - * @access private called by the base class
101   - * @return resource
  96 + * @return resource
102 97 */
103 98 public function db_pconnect()
104 99 {
@@ -113,7 +108,6 @@ public function db_pconnect()
113 108 * Keep / reestablish the db connection if no queries have been
114 109 * sent for a length of time exceeding the server's idle timeout
115 110 *
116   - * @access public
117 111 * @return void
118 112 */
119 113 public function reconnect()
@@ -127,8 +121,7 @@ public function reconnect()
127 121 /**
128 122 * Select the database
129 123 *
130   - * @access private called by the base class
131   - * @return resource
  124 + * @return resource
132 125 */
133 126 public function db_select()
134 127 {
@@ -155,9 +148,8 @@ public function version()
155 148 /**
156 149 * Execute the query
157 150 *
158   - * @access protected called by the base class
159   - * @param string an SQL query
160   - * @return resource
  151 + * @param string an SQL query
  152 + * @return resource
161 153 */
162 154 protected function _execute($sql)
163 155 {
@@ -172,25 +164,23 @@ protected function _execute($sql)
172 164 /**
173 165 * Generate a statement ID
174 166 *
175   - * @access private
176   - * @param string an SQL query
177   - * @return none
  167 + * @param string an SQL query
  168 + * @return void
178 169 */
179   - private function _set_stmt_id($sql)
  170 + protected function _set_stmt_id($sql)
180 171 {
181 172 if ( ! is_resource($this->stmt_id))
182 173 {
183 174 $this->stmt_id = oci_parse($this->conn_id, $sql);
184 175 }
185 176 }
186   -
  177 +
187 178 // --------------------------------------------------------------------
188 179
189 180 /**
190   - * getCursor. Returns a cursor from the datbase
  181 + * Get cursor. Returns a cursor from the database
191 182 *
192   - * @access public
193   - * @return cursor id
  183 + * @return cursor id
194 184 */
195 185 public function get_cursor()
196 186 {
@@ -203,11 +193,10 @@ public function get_cursor()
203 193 /**
204 194 * Stored Procedure. Executes a stored procedure
205 195 *
206   - * @access public
207   - * @param package package stored procedure is in
208   - * @param procedure stored procedure to execute
209   - * @param params array of parameters
210   - * @return array
  196 + * @param string package stored procedure is in
  197 + * @param string stored procedure to execute
  198 + * @param array parameters
  199 + * @return object
211 200 *
212 201 * params array keys
213 202 *
@@ -256,10 +245,9 @@ public function stored_procedure($package, $procedure, $params)
256 245 /**
257 246 * Bind parameters
258 247 *
259   - * @access private
260   - * @return none
  248 + * @return void
261 249 */
262   - private function _bind_params($params)
  250 + protected function _bind_params($params)
263 251 {
264 252 if ( ! is_array($params) OR ! is_resource($this->stmt_id))
265 253 {
@@ -285,7 +273,6 @@ private function _bind_params($params)
285 273 /**
286 274 * Begin Transaction
287 275 *
288   - * @access public
289 276 * @return bool
290 277 */
291 278 public function trans_begin($test_mode = FALSE)
@@ -315,7 +302,6 @@ public function trans_begin($test_mode = FALSE)
315 302 /**
316 303 * Commit Transaction
317 304 *
318   - * @access public
319 305 * @return bool
320 306 */
321 307 public function trans_commit()
@@ -341,7 +327,6 @@ public function trans_commit()
341 327 /**
342 328 * Rollback Transaction
343 329 *
344   - * @access public
345 330 * @return bool
346 331 */
347 332 public function trans_rollback()
@@ -401,8 +386,7 @@ public function escape_str($str, $like = FALSE)
401 386 /**
402 387 * Affected Rows
403 388 *
404   - * @access public
405   - * @return integer
  389 + * @return int
406 390 */
407 391 public function affected_rows()
408 392 {
@@ -414,8 +398,7 @@ public function affected_rows()
414 398 /**
415 399 * Insert ID
416 400 *
417   - * @access public
418   - * @return integer
  401 + * @return int
419 402 */
420 403 public function insert_id()
421 404 {
@@ -431,9 +414,8 @@ public function insert_id()
431 414 * Generates a platform-specific query string that counts all records in
432 415 * the specified database
433 416 *
434   - * @access public
435   - * @param string
436   - * @return string
  417 + * @param string
  418 + * @return string
437 419 */
438 420 public function count_all($table = '')
439 421 {
@@ -460,8 +442,7 @@ public function count_all($table = '')
460 442 *
461 443 * Generates a platform-specific query string so that the table names can be fetched
462 444 *
463   - * @access protected
464   - * @param boolean
  445 + * @param bool
465 446 * @return string
466 447 */
467 448 protected function _list_tables($prefix_limit = FALSE)
@@ -483,9 +464,8 @@ protected function _list_tables($prefix_limit = FALSE)
483 464 *
484 465 * Generates a platform-specific query string so that the column names can be fetched
485 466 *
486   - * @access protected
487   - * @param string the table name
488   - * @return string
  467 + * @param string the table name
  468 + * @return string
489 469 */
490 470 protected function _list_columns($table = '')
491 471 {
@@ -499,9 +479,8 @@ protected function _list_columns($table = '')
499 479 *
500 480 * Generates a platform-specific query so that the column data can be retrieved
501 481 *
502   - * @access public
503   - * @param string the table name
504   - * @return object
  482 + * @param string the table name
  483 + * @return string
505 484 */
506 485 protected function _field_data($table)
507 486 {
@@ -546,11 +525,10 @@ public function error()
546 525 *
547 526 * This function escapes column and table names
548 527 *
549   - * @access protected
550 528 * @param string
551 529 * @return string
552 530 */
553   - protected function _escape_identifiers($item)
  531 + public function _escape_identifiers($item)
554 532 {
555 533 if ($this->_escape_char == '')
556 534 {
@@ -589,9 +567,8 @@ protected function _escape_identifiers($item)
589 567 * This function implicitly groups FROM tables so there is no confusion
590 568 * about operator precedence in harmony with SQL standards
591 569 *
592   - * @access protected
593   - * @param type
594   - * @return type
  570 + * @param array
  571 + * @return string
595 572 */
596 573 protected function _from_tables($tables)
597 574 {
@@ -610,11 +587,10 @@ protected function _from_tables($tables)
610 587 *
611 588 * Generates a platform-specific insert string from the supplied data
612 589 *
613   - * @access public
614   - * @param string the table name
615   - * @param array the insert keys
616   - * @param array the insert values
617   - * @return string
  590 + * @param string the table name
  591 + * @param array the insert keys
  592 + * @param array the insert values
  593 + * @return string
618 594 */
619 595 protected function _insert($table, $keys, $values)
620 596 {
@@ -628,10 +604,10 @@ protected function _insert($table, $keys, $values)
628 604 *
629 605 * Generates a platform-specific insert string from the supplied data
630 606 *
631   - * @param string the table name
632   - * @param array the insert keys
633   - * @param array the insert values
634   - * @return string
  607 + * @param string the table name
  608 + * @param array the insert keys
  609 + * @param array the insert values
  610 + * @return string
635 611 */
636 612 protected function _insert_batch($table, $keys, $values)
637 613 {
@@ -655,7 +631,6 @@ protected function _insert_batch($table, $keys, $values)
655 631 *
656 632 * Generates a platform-specific update string from the supplied data
657 633 *
658   - * @access protected
659 634 * @param string the table name
660 635 * @param array the update data
661 636 * @param array the where clause
@@ -692,7 +667,6 @@ protected function _update($table, $values, $where, $orderby = array(), $limit =
692 667 * If the database does not support the truncate() command
693 668 * This function maps to "DELETE FROM table"
694 669 *
695   - * @access protected
696 670 * @param string the table name
697 671 * @return string
698 672 */
@@ -708,7 +682,6 @@ protected function _truncate($table)
708 682 *
709 683 * Generates a platform-specific delete string from the supplied data
710 684 *
711   - * @access protected
712 685 * @param string the table name
713 686 * @param array the where clause
714 687 * @param string the limit clause
@@ -742,11 +715,10 @@ protected function _delete($table, $where = array(), $like = array(), $limit = F
742 715 *
743 716 * Generates a platform-specific LIMIT clause
744 717 *
745   - * @access protected
746   - * @param string the sql query string
747   - * @param integer the number of rows to limit the query to
748   - * @param integer the offset value
749   - * @return string
  718 + * @param string the sql query string
  719 + * @param int the number of rows to limit the query to
  720 + * @param int the offset value
  721 + * @return string
750 722 */
751 723 protected function _limit($sql, $limit, $offset)
752 724 {
@@ -769,16 +741,14 @@ protected function _limit($sql, $limit, $offset)
769 741 /**
770 742 * Close DB Connection
771 743 *
772   - * @access protected
773   - * @param resource
774   - * @return void
  744 + * @param resource
  745 + * @return void
775 746 */
776 747 protected function _close($conn_id)
777 748 {
778 749 @oci_close($conn_id);
779 750 }
780 751
781   -
782 752 }
783 753
784 754 /* End of file oci8_driver.php */
27 system/database/drivers/oci8/oci8_forge.php
... ... @@ -1,13 +1,13 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  1 +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 2 /**
3 3 * CodeIgniter
4 4 *
5 5 * An open source application development framework for PHP 5.2.4 or newer
6 6 *
7 7 * NOTICE OF LICENSE
8   - *
  8 + *
9 9 * Licensed under the Open Software License version 3.0
10   - *
  10 + *
11 11 * This source file is subject to the Open Software License (OSL 3.0) that is
12 12 * bundled with this package in the files license.txt / license.rst. It is
13 13 * also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
25 25 * @filesource
26 26 */
27 27
28   -// ------------------------------------------------------------------------
29   -
30 28 /**
31 29 * Oracle Forge Class
32 30 *
@@ -39,11 +37,10 @@ class CI_DB_oci8_forge extends CI_DB_forge {
39 37 /**
40 38 * Create database
41 39 *
42   - * @access public
43 40 * @param string the database name
44 41 * @return bool
45 42 */
46   - function _create_database($name)
  43 + public function _create_database($name)
47 44 {
48 45 return FALSE;
49 46 }
@@ -53,11 +50,10 @@ function _create_database($name)
53 50 /**
54 51 * Drop database
55 52 *
56   - * @access private
57 53 * @param string the database name
58 54 * @return bool
59 55 */
60   - function _drop_database($name)
  56 + public function _drop_database($name)
61 57 {
62 58 return FALSE;
63 59 }
@@ -144,10 +140,9 @@ public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exi
144 140 /**
145 141 * Drop Table
146 142 *
147   - * @access private
148 143 * @return bool
149 144 */
150   - function _drop_table($table)
  145 + public function _drop_table($table)
151 146 {
152 147 return FALSE;
153 148 }
@@ -160,17 +155,16 @@ function _drop_table($table)
160 155 * Generates a platform-specific query so that a table can be altered
161 156 * Called by add_column(), drop_column(), and column_alter(),
162 157 *
163   - * @access private
164 158 * @param string the ALTER type (ADD, DROP, CHANGE)
165 159 * @param string the column name
166 160 * @param string the table name
167 161 * @param string the column definition
168 162 * @param string the default value
169   - * @param boolean should 'NOT NULL' be added
  163 + * @param bool should 'NOT NULL' be added
170 164 * @param string the field after which we should add the new field
171   - * @return object
  165 + * @return string
172 166 */
173   - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
  167 + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
174 168 {
175 169 $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name);
176 170
@@ -212,12 +206,11 @@ function _alter_table($alter_type, $table, $column_name, $column_definition = ''
212 206 *
213 207 * Generates a platform-specific query so that a table can be renamed
214 208 *
215   - * @access private
216 209 * @param string the old table name
217 210 * @param string the new table name
218 211 * @return string
219 212 */
220   - function _rename_table($table_name, $new_table_name)
  213 + public function _rename_table($table_name, $new_table_name)
221 214 {
222 215 return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
223 216 }
33 system/database/drivers/oci8/oci8_result.php
... ... @@ -1,13 +1,13 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  1 +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 2 /**
3 3 * CodeIgniter
4 4 *
5 5 * An open source application development framework for PHP 5.2.4 or newer
6 6 *
7 7 * NOTICE OF LICENSE
8   - *
  8 + *
9 9 * Licensed under the Open Software License version 3.0
10   - *
  10 + *
11 11 * This source file is subject to the Open Software License (OSL 3.0) that is
12 12 * bundled with this package in the files license.txt / license.rst. It is
13 13 * also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
25 25 * @filesource
26 26 */
27 27
28   -// ------------------------------------------------------------------------
29   -
30 28 /**
31 29 * oci8 Result Class
32 30 *
@@ -57,9 +55,7 @@ public function __construct(&$driver_object)
57 55 * Oracle doesn't have a graceful way to retun the number of rows
58 56 * so we have to use what amounts to a hack.
59 57 *
60   - *
61   - * @access public
62   - * @return integer
  58 + * @return int
63 59 */
64 60 public function num_rows()
65 61 {
@@ -82,8 +78,7 @@ public function num_rows()
82 78 /**
83 79 * Number of fields in the result set
84 80 *
85   - * @access public
86   - * @return integer
  81 + * @return int
87 82 */
88 83 public function num_fields()
89 84 {
@@ -105,7 +100,6 @@ public function num_fields()
105 100 *
106 101 * Generates an array of column names
107 102 *
108   - * @access public
109 103 * @return array
110 104 */
111 105 public function list_fields()
@@ -125,8 +119,7 @@ public function list_fields()
125 119 *
126 120 * Generates an array of objects containing field meta-data
127 121 *
128   - * @access public
129   - * @return array
  122 + * @return array
130 123 */
131 124 public function field_data()
132 125 {
@@ -149,7 +142,7 @@ public function field_data()
149 142 /**
150 143 * Free the result
151 144 *
152   - * @return null
  145 + * @return void
153 146 */
154 147 public function free_result()
155 148 {
@@ -167,8 +160,7 @@ public function free_result()
167 160 *
168 161 * Returns the result set as an array
169 162 *
170   - * @access protected
171   - * @return array
  163 + * @return array
172 164 */
173 165 protected function _fetch_assoc()
174 166 {
@@ -183,8 +175,7 @@ protected function _fetch_assoc()
183 175 *
184 176 * Returns the result set as an object
185 177 *
186   - * @access protected
187   - * @return object
  178 + * @return object
188 179 */
189 180 protected function _fetch_object()
190 181 {
@@ -197,8 +188,7 @@ protected function _fetch_object()
197 188 /**
198 189 * Query result. "array" version.
199 190 *
200   - * @access public
201   - * @return array
  191 + * @return array
202 192 */
203 193 public function result_array()
204 194 {
@@ -221,11 +211,10 @@ public function result_array()
221 211 /**
222 212 * Data Seek
223 213 *
224   - * Moves the internal pointer to the desired offset. We call
  214 + * Moves the internal pointer to the desired offset. We call
225 215 * this internally before fetching results to make sure the
226 216 * result set starts at zero
227 217 *
228   - * @access protected
229 218 * @return array
230 219 */
231 220 protected function _data_seek($n = 0)
25 system/database/drivers/oci8/oci8_utility.php
... ... @@ -1,13 +1,13 @@
1   -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  1 +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 2 /**
3 3 * CodeIgniter
4 4 *
5 5 * An open source application development framework for PHP 5.2.4 or newer
6 6 *
7 7 * NOTICE OF LICENSE
8   - *
  8 + *
9 9 * Licensed under the Open Software License version 3.0
10   - *
  10 + *
11 11 * This source file is subject to the Open Software License (OSL 3.0) that is
12 12 * bundled with this package in the files license.txt / license.rst. It is
13 13 * also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
25 25 * @filesource
26 26 */
27 27
28   -// ------------------------------------------------------------------------
29   -
30 28 /**
31 29 * Oracle Utility Class
32 30 *
@@ -39,10 +37,9 @@ class CI_DB_oci8_utility extends CI_DB_utility {
39 37 /**
40 38 * List databases
41 39 *
42   - * @access private
43 40 * @return bool
44 41 */
45   - function _list_databases()
  42 + public function _list_databases()
46 43 {
47 44 return FALSE;
48 45 }
@@ -54,11 +51,10 @@ function _list_databases()
54 51 *
55 52 * Generates a platform-specific query so that a table can be optimized
56 53 *
57   - * @access private
58 54 * @param string the table name
59   - * @return object
  55 + * @return bool
60 56 */
61   - function _optimize_table($table)
  57 + public function _optimize_table($table)
62 58 {
63 59 return FALSE; // Is this supported in Oracle?
64 60 }
@@ -70,11 +66,10 @@ function _optimize_table($table)
70 66 *
71 67 * Generates a platform-specific query so that a table can be repaired
72 68 *
73   - * @access private
74 69 * @param string the table name
75   - * @return object
  70 + * @return bool
76 71 */
77   - function _repair_table($table)
  72 + public function _repair_table($table)
78 73 {
79 74 return FALSE; // Is this supported in Oracle?
80 75 }
@@ -84,15 +79,15 @@ function _repair_table($table)
84 79 /**
85 80 * Oracle Export
86 81 *
87   - * @access private
88 82 * @param array Preferences
89 83 * @return mixed
90 84 */
91   - function _backup($params = array())
  85 + public function _backup($params = array())
92 86 {
93 87 // Currently unsupported
94 88 return $this->db->display_error('db_unsuported_feature');
95 89 }
  90 +
96 91 }
97 92
98 93 /* End of file oci8_utility.php */

0 comments on commit e641f22

Please sign in to comment.
Something went wrong with that request. Please try again.