本文整理汇总了PHP中eZSys::addAccessPath方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSys::addAccessPath方法的具体用法?PHP eZSys::addAccessPath怎么用?PHP eZSys::addAccessPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSys
的用法示例。
在下文中一共展示了eZSys::addAccessPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIndexFileRemoveSiteAccessIfDefaultAccessDisabled
/**
* Test eZSys $AccessPath as it worked prior to 4.4 without propertied to
* define scope of path with RemoveSiteAccessIfDefaultAccess=disabled
*/
public function testIndexFileRemoveSiteAccessIfDefaultAccessDisabled()
{
// TEST SETUP --------------------------------------------------------
$ini = eZINI::instance();
$defaultAccess = $ini->variable( 'SiteSettings', 'DefaultAccess' );
$this->setSiteAccess( $defaultAccess );
// Make sure to preserve ini settings in case other tests depend on them
$orgRemoveSiteaccess = $ini->variable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess' );
// DISABLE RemoveSiteAccessIfDefaultAccess
$ini->setVariable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess', 'disabled' );
// -------------------------------------------------------------------
// TEST --------------------------------------------------------------
$indexFile = eZSys::indexFile();
self::assertEquals( "/$defaultAccess", $indexFile );
eZSys::addAccessPath( array( 'testing', 'indexFile' ) );
$indexFile = eZSys::indexFile();
self::assertEquals( "/$defaultAccess/testing/indexFile", $indexFile );
// -------------------------------------------------------------------
// TEST TEAR DOWN ----------------------------------------------------
$ini->setVariable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess', $orgRemoveSiteaccess );
eZSys::clearAccessPath();
// -------------------------------------------------------------------
}
示例2: array
}
$Result = array();
$Result['content'] = '';
$Result['rerun_uri'] = '/' . implode('/', array_splice($Params['Parameters'], 1)) . $userParamString;
$layoutINI = eZINI::instance('layout.ini');
$i18nINI = eZINI::instance('i18n.ini');
if ($layoutINI->hasGroup($LayoutStyle)) {
if ($layoutINI->hasVariable($LayoutStyle, 'PageLayout')) {
$Result['pagelayout'] = $layoutINI->variable($LayoutStyle, 'PageLayout');
}
if ($layoutINI->hasVariable($LayoutStyle, 'ContentType')) {
header('Content-Type: ' . $layoutINI->variable($LayoutStyle, 'ContentType') . '; charset=' . $i18nINI->variable('CharacterSettings', 'Charset'));
}
$res = eZTemplateDesignResource::instance();
$res->setKeys(array(array('layout', $LayoutStyle)));
if ($layoutINI->hasVariable($LayoutStyle, 'UseAccessPass') && $layoutINI->variable($LayoutStyle, 'UseAccessPass') == 'false') {
} else {
eZSys::addAccessPath(array('layout', 'set', $LayoutStyle), 'layout', false);
}
$useFullUrl = false;
$http = eZHTTPTool::instance();
$http->UseFullUrl = false;
if ($layoutINI->hasVariable($LayoutStyle, 'UseFullUrl')) {
if ($layoutINI->variable($LayoutStyle, 'UseFullUrl') == 'true') {
$http->UseFullUrl = true;
}
}
$Module->setExitStatus(eZModule::STATUS_RERUN);
} else {
eZDebug::writeError('No such layout style: ' . $LayoutStyle, 'layout/set');
}
示例3: registerExtensions
//.........这里部分代码省略.........
if ($isBasicLoad) {
eZDebug::writeNotice("Storing basic extension load information into cache file '{$cacheFilePath}'...", __METHOD__);
} else {
if ($is_virtual_load) {
eZDebug::writeNotice("Storing virtual siteaccess extension load information into cache file '{$cacheFilePath}'...", __METHOD__);
} else {
eZDebug::writeNotice("Storing siteaccess extension load information into cache file '{$cacheFilePath}'...", __METHOD__);
}
}
$php = new eZPHPCreator($cacheDir, $cacheFileName);
$php->addRawVariable($cache_var_name, $this->registeredExtensions);
$php->store();
}
if ($is_virtual_load) {
$this->virtualLoadingCompleted = true;
eZDebug::accumulatorStop('OpenVolanoExtensionLoader_VirtualSiteaccess');
} else {
if (!$isBasicLoad) {
$this->standardLoadingCompleted = true;
$this->non_virtual_siteaccess_name = $siteaccess;
eZDebug::accumulatorStop('OpenVolanoExtensionLoader_Siteaccess');
} else {
self::$earlyLoadingCompleted = true;
eZDebug::accumulatorStop('OpenVolanoExtensionLoader_Basic');
}
}
//Use the following line to take a look into the ini-hierarchy...
//ymc_pr($GLOBALS["eZINIOverrideDirList"], $siteaccess.'|'.self::getCurrentSiteaccess());
if (!$is_virtual_load and !$isBasicLoad and $ini->hasVariable('SiteAccessSettings', 'VirtualSiteaccessSystem') and $ini->variable('SiteAccessSettings', 'VirtualSiteaccessSystem') !== 'disabled') {
$allowLoadingOfPreviouslyKnownSiteaccesses = false;
if ($ini->hasVariable('SiteAccessSettings', 'VirtualSiteaccessSystem') and $ini->variable('VirtualSiteaccessSettings', 'AllowLoadingOfPerviouslyKnowSiteaccesses') === 'enabled') {
$allowLoadingOfPreviouslyKnownSiteaccesses = true;
}
if (isset($GLOBALS['eZURIRequestInstance']) and is_object($GLOBALS['eZURIRequestInstance'])) {
$uri = eZURI::instance();
$elements = $uri->elements(false);
if (count($elements) > 0 and $elements[0] != '') {
$goInVirtualSiteaccessMode = true;
if ($ini->hasVariable('VirtualSiteaccessSettings', 'SkipLoadingForUri') and is_array($ini->variable('VirtualSiteaccessSettings', 'SkipLoadingForUri')) and count($ini->variable('VirtualSiteaccessSettings', 'SkipLoadingForUri')) > 0) {
$uri_string = $uri->elements(true);
foreach ($ini->variable('VirtualSiteaccessSettings', 'SkipLoadingForUri') as $ignoreUriForVirtualSiteaccess) {
if (strpos($uri_string, $ignoreUriForVirtualSiteaccess) === 0) {
$goInVirtualSiteaccessMode = false;
break;
}
}
unset($uri_string);
}
} else {
$goInVirtualSiteaccessMode = false;
}
if ($goInVirtualSiteaccessMode) {
$matchIndex = 1;
$name = $elements[0];
//by ymc-dabe //Code taken from /access.php line 241-249 of eZ publish v4.1.3 //KEEP IT IN SYNC! //start
$name = preg_replace(array('/[^a-zA-Z0-9]+/', '/_+/', '/^_/', '/_$/'), array('_', '_', '', ''), $name);
//by ymc-dabe //Code taken from /access.php line 241-249 of eZ publush v4.1.3 //KEEP IT IN SYNC! //end
if ($allowLoadingOfPreviouslyKnownSiteaccesses or !in_array($name, $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList'))) {
eZSys::addAccessPath($name);
$uri->increase($matchIndex);
$uri->dropBase();
$this->registerExtensions($name);
//die if virtual siteaccess is not found
if (!in_array($name, $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList'))) {
header($_SERVER['SERVER_PROTOCOL'] . " 400 Bad Request");
header("Status: 400 Bad Request");
eZExecution::cleanExit();
}
}
unset($name);
}
} else {
if (isset($GLOBALS['ymcEnhancedExtensionLoaderVirtualSiteaccess']) and $GLOBALS['ymcEnhancedExtensionLoaderVirtualSiteaccess'] != '') {
$virtualSiteaccessName = $GLOBALS['ymcEnhancedExtensionLoaderVirtualSiteaccess'];
if ($allowLoadingOfPreviouslyKnownSiteaccesses or !in_array($virtualSiteaccessName, $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList'))) {
eZSys::addAccessPath($virtualSiteaccessName);
$this->registerExtensions($virtualSiteaccessName);
if (!in_array($virtualSiteaccessName, $ini->variable('SiteAccessSettings', 'AvailableSiteAccessList'))) {
fputs(STDERR, "\n----------\nError: Invalid siteaccess '{$virtualSiteaccessName}'!\n----------\n\n");
eZExecution::cleanExit();
}
}
unset($virtualSiteaccessName);
}
}
} else {
if ($this->standardLoadingCompleted === true) {
$this->virtualLoadingCompleted = true;
}
}
if ($this->standardLoadingCompleted === true) {
$this->loadingCompleted = true;
if ($this->originalNonVirtualSiteaccessName === false) {
$this->originalNonVirtualSiteaccessName = $this->attribute('non_virtual_siteaccess');
if ($this->originalVirtualSiteaccessName === false and $siteaccess != $this->attribute('non_virtual_siteaccess')) {
$this->originalVirtualSiteaccessName = $siteaccess;
}
}
}
}