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.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 94961b568..eb5161d76 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -101,12 +101,9 @@ class CI_Migration {
}
// Do we auto migrate to the latest migration?
- if ($this->_migration_auto_latest == TRUE)
+ if ($this->_migration_auto_latest === TRUE AND ! $this->latest())
{
- if ( ! $this->latest() )
- {
- show_error($this->error_string());
- }
+ show_error($this->error_string());
}
}
@@ -134,7 +131,6 @@ class CI_Migration {
++$stop;
$step = 1;
}
-
else
{
// Moving Down
@@ -158,11 +154,11 @@ class CI_Migration {
}
// Migration step not found
- if (count($f) == 0)
+ if (count($f) === 0)
{
// If trying to migrate up to a version greater than the last
// existing one, migrate to the last one.
- if ($step == 1)
+ if ($step === 1)
{
break;
}
@@ -214,7 +210,7 @@ class CI_Migration {
log_message('debug', 'Current migration: '.$current_version);
- $version = $i + ($step == 1 ? -1 : 0);
+ $version = $i + ($step === 1 ? -1 : 0);
// If there is nothing to do so quit
if ($migrations === array())
@@ -301,13 +297,11 @@ class CI_Migration {
{
// Load all *_*.php files in the migrations path
$files = glob($this->_migration_path.'*_*.php');
- $file_count = count($files);
- for ($i = 0; $i < $file_count; $i++)
+ for ($i = 0, $c = count($files); $i < $c; $i++)
{
// Mark wrongly formatted files as false for later filtering
- $name = basename($files[$i], '.php');
- if ( ! preg_match('/^\d{3}_(\w+)$/', $name))
+ if ( ! preg_match('/^\d{3}_(\w+)$/', basename($files[$i], '.php')))
{
$files[$i] = FALSE;
}
@@ -364,4 +358,4 @@ class CI_Migration {
}
/* End of file Migration.php */
-/* Location: ./system/libraries/Migration.php */ \ No newline at end of file
+/* Location: ./system/libraries/Migration.php */