PHP Classes

File: www/_Main.php

Recommend this page to a friend!
  Classes of Fernando Val   Springy   www/_Main.php   Download  
File: www/_Main.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Springy
Microframework for Web application development
Author: By
Last change: Merge remote-tracking branch 'origin/master' into development
Date: 1 year ago
Size: 1,290 bytes
 

Contents

Class file image Download
<?php

/**
 * Springy web launcher script.
 *
 * @copyright 2007 Fernando Val
 * @author Fernando Val <fernando.val@gmail.com>
 *
 * @version 5.2.0
 */
$springyStartTime = microtime(true); // Memoriza a hora do início do processamento

// Kill system with internal error 500 if initial setup file does not exists
if (!file_exists('sysconf.php') || !file_exists('helpers.php')) {
   
header('Content-type: text/html; charset=UTF-8', true, 500);
    exit(
'Internal System Error on Startup');
}

// Load framework configuration
require 'sysconf.php';
// Load helper script.
require 'helpers.php';
// Define error handlers
error_reporting(E_ALL);
set_exception_handler('springyExceptionHandler');
set_error_handler('springyErrorHandler');

// Load Composer autoload
if (file_exists(sysconf('VENDOR_PATH') . DS . 'autoload.php')) {
    require
sysconf('VENDOR_PATH') . DS . 'autoload.php';
}

// Kill system with internal error 500 if can not set autoload funcion
if (!spl_autoload_register('springyAutoload', true, true)) {
   
header('Content-type: text/html; charset=UTF-8', true, 500);
    exit(
'Internal System Error on Startup');
}

// System start
ob_start();
Springy\Kernel::initiate($GLOBALS['SYSTEM'], $springyStartTime);

if (
count(ob_list_handlers())) {
   
ob_end_flush();
}