本文整理汇总了PHP中eZSys::clearAccessPath方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSys::clearAccessPath方法的具体用法?PHP eZSys::clearAccessPath怎么用?PHP eZSys::clearAccessPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSys
的用法示例。
在下文中一共展示了eZSys::clearAccessPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: change
/**
* Changes the site access to what's defined in $access. It will change the
* access path in eZSys and prepend an override dir to eZINI
* Note: does not load extensions, use {@link eZSiteAccess::load()} if you want that
*
* @since 4.4
* @param array $access An associative array with 'name' (string), 'type' (int) and 'uri_part' (array).
* See {@link eZSiteAccess::match()} for array structure definition
* @param eZINI|null $siteINI Optional parameter to be able to only do change on specific instance of site.ini
* hence skip changing eZSys access paths (but not siteaccess, see {@link eZSiteAccess::load()})
* @return array The $access parameter
*/
static function change( array $access, eZINI $siteINI = null )
{
$name = $access['name'];
$GLOBALS['eZCurrentAccess'] =& $access;
if ( $siteINI !== null )
{
$ini = $siteINI;
}
else
{
$ini = eZINI::instance();
}
$ini->prependOverrideDir( "siteaccess/$name", false, 'siteaccess', 'siteaccess' );
/* Make sure extension siteaccesses are prepended */
eZExtension::prependExtensionSiteAccesses( $name, $ini );
$ini->loadCache();
// change some global settings if $siteINI is null
if ( $siteINI === null )
{
eZSys::clearAccessPath();
if ( !isset( $access['uri_part'] ) || $access['uri_part'] === null )
{
if ( $ini->hasVariable('SiteSettings', 'SiteUriParts') )
$access['uri_part'] = $ini->variable('SiteSettings', 'SiteUriParts');
else if ( isset( $access['type'] ) && $access['type'] === eZSiteAccess::TYPE_URI )
$access['uri_part'] = array( $access['name'] );
else
$access['uri_part'] = array();
}
eZSys::setAccessPath( $access['uri_part'], $name );
eZUpdateDebugSettings();
eZDebugSetting::writeDebug( 'kernel-siteaccess', "Updated settings to use siteaccess '$name'", __METHOD__ );
}
return $access;
}
示例2: testIndexFileRemoveSiteAccessIfDefaultAccessDisabled2
/**
* Test eZSys $AccessPath as it works as of 4.4 with propertied to
* define scope of path with RemoveSiteAccessIfDefaultAccess=disabled
*/
public function testIndexFileRemoveSiteAccessIfDefaultAccessDisabled2()
{
// 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::setAccessPath( array( 'testing', 'indexFile' ), 'test-path', false );
$indexFile = eZSys::indexFile();
self::assertEquals( "/$defaultAccess/testing/indexFile", $indexFile );
// -------------------------------------------------------------------
// TEST TEAR DOWN ----------------------------------------------------
$ini->setVariable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess', $orgRemoveSiteaccess );
eZSys::clearAccessPath( false );
// -------------------------------------------------------------------
}