summaryrefslogtreecommitdiffstats
path: root/system/libraries/Migration.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Migration.php')
-rw-r--r--system/libraries/Migration.php48
1 files changed, 44 insertions, 4 deletions
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index a18fcb9f1..4391b235d 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -39,14 +39,54 @@
*/
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
+ * @return void
+ */
public function __construct($config = array())
{
# Only run this constructor on main library load
@@ -57,7 +97,7 @@ class CI_Migration {
foreach ($config as $key => $val)
{
- $this->{'_' . $key} = $val;
+ $this->{'_'.$key} = $val;
}
log_message('debug', 'Migrations class initialized');
@@ -69,7 +109,7 @@ class CI_Migration {
}
// If not set, set it
- $this->_migration_path != '' OR $this->_migration_path = APPPATH.'migrations/';
+ $this->_migration_path !== '' OR $this->_migration_path = APPPATH.'migrations/';
// Add trailing slash if not set
$this->_migration_path = rtrim($this->_migration_path, '/').'/';
@@ -139,7 +179,7 @@ class CI_Migration {
// We now prepare to actually DO the migrations
// But first let's make sure that everything is the way it should be
- for ($i = $start; $i != $stop; $i += $step)
+ for ($i = $start; $i !== $stop; $i += $step)
{
$f = glob(sprintf($this->_migration_path.'%03d_*.php', $i));
@@ -301,7 +341,6 @@ class CI_Migration {
}
sort($files);
-
return $files;
}
@@ -345,6 +384,7 @@ class CI_Migration {
{
return get_instance()->$var;
}
+
}
/* End of file Migration.php */