summaryrefslogtreecommitdiffstats
path: root/application/controllers/migrate.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-02-16 20:03:49 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-02-16 20:03:49 +0100
commit33ed0f37b6b8f2223cd3362bf8fca28102ab67c6 (patch)
tree99c613720a2fd8541764bb6fc893e0da28fa269b /application/controllers/migrate.php
parent154da11c5bb4b7dc5c225f4fa018852ee45cc6eb (diff)
parentd8d1e24eee56d2466c91ecd72b3c8932eb3d0639 (diff)
Merged CodeIgniter Core changes and integrated rob1's secure cookie change into my secure cookie change.
Diffstat (limited to 'application/controllers/migrate.php')
-rw-r--r--application/controllers/migrate.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/application/controllers/migrate.php b/application/controllers/migrate.php
new file mode 100644
index 000000000..e5442e79c
--- /dev/null
+++ b/application/controllers/migrate.php
@@ -0,0 +1,40 @@
+<?php
+class Migrate extends CI_Controller
+{
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->load->library('migration');
+
+ /** VERY IMPORTANT - only turn this on when you need it. */
+// show_error('Access to this controller is blocked, turn me on when you need me.');
+ }
+
+ // Install up to the most up-to-date version.
+ function install()
+ {
+ if ( ! $this->migration->current())
+ {
+ show_error($this->migration->error);
+ exit;
+ }
+
+ echo "<br />Migration Successful<br />";
+ }
+
+ // This will migrate up to the configed migration version
+ function version($id = NULL)
+ {
+ // No $id supplied? Use the config version
+ $id OR $id = $this->config->item('migration_version');
+
+ if ( ! $this->migration->version($id))
+ {
+ show_error($this->migration->error);
+ exit;
+ }
+
+ echo "<br />Migration Successful<br />";
+ }
+}