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


PHP eZExtension::prependExtensionSiteAccesses方法代码示例

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


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

示例1: changeSiteAccessSetting

function changeSiteAccessSetting(&$siteaccess, $optionData)
{
    $cli = eZCLI::instance();
    if (file_exists('settings/siteaccess/' . $optionData)) {
        $siteaccess = $optionData;
        return "Using siteaccess {$siteaccess} for cronjob";
    } elseif (isExtensionSiteaccess($optionData)) {
        $siteaccess = $optionData;
        eZExtension::prependExtensionSiteAccesses($siteaccess);
        return "Using extension siteaccess {$siteaccess} for cronjob";
    } else {
        return "Siteaccess {$optionData} does not exist, using default siteaccess";
    }
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:14,代码来源:runcronjobs.php

示例2: changeSiteAccessSetting

function changeSiteAccessSetting(&$siteaccess, $optionData)
{
    global $cronPart;
    $cli = eZCLI::instance();
    if (file_exists('settings/siteaccess/' . $optionData)) {
        $siteaccess = $optionData;
        $cli->output("Using siteaccess {$siteaccess} for cronjob");
    } elseif (isExtensionSiteaccess($optionData)) {
        $siteaccess = $optionData;
        $cli->output("Using extension siteaccess {$siteaccess} for cronjob");
        eZExtension::prependExtensionSiteAccesses($siteaccess);
    } else {
        $cli->notice("Siteaccess {$optionData} does not exist, using default siteaccess");
    }
}
开发者ID:nlescure,项目名称:ezpublish,代码行数:15,代码来源:runcronjobs.php

示例3: changeSiteAccessSetting

function changeSiteAccessSetting( $siteaccess )
{
    global $cli;
    if ( file_exists( 'settings/siteaccess/' . $siteaccess ) )
    {
        $cli->notice( 'Using siteaccess "' . $siteaccess . '" for installation from XML' );
    }
    elseif ( isExtensionSiteaccess( $siteaccess ) )
    {
        $cli->notice( 'Using extension siteaccess "' . $siteaccess . '" for installation from XML' );
        eZExtension::prependExtensionSiteAccesses( $siteaccess );
    }
    else
    {
        $cli->notice( 'Siteaccess "' . $siteaccess . '" does not exist, using default siteaccess' );
    }
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:17,代码来源:xmlinstaller.php

示例4: 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;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:53,代码来源:ezsiteaccess.php

示例5: findInputFiles

 function findInputFiles(&$inputFiles, &$iniFile)
 {
     if ($this->RootDir !== false) {
         $iniFile = eZDir::path(array($this->RootDir, $this->FileName));
     } else {
         $iniFile = eZDir::path(array($this->FileName));
     }
     $inputFiles = array();
     if ($this->FileName === 'override.ini') {
         eZExtension::prependExtensionSiteAccesses(false, $this, true, false, false);
     }
     if (file_exists($iniFile)) {
         $inputFiles[] = $iniFile;
     }
     // try the same file name with '.append.php' replace with '.append'
     if (strpos($iniFile, '.append.php') !== false && preg_match('#^(.+.append).php$#i', $iniFile, $matches) && file_exists($matches[1])) {
         $inputFiles[] = $matches[1];
     }
     if (strpos($iniFile, '.php') === false && file_exists($iniFile . '.php')) {
         $inputFiles[] = $iniFile . '.php';
     }
     if ($this->DirectAccess) {
         if (file_exists($iniFile . '.append')) {
             eZDebug::writeStrict("INI files with *.ini.append suffix is DEPRECATED, use *.ini or *.ini.append.php instead: {$iniFile}.append", __METHOD__);
             $inputFiles[] = $iniFile . '.append';
         }
         if (file_exists($iniFile . '.append.php')) {
             $inputFiles[] = $iniFile . '.append.php';
         }
     } else {
         $overrideDirs = $this->overrideDirs();
         $fileName = $this->FileName;
         $rootDir = $this->RootDir;
         foreach ($overrideDirs as $overrideDirItem) {
             $overrideDir = $overrideDirItem[0];
             $isGlobal = $overrideDirItem[1];
             if ($isGlobal) {
                 $overrideFile = eZDir::path(array($overrideDir, $fileName));
             } else {
                 $overrideFile = eZDir::path(array($rootDir, $overrideDir, $fileName));
             }
             if (file_exists($overrideFile . '.php')) {
                 eZDebug::writeStrict("INI files with *.ini.php suffix is DEPRECATED, use *.ini or *.ini.append.php instead: {$overrideFile}.php", __METHOD__);
                 $inputFiles[] = $overrideFile . '.php';
             }
             if (file_exists($overrideFile)) {
                 $inputFiles[] = $overrideFile;
             }
             if (file_exists($overrideFile . '.append.php')) {
                 $inputFiles[] = $overrideFile . '.append.php';
             }
             if (file_exists($overrideFile . '.append')) {
                 eZDebug::writeStrict("INI files with *.ini.append suffix is DEPRECATED, use *.ini or *.ini.append.php instead: {$overrideFile}.append", __METHOD__);
                 $inputFiles[] = $overrideFile . '.append';
             }
         }
     }
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:58,代码来源:ezini.php

示例6: switchSiteaccessInternally

 /**
  * Switch the siteaccess during runtime.
  *
  * WARNING: eZ publish does not support unloading extensions very well. Using this method might
  *          leave the system with partly registered extensions!
  *
  * @param  string  $requested_siteaccess The name of an existing real siteaccess.
  * @param  string  $virtual_siteaccess   The name of an optional virtual siteaccess.
  * @return boolean true on success - otherwise false
  * @access private
  * @author ymc-dabe
  */
 private function switchSiteaccessInternally($requested_siteaccess = false, $virtual_siteaccess = false)
 {
     if (self::getCurrentSiteaccess() === null) {
         return false;
     }
     //We might simply want to switch back to the original siteaccess...
     if ($requested_siteaccess === false and $virtual_siteaccess === false) {
         $requested_siteaccess = $this->attribute('original_non_virtual_siteaccess');
         $virtual_siteaccess = $this->attribute('original_virtual_siteaccess');
     }
     if (!$this->attribute('is_enabled')) {
         eZDebug::writeError("The ymcExtensionLoader is disabled, but " . __METHOD__ . " has just been called (which really shouldn't be done)!", __METHOD__);
         return false;
     }
     //no switching needed. bye.
     if ($requested_siteaccess == self::getCurrentNonVirtualSiteaccess() and $virtual_siteaccess == self::getCurrentVirtualSiteaccess()) {
         return true;
     }
     //Reset the loaded extensions...
     self::$earlyLoadingCompleted = false;
     $this->standardLoadingCompleted = false;
     $this->virtualLoadingCompleted = false;
     $this->loadingCompleted = false;
     $this->registeredExtensions = array();
     $this->non_virtual_siteaccess_name = false;
     //Reset all loaded INIs
     unset($GLOBALS["eZINIOverrideDirList"]);
     //Set no siteaccess
     self::setInternalSiteaccess(null);
     //Initialise INI (using site.ini)
     $ini = eZINI::instance();
     //FLush the INI-Cache (of site.ini)
     $ini->loadCache();
     //Activate basic extensions
     $this->registerExtensions();
     //Set the requested siteaccess and load it
     self::setInternalSiteaccess($requested_siteaccess);
     //Advice new INI-files to use (as it is done by eZ publish on startup
     if (file_exists("settings/siteaccess/{$requested_siteaccess}")) {
         $ini->prependOverrideDir("siteaccess/{$requested_siteaccess}", false, 'siteaccess');
     }
     eZExtension::prependExtensionSiteAccesses($requested_siteaccess);
     //FLush the INI-Cache (of site.ini)
     $ini->loadCache();
     //Register access-extensions
     $this->registerExtensions();
     //Activate the virtual_siteaccess if needed
     if ($virtual_siteaccess !== false) {
         $this->registerExtensions($virtual_siteaccess);
     }
     return true;
 }
开发者ID:pascalvb,项目名称:eZ-ExtensionLoader,代码行数:64,代码来源:ymcextensionloader.php


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