Beispiel #1
0
/**
 * Created by PhpStorm.
 * User: ys
 * Date: 16.11.2014
 * Time: 0:07
 */
//var_dump($_SERVER);
//var_dump($_GET);
require_once 'config.php';
function siteAutoload($class)
{
    $n = strrpos($class, '_');
    if ($n === false) {
        $path = '';
    } else {
        $path = str_replace('_', '/', substr($class, 0, $n + 1));
    }
    include $path . $class . '.php';
}
function libAutoload($class)
{
    include '../lib/' . $class . '.php';
}
spl_autoload_register('siteAutoload');
spl_autoload_register('libAutoload');
try {
    $controller = new controller();
    $controller->run();
} catch (Exception $e) {
    error::showError($e);
}
function controller_news()
{
    return controller::run();
}
Beispiel #3
0
<?php

// Errors to browser
error_reporting(E_ALL);
ini_set('display_errors', 'on');
// Load libraries
$config = parse_ini_file('config.ini');
require_once 'lib/Model/composers.php';
require_once 'lib/Model/songs.php';
require_once 'lib/Model/musicalForms.php';
require_once 'lib/Controller/controller.php';
require_once 'lib/Controller/postHandler.php';
$postHandler = new postHandler();
$postHandler->run();
$Controller = new controller();
$action = "";
// If there's an action tell the controller
if (isset($_GET["action"])) {
    $action = $_GET["action"];
}
$Controller->setAction($action);
echo $Controller->run();