forked from ezsystems/ezpublish-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex_rest.php
More file actions
56 lines (43 loc) · 1.65 KB
/
index_rest.php
File metadata and controls
56 lines (43 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* File containing the rest bootstrap
*
* @copyright Copyright (C) 1999-2010 eZ Systems AS. All rights reserved.
* @license http://ez.no/licenses/gnu_gpl GNU GPLv2
*
*/
require 'autoload.php';
require 'kernel/private/rest/classes/lazy.php';
// Below we are setting up a minimal eZ Publish environment from the old index.php
// This is a temporary measure.
// We want PHP to deal with all errors here.
eZDebug::setHandleType( eZDebug::HANDLE_TO_PHP );
$GLOBALS['eZGlobalRequestURI'] = eZSys::serverVariable( 'REQUEST_URI' );
$ini = eZINI::instance();
eZSys::init( 'index.php', $ini->variable( 'SiteAccessSettings', 'ForceVirtualHost' ) == 'true' );
$uri = eZURI::instance( eZSys::requestURI() );
$GLOBALS['eZRequestedURI'] = $uri;
require_once 'kernel/common/ezincludefunctions.php';
eZExtension::activateExtensions( 'default' );
// setup for changeAccess() needs some methods defined in old index.php
// We disable it, since we dont' want any override settings to change the
// debug settings here
function eZUpdateDebugSettings() {}
require_once "access.php";
$access = eZSiteAccess::match( $uri,
eZSys::hostname(),
eZSys::serverPort(),
eZSys::indexFile() );
$access = eZSiteAccess::change( $access );
if( ezpRestDebug::isDebugEnabled() )
{
$debug = ezpRestDebug::getInstance();
$debug->updateDebugSettings();
}
// Adding the compat layer for i18n methods, as this is used in some of the
// datatypes in extensions
require_once 'kernel/common/i18n.php';
$mvcConfig = new ezpMvcConfiguration();
$frontController = new ezcMvcConfigurableDispatcher( $mvcConfig );
$frontController->run();
?>