From c4e760fa215be58b2c9ee8195cf2c51e7a856e1c Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 2 Nov 2012 16:28:23 +1100 Subject: [PATCH] Config for ajax debug and apc cache usage --- application/classes/cache.php | 5 +++++ .../lnapp/controller/templatedefault.php | 3 +-- application/config/debug.php | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 application/classes/cache.php create mode 100644 application/config/debug.php diff --git a/application/classes/cache.php b/application/classes/cache.php new file mode 100644 index 00000000..09c92e3e --- /dev/null +++ b/application/classes/cache.php @@ -0,0 +1,5 @@ + diff --git a/application/classes/lnapp/controller/templatedefault.php b/application/classes/lnapp/controller/templatedefault.php index 149fa50e..94717310 100644 --- a/application/classes/lnapp/controller/templatedefault.php +++ b/application/classes/lnapp/controller/templatedefault.php @@ -82,9 +82,8 @@ abstract class lnApp_Controller_TemplateDefault extends Controller_Template { return; } - $TEST = FALSE; // Actions that start with ajax, should only be ajax - if (preg_match('/^ajax/',Request::current()->action()) AND ! Request::current()->is_ajax() AND ! $TEST) + if (! Kohana::Config('debug.ajax') AND preg_match('/^ajax/',Request::current()->action()) AND ! Request::current()->is_ajax()) die(); parent::before(); diff --git a/application/config/debug.php b/application/config/debug.php new file mode 100644 index 00000000..70848b77 --- /dev/null +++ b/application/config/debug.php @@ -0,0 +1,18 @@ +FALSE, // AJAX actions can only be run by ajax calls if set to FALSE +); +?>