Example #1
0
<?php

// Determine our absolute document root, includes trailing slash
define('DOC_ROOT', realpath(dirname(__FILE__) . '/../') . '/');
define('KONNECT', 'poop');
include DOC_ROOT . 'tests/autoload.php';
// START TEST ///////
include DOC_ROOT . 'core/class.config.php';
Config::set_core('konnect.dev');
var_dump(Config::$config);
Example #2
0
<?php

// Application flag
define('KONNECT', true);
// Determine our absolute document root, includes trailing slash
define('DOC_ROOT', realpath(dirname(__FILE__) . '/../') . '/');
include DOC_ROOT . 'core/class.config.php';
// Setting core configuration variables.
if (!Config::set_core()) {
    die('<h1>Where am I?</h1> <p>You need to setup your server names in <code>class.config.php</code></p>
		<p><code>$_SERVER[\'HTTP_HOST\']</code> reported <code>' . $_SERVER['HTTP_HOST'] . '</code></p>');
}
// Load all the models and sql dumps
foreach (Config::$config['core']['installed_apps'] as $app) {
    include DOC_ROOT . 'apps/' . $app . '/models.php';
    if (Config::$config['core']['auto_install']) {
        App_Init::install($app);
    }
}
// Class Autoloader
function __autoload($class_name)
{
    $folders = array();
    foreach (Config::$config['core']['installed_apps'] as $app) {
        $folders[] = 'apps/' . $app . '/libraries';
    }
    $folders = array_merge($folders, array('core', 'helpers', 'libraries'));
    foreach ($folders as $folder) {
        if (file_exists(DOC_ROOT . $folder . '/class.' . strtolower($class_name) . '.php')) {
            require DOC_ROOT . $folder . '/class.' . strtolower($class_name) . '.php';
            break;