PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Maicon gonšalez  >  Potato PHP MVC Framework  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Potato PHP MVC Framework
Framework to develop PHP MVC applications
Author: By
Last change:
Date: 9 months ago
Size: 1,462 bytes
 

Contents

Class file image Download
<?php
define
("ENVIRONMENT", "development"); //production, development

define("ROOT_PATH", __DIR__);
define("BASE_PATH", __DIR__."/App/");
define("BASE_PATH_CACHE", __DIR__."/App/Cache/");
define("BASE_PATH_THIRD", __DIR__."/App/Third/");
define("BASE_PATH_MODELS", __DIR__."/App/Models/");
define("BASE_PATH_VIEWS", __DIR__."/App/Views/");
define("BASE_PATH_MODULES", __DIR__."/App/Modules/");

define("TEMPLATE_ENGINE_SMARTY","smarty");
define("TEMPLATE_WITHOUT_ENGINE","without");

switch (
ENVIRONMENT){
    case
'development':
       
error_reporting(-1);
       
ini_set('display_errors', 1);
        break;
    case
'testing':
    case
'production':
       
ini_set('display_errors', 0);
       
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
        break;
    default:
       
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
        echo
'The application environment is not set correctly.';
        exit(
1);
}

require_once
"vendor/autoload.php";
require_once
"App/System/Core/Functions/DefaultFunctions.php";

set_error_handler("handler_error");
set_exception_handler('handler_exception');
spl_autoload_register('loaderFastApp');
register_shutdown_function("shutdownHandler");

require_once
"App/Configs/Config.php";
require_once
"App/Configs/Hooks.php";

date_default_timezone_set($GLOBALS['Config']['timezone']);

$App = new \System\FastApp();

For more information send a message to info at phpclasses dot org.