Skip to content

Commit

Permalink
DocBlocks for base DB classes
Browse files Browse the repository at this point in the history
Partially fixes issue bcit-ci#1295.
  • Loading branch information
narfbg committed Nov 1, 2012
1 parent f5ccd12 commit ae85eb4
Show file tree
Hide file tree
Showing 7 changed files with 864 additions and 197 deletions.
17 changes: 15 additions & 2 deletions system/database/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
* @category Database
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
* @param string
* @param bool Determines if query builder should be used or not
*
* @param string|string[] $params
* @param bool $query_builder_override
* Determines if query builder should be used or not
*/
function &DB($params = '', $query_builder_override = NULL)
{
Expand Down Expand Up @@ -149,11 +151,22 @@ function &DB($params = '', $query_builder_override = NULL)
require_once(BASEPATH.'database/DB_query_builder.php');
if ( ! class_exists('CI_DB'))
{
/**
* CI_DB
*
* Acts as an alias for both CI_DB_driver and CI_DB_query_builder.
*
* @see CI_DB_query_builder
* @see CI_DB_driver
*/
class CI_DB extends CI_DB_query_builder { }
}
}
elseif ( ! class_exists('CI_DB'))
{
/**
* @ignore
*/
class CI_DB extends CI_DB_driver { }
}

Expand Down
26 changes: 21 additions & 5 deletions system/database/DB_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,24 @@
*/
class CI_DB_Cache {

/**
* CI Singleton
*
* @var object
*/
public $CI;
public $db; // allows passing of db object so that multiple database connections and returned db objects can be supported

/**
* Database object
*
* Allows passing of DB object so that multiple database connections
* and returned DB objects can be supported.
*
* @var object
*/
public $db;

// --------------------------------------------------------------------

/**
* Constructor
Expand All @@ -59,7 +75,7 @@ public function __construct(&$db)
/**
* Set Cache Directory Path
*
* @param string the path to the cache directory
* @param string $path Path to the cache directory
* @return bool
*/
public function check_path($path = '')
Expand Down Expand Up @@ -95,7 +111,7 @@ public function check_path($path = '')
* Retrieve a cached query
*
* The URI being requested will become the name of the cache sub-folder.
* An MD5 hash of the SQL statement will become the cache file name
* An MD5 hash of the SQL statement will become the cache file name.
*
* @param string $sql
* @return string
Expand Down Expand Up @@ -154,8 +170,8 @@ public function write($sql, $object)
/**
* Delete cache files within a particular directory
*
* @param string $segment_one = ''
* @param string $segment_two = ''
* @param string $segment_one
* @param string $segment_two
* @return void
*/
public function delete($segment_one = '', $segment_two = '')
Expand Down
Loading

0 comments on commit ae85eb4

Please sign in to comment.