eZSys::serverPort(), eZSys::indexFile() ); $access = eZSiteAccess::change( $access ); eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' ); // Check for siteaccess extension eZExtension::activateExtensions( 'access' ); // Siteaccess extension check end // Now that all extensions are activated and siteaccess has been changed, reset // all eZINI instances as they may not take into account siteaccess specific settings. eZINI::resetAllInstances( false ); // Reload Extenion ordering to reorder eZINI Global Override Dirs. // @TODO : Améliorer la gestion globale (éviter des appels multiples !!!) eZExtension::reorderExtensions(); ezpEvent::getInstance()->registerEventListeners(); // Be able to do general events early in process ezpEvent::getInstance()->notify( 'request/preinput', array( $uri ) ); $mobileDeviceDetect = new ezpMobileDeviceDetect( ezpMobileDeviceDetectFilter::getFilter() ); if( $mobileDeviceDetect->isEnabled() ) { $mobileDeviceDetect->process(); if ( $mobileDeviceDetect->isMobileDevice() ) $mobileDeviceDetect->redirect(); }
function initialize() { if( ob_get_length() != 0 ) ob_end_clean(); $debugINI = eZINI::instance( 'debug.ini' ); eZDebugSetting::setDebugINI( $debugINI ); // Initialize text codec settings $this->updateTextCodecSettings(); // Initialize debug settings $this->updateDebugSettings( $this->UseDebugOutput ); // Set the different permissions/settings. $ini = eZINI::instance(); $iniFilePermission = $ini->variable( 'FileSettings', 'StorageFilePermissions' ); $iniDirPermission = $ini->variable( 'FileSettings', 'StorageDirPermissions' ); $iniVarDirectory = eZSys::cacheDirectory() ; eZCodePage::setPermissionSetting( array( 'file_permission' => octdec( $iniFilePermission ), 'dir_permission' => octdec( $iniDirPermission ), 'var_directory' => $iniVarDirectory ) ); eZExecution::addCleanupHandler( 'eZDBCleanup' ); eZExecution::addFatalErrorHandler( 'eZFatalError' ); eZDebug::setHandleType( eZDebug::HANDLE_FROM_PHP ); if ( $this->UseExtensions ) { // Check for extension eZExtension::activateExtensions( 'default' ); // Extension check end } else if ( !$this->isQuiet() ) { $cli = eZCLI::instance(); $cli->output( "Notice: This script uses 'use-extensions' => false, meaning extension settings are not loaded!" ); } $siteaccess = $this->SiteAccess; if ( $siteaccess ) { $access = array( 'name' => $siteaccess, 'type' => eZSiteAccess::TYPE_STATIC ); } else { $ini = eZINI::instance(); $siteaccess = $ini->variable( 'SiteSettings', 'DefaultAccess' ); $access = array( 'name' => $siteaccess, 'type' => eZSiteAccess::TYPE_DEFAULT ); } $access = eZSiteAccess::change( $access ); if ( $this->UseExtensions ) { // Check for siteaccess extension eZExtension::activateExtensions( 'access' ); // Extension check end } // Now that all extensions are activated and siteaccess has been changed, reset // all eZINI instances as they may not take into account siteaccess specific settings. eZINI::resetAllInstances( false ); // Reload Extenion ordering to reorder eZINI Global Override Dirs. // @TODO : Améliorer la gestion globale (éviter des appels multiples !!!) eZExtension::reorderExtensions(); // Set the global setting which is read by the session lib $GLOBALS['eZSiteBasics']['session-required'] = $this->UseSession; if ( $this->UseSession ) { $db = eZDB::instance(); if ( $db->isConnected() ) { eZSession::start(); } else { $this->IsInitialized = false; $this->InitializationErrorMessage = 'database error: ' . $db->errorMessage(); return; } } if ( $this->User ) { $userLogin = $this->User['login']; $userPassword = $this->User['password']; if ( $userLogin and $userPassword ) { $userID = eZUser::loginUser( $userLogin, $userPassword ); if ( !$userID ) { $cli = eZCLI::instance(); if ( $this->isLoud() ) $cli->warning( 'Failed to login with user ' . $userLogin ); eZExecution::cleanup(); eZExecution::setCleanExit(); } } } // Initialize module handling if ( $this->UseModules ) { $moduleRepositories = eZModule::activeModuleRepositories( $this->UseExtensions ); eZModule::setGlobalPathList( $moduleRepositories ); } $this->IsInitialized = true; }