Config for ajax debug and apc cache usage

This commit is contained in:
Deon George 2012-11-02 16:28:23 +11:00
parent 002c3b8f44
commit c4e760fa21
3 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,5 @@
<?php
class Cache extends Kohana_Cache {
public static $default = 'apc';
}
?>

View File

@ -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();

View File

@ -0,0 +1,18 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB Configuration - Debug Settings
*
* @package OSB
* @subpackage Debug
* @category Configuration
* @author Deon George
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
return array
(
'ajax'=>FALSE, // AJAX actions can only be run by ajax calls if set to FALSE
);
?>