| 1 | <?php |
| 2 | /** |
| 3 | * File containing the rest bootstrap |
| 4 | * |
| 5 | * @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved. |
| 6 | * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 |
| 7 | * @version 2011.7 |
| 8 | * @package kernel |
| 9 | */ |
| 10 | |
| 11 | require 'autoload.php'; |
| 12 | require 'kernel/private/rest/classes/lazy.php'; |
| 13 | |
| 14 | // Below we are setting up a minimal eZ Publish environment from the old index.php |
| 15 | // This is a temporary measure. |
| 16 | |
| 17 | // We want PHP to deal with all errors here. |
| 18 | eZDebug::setHandleType( eZDebug::HANDLE_TO_PHP ); |
| 19 | $GLOBALS['eZGlobalRequestURI'] = eZSys::serverVariable( 'REQUEST_URI' ); |
| 20 | $ini = eZINI::instance(); |
| 21 | eZSys::init( 'index.php', $ini->variable( 'SiteAccessSettings', 'ForceVirtualHost' ) == 'true' ); |
| 22 | $uri = eZURI::instance( eZSys::requestURI() ); |
| 23 | $GLOBALS['eZRequestedURI'] = $uri; |
| 24 | |
| 25 | // load extensions |
| 26 | eZExtension::activateExtensions( 'default' ); |
| 27 | |
| 28 | // setup for eZSiteAccess:change() needs some methods defined in old index.php |
| 29 | // We disable it, since we dont' want any override settings to change the |
| 30 | // debug settings here |
| 31 | function eZUpdateDebugSettings() {} |
| 32 | |
| 33 | // load siteaccess |
| 34 | $access = eZSiteAccess::match( $uri, |
| 35 | eZSys::hostname(), |
| 36 | eZSys::serverPort(), |
| 37 | eZSys::indexFile() ); |
| 38 | $access = eZSiteAccess::change( $access ); |
| 39 | |
| 40 | // load siteaccess extensions |
| 41 | eZExtension::activateExtensions( 'access' ); |
| 42 | |
| 43 | // Now that all extensions are activated and siteaccess has been changed, reset |
| 44 | // all eZINI instances as they may not take into account siteaccess specific settings. |
| 45 | eZINI::resetAllInstances( false ); |
| 46 | |
| 47 | if( ezpRestDebug::isDebugEnabled() ) |
| 48 | { |
| 49 | $debug = ezpRestDebug::getInstance(); |
| 50 | $debug->updateDebugSettings(); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | $mvcConfig = new ezpMvcConfiguration(); |
| 55 | |
| 56 | $frontController = new ezcMvcConfigurableDispatcher( $mvcConfig ); |
| 57 | $frontController->run(); |
| 58 | ?> |
| 59 | |