Exemple #1
0
//- models in the base folder
//- files in this dir
//- plugins init.php in the app/base folder
//- plugins init.php in the plugins folder
lookUpDirs();
// load all the models (dependent on helpers)
requireAll("models");
// load all initializations
requireOnly("bin", array("init.php"));
//===============================================
// Config
//===============================================
$config = new Config();
$GLOBALS['config'] = $config->getConfig();
// load config and other initiators (dependent on helpers)
requireAll("bin", array("init.php"));
//===============================================
// Session
//===============================================
session_start();
//===============================================
// Start the controller
//===============================================s
$controller = findController($url['path']);
$output = new $controller('controllers/', WEB_FOLDER, DEFAULT_ROUTE, DEFAULT_ACTION);
//===============================================
// Helpers
//===============================================
// Lookup available dirs in our environment
function lookUpDirs()
{
Exemple #2
0
<?php

/**
* kickstart!
* this is the init script for the solumLite framework
* include me in index and start running
*/
//define framework dir
$lib_path = dirname(__FILE__);
define('FRAMEWORK_DIR', $lib_path);
//load
requireAll($lib_path);
if (!isset($config)) {
    $config = array();
}
request::addConfig($config);
requireAll($lib_path . '/db');
function requireAll($dir)
{
    foreach (scandir($dir) as $file) {
        if (strrchr($file, '.') == '.php') {
            //require once as to not re include this file
            require_once $dir . '/' . $file;
        }
    }
}