2009-12-18 12:56:12 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Where on the filesystem this application is installed
|
|
|
|
*/
|
2014-08-18 19:53:40 +00:00
|
|
|
define('APPLICATION_HOME', __DIR__);
|
|
|
|
define('BLOSSOM', APPLICATION_HOME.'/libraries/Blossom');
|
|
|
|
define('ZEND', APPLICATION_HOME.'/libraries/zf2/library/Zend');
|
2009-12-18 12:56:12 +00:00
|
|
|
|
|
|
|
/**
|
2014-08-18 19:53:40 +00:00
|
|
|
* Multi-Site support
|
2009-12-18 12:56:12 +00:00
|
|
|
*
|
2014-08-18 19:53:40 +00:00
|
|
|
* To allow multiple sites to use this same install base,
|
|
|
|
* define the SITE_HOME variable in the Apache config for each
|
|
|
|
* site you want to host.
|
|
|
|
*
|
|
|
|
* SITE_HOME is the directory where all site-specific data and
|
|
|
|
* configuration are stored. For backup purposes, backing up this
|
|
|
|
* directory would be sufficient for an easy full restore.
|
2009-12-18 12:56:12 +00:00
|
|
|
*/
|
2014-08-18 19:53:40 +00:00
|
|
|
define('SITE_HOME', !empty($_SERVER['SITE_HOME']) ? $_SERVER['SITE_HOME'] : __DIR__.'/data');
|
|
|
|
include SITE_HOME.'/site_config.inc';
|
2009-12-18 12:56:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set how we want to handle errors
|
|
|
|
* PHP_DEFAULT - do whatever's configured in php.ini
|
|
|
|
*
|
|
|
|
* If you do not define error handling to PHP_DEFAULT
|
|
|
|
* the custom error handlers kick in. All of the custom error display
|
2014-08-18 19:53:40 +00:00
|
|
|
* frunctions are in BLOSSOM/Classes/Error.php. The custom error
|
2009-12-18 12:56:12 +00:00
|
|
|
* function decide what to do based on $ERROR_REPORING array values
|
|
|
|
*
|
|
|
|
* PRETTY_PRINT - Display a message in the browser
|
|
|
|
* EMAIL_ADMIN - email the Administrator
|
|
|
|
* EMAIL_USER - email the logged in user
|
|
|
|
* SKIDDER - post errors to a Skidder server (see config below)
|
|
|
|
*/
|
|
|
|
define('ERROR_REPORTING','PHP_DEFAULT');
|
|
|
|
//define('ERROR_REPORTING','CUSTOM');
|
|
|
|
//$ERROR_REPORTING = array('PRETTY_PRINT','SKIDDER');
|
2014-08-18 19:53:40 +00:00
|
|
|
|
2009-12-18 12:56:12 +00:00
|
|
|
/**
|
|
|
|
* Skidder is a web service for error notifications. Error reporting supports
|
|
|
|
* posting errors to a Skidder server. You must register for an application_id
|
|
|
|
* on the skidder server you want to post errors to.
|
|
|
|
*/
|
|
|
|
//define('SKIDDER_URL','http://localhost/skidder/home.php');
|
|
|
|
//define('SKIDDER_APPLICATION_ID',);
|
|
|
|
|
2014-08-18 19:53:40 +00:00
|
|
|
//-------------------------------------------------------------------
|
|
|
|
// Bootstrap code
|
|
|
|
// No editing is usually needed after this point
|
|
|
|
//-------------------------------------------------------------------
|
2009-12-18 12:56:12 +00:00
|
|
|
/**
|
2014-08-18 19:53:40 +00:00
|
|
|
* Enable autoloading for the PHP libraries
|
2009-12-18 12:56:12 +00:00
|
|
|
*/
|
2014-08-18 19:53:40 +00:00
|
|
|
require_once ZEND.'/Loader/AutoloaderFactory.php';
|
|
|
|
$config = [
|
|
|
|
'Zend\Loader\StandardAutoloader' => [
|
|
|
|
'namespaces' => [
|
|
|
|
'Application' => APPLICATION_HOME,
|
|
|
|
'Blossom' => BLOSSOM,
|
|
|
|
'Zend' => ZEND
|
|
|
|
]
|
|
|
|
]
|
|
|
|
];
|
|
|
|
Zend\Loader\AutoloaderFactory::factory($config);
|
2009-12-18 12:56:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Session Startup
|
|
|
|
* Don't start a session for CLI usage.
|
|
|
|
* We only want sessions when PHP code is executed from the webserver
|
|
|
|
*/
|
|
|
|
if (!defined('STDIN')) {
|
2014-08-18 19:53:40 +00:00
|
|
|
ini_set('session.save_path', SITE_HOME.'/sessions');
|
2009-12-18 12:56:12 +00:00
|
|
|
session_start();
|
|
|
|
}
|
|
|
|
|
2014-08-18 19:53:40 +00:00
|
|
|
if (ERROR_REPORTING != 'PHP_DEFAULT') {
|
|
|
|
set_error_handler ('Blossom\Classes\Error::customErrorHandler');
|
|
|
|
set_exception_handler('Blossom\Classes\Error::customExceptionHandler');
|
|
|
|
}
|
|
|
|
|
2010-01-29 17:22:45 +00:00
|
|
|
/**
|
2014-08-18 19:53:40 +00:00
|
|
|
* Load the Zend_Acl
|
2010-01-29 17:22:45 +00:00
|
|
|
*/
|
2014-08-18 19:53:40 +00:00
|
|
|
include APPLICATION_HOME.'/access_control.inc';
|
2010-01-29 17:22:45 +00:00
|
|
|
|
2009-12-18 12:56:12 +00:00
|
|
|
/**
|
2014-08-18 19:53:40 +00:00
|
|
|
* Grab a timestamp for calculating process time
|
2009-12-18 12:56:12 +00:00
|
|
|
*/
|
2014-08-18 19:53:40 +00:00
|
|
|
$startTime = microtime(1);
|