summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-20 22:04:13 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-20 22:04:13 +0100
commit9fd79f568beb10194f3de66b14a484c2dddcaa95 (patch)
treed13b309af51a84e9c3a725150d9dcbf87aef8882 /system/database/drivers
parentbe22c5bcbea252da8133f5e3a2403f2e6bfcf90a (diff)
Visibility declarations and cleanup for PDO forge and utility classes
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/pdo/pdo_forge.php32
-rw-r--r--system/database/drivers/pdo/pdo_utility.php24
2 files changed, 21 insertions, 35 deletions
diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php
index 2e5c81de3..6bff3542f 100644
--- a/system/database/drivers/pdo/pdo_forge.php
+++ b/system/database/drivers/pdo/pdo_forge.php
@@ -1,13 +1,13 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
- *
+ *
* Licensed under the Open Software License version 3.0
- *
+ *
* This source file is subject to the Open Software License (OSL 3.0) that is
* bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* PDO Forge Class
*
@@ -39,11 +37,10 @@ class CI_DB_pdo_forge extends CI_DB_forge {
/**
* Create database
*
- * @access private
* @param string the database name
* @return bool
*/
- function _create_database()
+ public function _create_database()
{
// PDO has no "create database" command since it's
// designed to connect to an existing database
@@ -59,11 +56,10 @@ class CI_DB_pdo_forge extends CI_DB_forge {
/**
* Drop database
*
- * @access private
* @param string the database name
* @return bool
*/
- function _drop_database($name)
+ public function _drop_database($name)
{
// PDO has no "drop database" command since it's
// designed to connect to an existing database
@@ -79,15 +75,14 @@ class CI_DB_pdo_forge extends CI_DB_forge {
/**
* Create Table
*
- * @access private
* @param string the table name
* @param array the fields
* @param mixed primary key(s)
* @param mixed key(s)
- * @param boolean should 'IF NOT EXISTS' be added to the SQL
+ * @param bool should 'IF NOT EXISTS' be added to the SQL
* @return bool
*/
- function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
{
$sql = 'CREATE TABLE ';
@@ -191,10 +186,9 @@ class CI_DB_pdo_forge extends CI_DB_forge {
/**
* Drop Table
*
- * @access private
* @return bool
*/
- function _drop_table($table)
+ public function _drop_table($table)
{
// Not a supported PDO feature
if ($this->db->db_debug)
@@ -212,17 +206,16 @@ class CI_DB_pdo_forge extends CI_DB_forge {
* Generates a platform-specific query so that a table can be altered
* Called by add_column(), drop_column(), and column_alter(),
*
- * @access private
* @param string the ALTER type (ADD, DROP, CHANGE)
* @param string the column name
* @param string the table name
* @param string the column definition
* @param string the default value
- * @param boolean should 'NOT NULL' be added
+ * @param bool should 'NOT NULL' be added
* @param string the field after which we should add the new field
- * @return object
+ * @return string
*/
- function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
+ public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
{
$sql = 'ALTER TABLE `'.$this->db->protect_identifiers($table).'` '.$alter_type.' '.$this->db->protect_identifiers($column_name);
@@ -265,12 +258,11 @@ class CI_DB_pdo_forge extends CI_DB_forge {
*
* Generates a platform-specific query so that a table can be renamed
*
- * @access private
* @param string the old table name
* @param string the new table name
* @return string
*/
- function _rename_table($table_name, $new_table_name)
+ public function _rename_table($table_name, $new_table_name)
{
return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
}
diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php
index c278c5172..86c798397 100644
--- a/system/database/drivers/pdo/pdo_utility.php
+++ b/system/database/drivers/pdo/pdo_utility.php
@@ -1,13 +1,13 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
- *
+ *
* Licensed under the Open Software License version 3.0
- *
+ *
* This source file is subject to the Open Software License (OSL 3.0) that is
* bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* PDO Utility Class
*
@@ -39,10 +37,9 @@ class CI_DB_pdo_utility extends CI_DB_utility {
/**
* List databases
*
- * @access private
* @return bool
*/
- function _list_databases()
+ public function _list_databases()
{
// Not sure if PDO lets you list all databases...
if ($this->db->db_debug)
@@ -59,11 +56,10 @@ class CI_DB_pdo_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be optimized
*
- * @access private
* @param string the table name
- * @return object
+ * @return bool
*/
- function _optimize_table($table)
+ public function _optimize_table($table)
{
// Not a supported PDO feature
if ($this->db->db_debug)
@@ -80,11 +76,10 @@ class CI_DB_pdo_utility extends CI_DB_utility {
*
* Generates a platform-specific query so that a table can be repaired
*
- * @access private
* @param string the table name
- * @return object
+ * @return bool
*/
- function _repair_table($table)
+ public function _repair_table($table)
{
// Not a supported PDO feature
if ($this->db->db_debug)
@@ -99,11 +94,10 @@ class CI_DB_pdo_utility extends CI_DB_utility {
/**
* PDO Export
*
- * @access private
* @param array Preferences
* @return mixed
*/
- function _backup($params = array())
+ public function _backup($params = array())
{
// Currently unsupported
return $this->db->display_error('db_unsuported_feature');