summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-04-27 16:06:25 +0200
committerTimothy Warren <tim@timshomepage.net>2012-04-27 16:06:25 +0200
commit86611db279c17cf9b3d6ad8732a1c840cb833148 (patch)
tree9b1a0fa5047b728a9355eada3d28d6d198a4bf9b
parent7183ff91112e540315dffdef2cea0d6d491cdc2e (diff)
Fixed Cart, Migration, Parser and Zip libraries
-rw-r--r--system/libraries/Cart.php46
-rw-r--r--system/libraries/Migration.php39
-rw-r--r--system/libraries/Parser.php18
-rw-r--r--system/libraries/Zip.php40
4 files changed, 137 insertions, 6 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index ca7be555e..eee123584 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -36,19 +36,53 @@
*/
class CI_Cart {
- // These are the regular expression rules that we use to validate the product ID and product name
- public $product_id_rules = '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods
- public $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods
- public $product_name_safe = TRUE; // only allow safe product names
+ /**
+ * These are the regular expression rules that we use to validate the product ID and product name
+ * alpha-numeric, dashes, underscores, or periods
+ *
+ * @var string
+ */
+ public $product_id_rules = '\.a-z0-9_-';
+
+ /**
+ * These are the regular expression rules that we use to validate the product ID and product name
+ * alpha-numeric, dashes, underscores, colons or periods
+ *
+ * @var string
+ */
+ public $product_name_rules = '\.\:\-_ a-z0-9';
+
+ /**
+ * only allow safe product names
+ *
+ * @var bool
+ */
+ public $product_name_safe = TRUE;
+ // --------------------------------------------------------------------------
// Protected variables. Do not change!
+ // --------------------------------------------------------------------------
+
+ /**
+ * Reference to CodeIgniter instance
+ *
+ * @var object
+ */
protected $CI;
+
+ /**
+ * Contents of the cart
+ *
+ * @var array
+ */
protected $_cart_contents = array();
/**
* Shopping Class Constructor
*
* The constructor loads the Session class, used to store the shopping cart contents.
+ *
+ * @param array
*/
public function __construct($params = array())
{
@@ -245,7 +279,6 @@ class CI_Cart {
* product ID and quantity for each item.
*
* @param array
- * @param string
* @return bool
*/
public function update($items = array())
@@ -396,6 +429,7 @@ class CI_Cart {
*
* Removes an item from the cart
*
+ * @param int
* @return bool
*/
public function remove($rowid)
@@ -427,6 +461,7 @@ class CI_Cart {
*
* Returns the entire cart array
*
+ * @param bool
* @return array
*/
public function contents($newest_first = FALSE)
@@ -449,6 +484,7 @@ class CI_Cart {
* Returns TRUE if the rowid passed to this function correlates to an item
* that has options associated with it.
*
+ * @param mixed
* @return bool
*/
public function has_options($rowid = '')
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index a18fcb9f1..ce4683fc1 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -39,14 +39,53 @@
*/
class CI_Migration {
+ /**
+ * Whether the library is enabled
+ *
+ * @var bool
+ */
protected $_migration_enabled = FALSE;
+
+ /**
+ * Path to migration classes
+ *
+ * @var string
+ */
protected $_migration_path = NULL;
+
+ /**
+ * Current migration version
+ *
+ * @var mixed
+ */
protected $_migration_version = 0;
+
+ /**
+ * Database table with migration info
+ *
+ * @var string
+ */
protected $_migration_table = 'migrations';
+
+ /**
+ * Whether to automatically run migrations
+ *
+ * @var bool
+ */
protected $_migration_auto_latest = FALSE;
+ /**
+ * Error message
+ *
+ * @var string
+ */
protected $_error_string = '';
+ /**
+ * Initialize Migration Class
+ *
+ * @param array
+ */
public function __construct($config = array())
{
# Only run this constructor on main library load
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php
index d1b5b764b..c40f339b4 100644
--- a/system/libraries/Parser.php
+++ b/system/libraries/Parser.php
@@ -36,9 +36,25 @@
*/
class CI_Parser {
+ /**
+ * Left delimeter character for psuedo vars
+ *
+ * @var string
+ */
public $l_delim = '{';
+
+ /**
+ * Right delimeter character for psuedo vars
+ *
+ * @var string
+ */
public $r_delim = '}';
- public $object;
+
+ /**
+ * Reference to CodeIgniter instance
+ *
+ * @var object
+ */
protected $CI;
/**
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 80438546b..86d0787b2 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -42,13 +42,53 @@
*/
class CI_Zip {
+ /**
+ * Zip data in string form
+ *
+ * @var string
+ */
public $zipdata = '';
+
+ /**
+ * Zip data for a directory in string form
+ *
+ * @var string
+ */
public $directory = '';
+
+ /**
+ * Number of files/folder in zip file
+ *
+ * @var int
+ */
public $entries = 0;
+
+ /**
+ * Number of files in zip
+ *
+ * @var int
+ */
public $file_num = 0;
+
+ /**
+ * relative offset of local header
+ *
+ * @var int
+ */
public $offset = 0;
+
+ /**
+ * Reference to time at init
+ *
+ * @var int
+ */
public $now;
+ /**
+ * Initialize zip compression class
+ *
+ * @return void
+ */
public function __construct()
{
$this->now = time();