start : add the start file to easily start a new project. Copy the beginning of the file in a index.php file and that's all !
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2235 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
61
start.php
Normal file
61
start.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
/** DomFramework
|
||||||
|
@package domframework
|
||||||
|
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||||
|
|
||||||
|
/** Start a domframework easily :
|
||||||
|
// If DEVEL is TRUE, the errors are displayed on screen and in the log
|
||||||
|
define ("DEVEL", false);
|
||||||
|
// The appname used in cookies, authentication panel...
|
||||||
|
define ("APPNAME", "Blog");
|
||||||
|
|
||||||
|
if (include_once ("domframework/start.php") === false)
|
||||||
|
die ("Please install the domframework !");
|
||||||
|
if (version_compare (PHP_VERSION, '5.3.0') < 0)
|
||||||
|
die ("Your PHP version is too old : 5.3.0 minimum\n");
|
||||||
|
if (!defined ("DOMFRAMEWORK_VERSION") ||
|
||||||
|
version_compare (DOMFRAMEWORK_VERSION, "0.19") < 0)
|
||||||
|
die ("Your DomFramework version is too old : 0.19 minimum\n");
|
||||||
|
|
||||||
|
The routing, rendering, language support, authentication, logging are started
|
||||||
|
*/
|
||||||
|
require_once ("domframework/route.php");
|
||||||
|
require_once ("domframework/renderer.php");
|
||||||
|
require_once ("domframework/version.php");
|
||||||
|
require_once ("domframework/language.php");
|
||||||
|
require_once ("domframework/authentication.php");
|
||||||
|
require_once ("domframework/logger.php");
|
||||||
|
spl_autoload_register();
|
||||||
|
session_start ();
|
||||||
|
|
||||||
|
// Logging the informations
|
||||||
|
$logger = new logger ();
|
||||||
|
if (defined ("DEVEL") && constant ("DEVEL") !== false)
|
||||||
|
{
|
||||||
|
$logger->backtraceDisplay = true;
|
||||||
|
$logger->logtype = "display|stderr";
|
||||||
|
}
|
||||||
|
$logger->catchAll();
|
||||||
|
|
||||||
|
if (! isset ($route))
|
||||||
|
$route = new route ();
|
||||||
|
$route->debug=0;
|
||||||
|
// Catch all the uncatched exceptions
|
||||||
|
set_exception_handler(array ($route, "error"));
|
||||||
|
|
||||||
|
// Authentification
|
||||||
|
$authentication = new authentication ($route);
|
||||||
|
$authentication->debug = 0;
|
||||||
|
$authHTML = $authentication->verifAuthHTML ();
|
||||||
|
$authREST = $authentication->verifAuthREST ();
|
||||||
|
if (defined ("APPNAME"))
|
||||||
|
$authentication->appName = constant ("APPNAME");
|
||||||
|
$authentication->routes ();
|
||||||
|
$route->authenticationURL = "/authentication";
|
||||||
|
|
||||||
|
// Selection of the language
|
||||||
|
$language = new language ();
|
||||||
|
if (defined ("APPNAME"))
|
||||||
|
$language->activeLanguage (constant ("APPNAME"), "Language");
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user