Exemple #1
0
<?php

// This is where the procedural part begins. This isn't a static class becuase you need to use too many words to write to everytime.
session_start();
prepare_config();
// Use this to catch all errors other than 'Fatal' and display them in a box above the screen
function handle_errors($errlevel, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
    $message = htmlentities($errstr) . " [ On <strong>" . $errfile . "</strong> Line " . $errline . " ]";
    if ($errlevel == E_WARNING && DEBUG_VALUES) {
        display_warning($message);
    } else {
        display_error($message);
    }
}
// Display an error message properly. CSS has to be defined inline because we're not sure if the page has started yet
function display($message, $file = '', $line = '')
{
    display_message($message, $file, $line, 'normal', true);
}
function display_warning($message, $file = '', $line = '')
{
    display_message($message, $file, $line, 'warning');
}
function display_error($message, $file = '', $line = '')
{
    display_message($message, $file, $line, 'error');
}
function display_system($message, $file = '', $line = '')
{
    display_message('SYSTEM: ' . $message, $file, $line, 'system');
Exemple #2
0
 public function testPrepareConfig()
 {
     $expected_keys = array('name', 'identifier', 'component', 'database_engine', 'database_default_charset', 'default_language', 'entry_point', 'submenu');
     $actual_keys = array_keys(prepare_config());
     $this->assertTrue(count(array_diff($expected_keys, $actual_keys)) == 0);
 }
Exemple #3
0
<?php

if (basename(getcwd()) == 'bin') {
    chdir('..');
}
include_once 'lib' . DIRECTORY_SEPARATOR . 'generator.php';
$config = prepare_config();
$models = prepare_models();
$views = prepare_frontend();
generate_output($config, $models, $views);