Beispiel #1
0
<?php

ini_set('memory_limit', '256M');
if (!defined('DIR_KIT')) {
    define('DIR_KIT', dirname(__FILE__) . '/');
}
append_include_path(DIR_KIT);
append_include_path(DIR_KIT . 'ext/');
umask(07);
ini_set('display_errors', '0');
error_reporting(E_ERROR | E_PARSE);
ini::set('debug', false);
ini::set('dir-sessions', '/tmp/');
function __autoload($class)
{
    $dirs = array(DIR_KIT, DIR_KIT . 'obj/', 'php/obj/');
    foreach ($dirs as $dir) {
        $f = $dir . $class . '.php';
        if (is_file($f)) {
            require_once $f;
            break;
        }
    }
}
function append_include_path($dir)
{
    $t = 'include_path';
    $d = ini_get($t);
    if (!strstr($d, $dir)) {
        ini_set($t, $d . ':' . $dir);
    }
Beispiel #2
0
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Core PHP Framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Core PHP Framework. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    Core
 * @copyright  2008-2009 Gabriel Sobrinho <*****@*****.**>
 * @license    http://opensource.org/licenses/lgpl-3.0.html GNU Lesser General Public License version 3 (LGPLv3)
 * @version    0.1
 */
// Buffer and error reporting
ob_start();
error_reporting(E_ALL | E_STRICT);
// Go to framework dir
chdir(dirname(__DIR__));
// Autoload
require_once 'core/functions.php';
// Set include path
$cwd = getcwd();
append_include_path("{$cwd}/core", "{$cwd}/app/models", "{$cwd}/app/controllers", "{$cwd}/app/helpers");
unset($cwd);
// Boot and dispatch request
Core::boot();
Controller\Router::dispatch();