From 06ab8168ab1559484fd44daea434d74f0f1728d9 Mon Sep 17 00:00:00 2001
From: Karsten Heiken
Date: Fri, 18 Nov 2011 15:37:33 +0100
Subject: [PATCH] Add debug controller for some crazy debugging action
This controller will only be available if we set
ENVIRONMENT to 'development' or 'testing'.
---
application/controllers/debug.php | 50 ++++++++++++++++++++++++
application/views/experiments/detail.php | 10 +++++
assets/css/style.css | 4 ++
3 files changed, 64 insertions(+)
create mode 100644 application/controllers/debug.php
diff --git a/application/controllers/debug.php b/application/controllers/debug.php
new file mode 100644
index 0000000..99fed4e
--- /dev/null
+++ b/application/controllers/debug.php
@@ -0,0 +1,50 @@
+
+ */
+class Debug extends MY_Controller {
+
+ /**
+ * Constructor.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ if(ENVIRONMENT == "production") {
+ show_error("Debugging functions are not available in a production environment.", 400);
+ }
+ }
+
+ public function cancel_job($experiment, $jobId) {
+ $this->load->model('job');
+ $this->job->delete($jobId);
+
+ redirect("experiments/detail/".$experiment);
+
+ }
+}
+
+/* End of file debug.php */
+/* Location: ./application/controllers/debug.php */
diff --git a/application/views/experiments/detail.php b/application/views/experiments/detail.php
index 145f697..1eb6cbc 100644
--- a/application/views/experiments/detail.php
+++ b/application/views/experiments/detail.php
@@ -61,6 +61,16 @@
endif;
?>
+
+ Debugging actions
+
+ Reset this job
+
+