separeted frontend from backend

adjusted include paths of tools
This commit is contained in:
Steffen Vogel 2010-06-07 12:11:51 +02:00
parent 782a1c2ee2
commit 2adbdf9a24
80 changed files with 11 additions and 13 deletions

View file

@ -23,7 +23,7 @@
* Bootstrap entrypoint, just calls Frontcontroller::run()
*/
include '../init.php'; // initialize environment (error handling, configuration, class autoloading)
include 'init.php'; // initialize environment (error handling, configuration, class autoloading)
try {
$fc = new FrontController(); // spawn frontcontroller

View file

@ -49,15 +49,13 @@ function __autoload($className) {
'/^(.*Controller)$/' => 'controller/$1'
);
$include = preg_replace(array_keys($mapping), array_values($mapping), $className);
$include = $libs . strtolower(preg_replace(array_keys($mapping), array_values($mapping), $className)) . '.php';
if (empty($include)) {
throw new CustomException('Cannot load class ' . $className . '! Name not mapped.');
}
$include = $libs . strtolower($include) . '.php';
if (file_exists($include)) {
if (!file_exists($include)) {
throw new CustomException('Cannot load class ' . $className . '! File does not exist: ' . $include);
}
@ -71,10 +69,10 @@ error_reporting(E_ALL);
set_error_handler(array('CustomErrorException', 'errorHandler'));
// load configuration into registry
if (!file_exists('volkszaehler.conf.php')) {
if (!file_exists(__DIR__ . '/volkszaehler.conf.php')) {
throw new CustomException('No configuration available! Use volkszaehler.conf.default.php as an template');
}
include 'volkszaehler.conf.php';
include __DIR__ . '/volkszaehler.conf.php';
?>

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -197,7 +197,7 @@ $(document).ready(function() {
// load channel list
// load json data
$.getJSON("backend.php",{uuid: myUUID, controller: 'channel', action: 'get', data: 'channels'}, function(j){
$.getJSON("../backend/index.php",{uuid: myUUID, controller: 'channel', action: 'get', data: 'channels'}, function(j){
$('#channelList').empty();
@ -262,10 +262,10 @@ function getData() {
// calcMyWindowStart
myWindowStart = calcMyWindowStart();
//$('#debug').append('<a href="backend.php?uuid='+myUUID+'&mode=getPulses&ids='+ids_parameter+'&windowStart='+myWindowStart+'&windowEnd='+myWindowEnd+'&windowGrouping='+f.grouping.value+'">json</a>');
//$('#debug').append('<a href="../backend/index.php?uuid='+myUUID+'&mode=getPulses&ids='+ids_parameter+'&windowStart='+myWindowStart+'&windowEnd='+myWindowEnd+'&windowGrouping='+f.grouping.value+'">json</a>');
// load json data with given time window
//$.getJSON("backend.php",{uuid: myUUID,mode: 'getPulses', ids: ids_parameter, windowEnd: myWindowEnd, windowSize: f.window.value.substring(0,1), windowInterval: f.window.value.substring(1)}, function(j){
$.getJSON("backend.php",{uuid: myUUID, controller: 'channel', action: 'get', data: 'pulses', ids: ids_parameter, from: myWindowStart, to: myWindowEnd, groupBy: f.grouping.value}, function(j){
//$.getJSON("../backend/index.php",{uuid: myUUID,mode: 'getPulses', ids: ids_parameter, windowEnd: myWindowEnd, windowSize: f.window.value.substring(0,1), windowInterval: f.window.value.substring(1)}, function(j){
$.getJSON("../backend/index.php",{uuid: myUUID, controller: 'channel', action: 'get', data: 'pulses', ids: ids_parameter, from: myWindowStart, to: myWindowEnd, groupBy: f.grouping.value}, function(j){
data = j;
//$('#debug').empty().append(data.toSource());
// then show/reload the chart

View file

@ -23,7 +23,7 @@
* simple script to import demo pulses
*/
include '../include/init.php';
include '../../backend/init.php';
$dbh = Database::getConnection();

View file

@ -19,7 +19,7 @@
* http://www.gnu.org/copyleft/gpl.html
*/
include '../../init.php';
include '../../backend/init.php';
$user = User::getByEMail($_GET['email']);
$groups = $user->getGroups(true);