當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZExtension::clearActiveExtensionsMemoryCache方法代碼示例

本文整理匯總了PHP中eZExtension::clearActiveExtensionsMemoryCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZExtension::clearActiveExtensionsMemoryCache方法的具體用法?PHP eZExtension::clearActiveExtensionsMemoryCache怎麽用?PHP eZExtension::clearActiveExtensionsMemoryCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZExtension的用法示例。


在下文中一共展示了eZExtension::clearActiveExtensionsMemoryCache方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: unload

 /**
  * Unloads an extension by removing it from ActiveExtensions setting,
  * clearing extensions cache and remove ini dir (not extension siteaccess)
  *
  * @param string $extension Extension name to unload
  * @return bool True on success, false if not loaded
  */
 public static function unload($extension)
 {
     $ini = eZINI::instance();
     $activeExtensions = $ini->variable('ExtensionSettings', 'ActiveExtensions');
     if (!in_array($extension, $activeExtensions, true)) {
         return false;
     }
     $ini->setVariable('ExtensionSettings', 'ActiveExtensions', array_diff($activeExtensions, array($extension)));
     $ini->removeOverrideDir('extension:' . $extension);
     eZExtension::clearActiveExtensionsMemoryCache();
     return true;
 }
開發者ID:CG77,項目名稱:ezpublish-legacy,代碼行數:19,代碼來源:ezpextensionhelper.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: clearActiveExtensions

 /**
  * Clears active extensions list cache
  */
 static function clearActiveExtensions($cacheItem)
 {
     eZExpiryHandler::registerShutdownFunction();
     $handler = eZExpiryHandler::instance();
     $handler->setTimestamp($cacheItem['expiry-key'], time());
     $handler->store();
     eZExtension::clearActiveExtensionsMemoryCache();
 }
開發者ID:nfrp,項目名稱:ezpublish,代碼行數:11,代碼來源:ezcache.php

示例4: 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


注:本文中的eZExtension::clearActiveExtensionsMemoryCache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。