当前位置: 首页>>代码示例>>PHP>>正文


PHP eZINI::resetOverrideDirs方法代码示例

本文整理汇总了PHP中eZINI::resetOverrideDirs方法的典型用法代码示例。如果您正苦于以下问题:PHP eZINI::resetOverrideDirs方法的具体用法?PHP eZINI::resetOverrideDirs怎么用?PHP eZINI::resetOverrideDirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZINI的用法示例。


在下文中一共展示了eZINI::resetOverrideDirs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testOverrideDirScopesExtensionRemove

 /**
  * Test prepending extension dirs and removing
  */
 public function testOverrideDirScopesExtensionRemove()
 {
     $ini = new eZINI('site.ini', 'settings', null, null, true);
     $ini->resetOverrideDirs();
     $ini->prependOverrideDir("extension/ext1/settings", true, 'extension:ext1', 'extension');
     $ini->prependOverrideDir("extension/ext2/settings", true, 'extension:ext2', 'extension');
     $ini->prependOverrideDir("extension/ext3/settings", true, 'extension:ext3', 'extension');
     $ini->prependOverrideDir("extension/ext1/settings", true, 'extension:ext1', 'sa-extension');
     $ini->removeOverrideDir('extension:ext1');
     $success = $ini->removeOverrideDir('extension:ext1', 'sa-extension');
     $failed = $ini->removeOverrideDir('extension:ext8');
     $overrideDirs = $ini->overrideDirs(false);
     self::assertEquals(3, count($ini->overrideDirs()), 'There should have been three override dirs in total in this ini instance.');
     self::assertEquals(2, count($overrideDirs['extension']), 'There should have been two override dirs in extension scope.');
     self::assertEquals(0, count($overrideDirs['sa-extension']), 'There should have been 0 override dirs in sa-extension scope.');
     self::assertTrue($success, '$ini->removeOverrideDir( \'extension:ext1\', \'sa-extension\' ) should have been returned true as identifier does exist.');
     self::assertFalse($failed, '$ini->removeOverrideDir( \'extension:ext8\' ) should have been returned false as identifier does not exist.');
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:21,代码来源:ezini_test.php

示例2: load

    /**
     * Reloads extensions and changes siteaccess globally
     * If you only want changes on a instance of ini, use {@link eZSiteAccess::getIni()}
     *
     * - clears all in-memory caches used by the INI system
     * - re-builds the list of paths where INI files are searched for
     * - runs {@link eZSiteAccess::change()}
     * - re-searches module paths {@link eZModule::setGlobalPathList()}
     *
     * @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
     *                            If set, then global siteacceess will not be changed as well.
     * @return array The $access parameter
     */
    static function load( array $access, eZINI $siteINI = null )
    {
        $currentSiteAccess = $GLOBALS['eZCurrentAccess'];
        unset( $GLOBALS['eZCurrentAccess'] );

        // Clear all ini override dirs
        if ( $siteINI instanceof eZINI )
        {
            $siteINI->resetOverrideDirs();
        }
        else
        {
            eZINI::resetAllInstances();
            eZExtension::clearActiveExtensionsMemoryCache();
            eZTemplateDesignResource::clearInMemoryCache();
        }

        // Reload extensions, siteaccess and access extensions
        eZExtension::activateExtensions( 'default', $siteINI );
        $access = self::change( $access, $siteINI );
        eZExtension::activateExtensions( 'access', $siteINI );

        // Restore current (old) siteacces if changes where only to be applied to locale instance of site.ini
        if ( $siteINI instanceof eZINI )
        {
            $GLOBALS['eZCurrentAccess'] = $currentSiteAccess;
        }
        else
        {
            $moduleRepositories = eZModule::activeModuleRepositories();
            eZModule::setGlobalPathList( $moduleRepositories );
        }

        return $access;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:51,代码来源:ezsiteaccess.php

示例3: load

    /**
     * Reloads extensions and changes siteaccess globally
     * If you only want changes on a instance of ini, use {@link eZSiteAccess::getIni()}
     *
     * - clears all in-memory caches used by the INI system
     * - re-builds the list of paths where INI files are searched for
     * - runs {@link eZSiteAccess::change()}
     * - re-searches module paths {@link eZModule::setGlobalPathList()}
     *
     * @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
     *                            If set, then global siteacceess will not be changed as well.
     * @return array The $access parameter
     */
    static function load( array $access, eZINI $siteINI = null )
    {
        $currentSiteAccess = $GLOBALS['eZCurrentAccess'];
        unset( $GLOBALS['eZCurrentAccess'] );

        // Clear all ini override dirs
        if ( $siteINI instanceof eZINI )
        {
            $siteINI->resetOverrideDirs();
        }
        else
        {
            eZINI::resetAllInstances();
            eZExtension::clearActiveExtensionsMemoryCache();
            eZTemplateDesignResource::clearInMemoryCache();
        }

        // Reload extensions, siteaccess and access extensions
        eZExtension::activateExtensions( 'default', $siteINI );
        $access = self::change( $access, $siteINI );
        eZExtension::activateExtensions( 'access', $siteINI );

        // Reload Extenion ordering to reorder eZINI Global Override Dirs.
        // @TODO : Améliorer la gestion globale (éviter des appels multiples !!!)
        if (  $siteINI instanceof eZINI  && $siteINI->variable( 'ExtensionSettings', 'ExtensionOrdering' ) === 'enabled' )
        {
            eZINI::removeGlobalOverrideDirsByScope( 'sa-extension' );
            eZINI::removeGlobalOverrideDirsByScope( 'extension' );
            eZExtension::activateExtensions( false );
        }

        // Restore current (old) siteacces if changes where only to be applied to locale instance of site.ini
        if ( $siteINI instanceof eZINI )
        {
            $GLOBALS['eZCurrentAccess'] = $currentSiteAccess;
        }
        else
        {
            $moduleRepositories = eZModule::activeModuleRepositories();
            eZModule::setGlobalPathList( $moduleRepositories );
        }

        return $access;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:60,代码来源:ezsiteaccess.php


注:本文中的eZINI::resetOverrideDirs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。