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


PHP ClusterTool::clusterIdentifier方法代码示例

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


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

示例1: isUserTokenValid

    /**
     * @param $token
     * @return bool
     */
    public static function isUserTokenValid($token)
    {
        //get secret seed and add date (20140703)
        $secretSeed = self::getFormSecretSeed();

        //get user id (anonymous or current logged user)
        $userId = MMUsers::getCurrentUserId() != -1 ? MMUsers::getCurrentUserId() : MMUsers::getAnonymousUserId();

        //cluster identifier
        $clusterIdentifier = ClusterTool::clusterIdentifier();

        if(sha1($secretSeed . date('Ymd') . $userId . $clusterIdentifier) == $token)
        {
            return true;
        }
        //yesterday date
        else if(sha1($secretSeed . date('Ymd', time() - 60 * 60 * 24) . $userId . $clusterIdentifier) == $token)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:29,代码来源:securityTool.php

示例2: additionalSolrFilters

 public function additionalSolrFilters()
 {
     return array(
     		sprintf('-attr_exclude_from_search_%s_b:1', ClusterTool::clusterIdentifier()),
     		'-attr_hide_in_search_b:true'
     );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:7,代码来源:MMOncologySearchSolrQueryHandler.php

示例3: loadConfiguration

    /**
     * @return bool
     */
    private static function loadConfiguration()
    {
        if( !empty( self::$fields ) )
        {
            return false;
        }

        $db = MMDB::instance();

        $clusterIdentifier = ClusterTool::clusterIdentifier();

        $query = 'SELECT f.business_name, f.attribute_type, l.default_value,
                  CASE WHEN l.control_type_identifier IS NULL THEN f.control_type_identifier ELSE l.control_type_identifier END AS control_type_identifier,
                  CASE WHEN l.control_type_value IS NULL THEN f.control_type_value ELSE l.control_type_value END AS control_type_value
                  FROM uump_field AS f INNER JOIN uump_localized_field AS l ON l.field_id = f.id AND l.cluster_identifier = "%s"
                  ORDER BY f.business_name';
        $results = $db->arrayQuery( sprintf( $query, $clusterIdentifier ) );

        foreach( $results as $result )
        {
            self::$fields[$result['business_name']] = array(
                'control_type_identifier' => $result['control_type_identifier'],
                'control_type_value'      => $result['control_type_value'],
                'attribute_type'          => $result['attribute_type'],
                'default_value'           => $result['default_value']
            );
        }

        return true;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:33,代码来源:uumpTool.php

示例4: render

 /**
  * Renders the block (returns HTML)
  *
  * @return string HTML
  **/
 public function render()
 {
     $tpl = eZTemplate::factory();
     $tpl->setVariable( 'name', $this->name );
     $tpl->setVariable( 'banners', $this->fetchBanners() );
     $tpl->setVariable( 'cluster_identifier', ClusterTool::clusterIdentifier() );
     return $tpl->fetch( 'design:presenters/block/channel.tpl' );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:13,代码来源:mmblockchannelpresenter.php

示例5: fetchByClusterIdentifier

 /**
  * @param string $clusterIdentifier
  * @return SystemLocale[]
  */
 static public function fetchByClusterIdentifier( $clusterIdentifier = null )
 {
     return self::fetchObjectList(
         self::definition(),
         null,
         array( 'cluster_identifier' => is_null( $clusterIdentifier ) ? ClusterTool::clusterIdentifier() : $clusterIdentifier )
     );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:12,代码来源:systemlocale.php

示例6: validateToU

    /**
     * @return string
     */
    protected function validateToU()
    {
        if( !self::user() )
            return false;

        self::user()->toUValidated(true);

        $context = ContextTool::instance()->backUrl();
        $context = isset( $_POST['context'] ) ? $_POST['context'] : '/';

        // @todo: update ESB by sending validation status
        $esbResult = new ESBResult();
        $userService = ESBFactory::getUserService();

        if(SolrSafeOperatorHelper::featureIsActive('UUMP'))
        {
            
            $result = $userService->read(self::user()->attribute('uuid'));
            ServiceLoginUUMP::populateESBResult($esbResult, $result);
        }
        else
        {
            $result = ServiceLogin::readCall(self::user()->attribute('uuid'), $esbResult);
            ServiceLogin::populateESBResult($esbResult, $result);
        }

        $esbResult->userName = self::user()->attribute('uuid');
        $esbResult->termsOfUse = 'Y';
        $esbResult->privacyPolicy = 'Y';

        if( SolrSafeOperatorHelper::featureIsActive('UUMP') || (ClusterTool::clusterIdentifier() == "cluster_at") )
        {
            $esbResult->termsOfUse = '1';
            $esbResult->privacyPolicy = '1';
        }
        $esbResult->countryOfRegistration = self::user()->attribute( 'country' );

        $userService->write($esbResult->toServiceAgreementTicket());

        // if the ESB call fails, we still validate the user input to let him access the content
        $esbResult->forceToUValidated = true;
        $esbResult->sessionID = $_COOKIE[self::iniMerck()->variable('TIBCOCookieSettings', 'TIBCOCookieName')];

        $loginResult = MMUserLogin::esbLogin( self::user()->attribute('uuid'), $esbResult, false, $context );
        if ( $loginResult )
        {
            // Stringify params
            $strParams = json_encode( $loginResult['params'] );

            // Encrypts params
            $encryptedParams = MMUserLogin::encryptText( $strParams );
            // Redirect to PHP-ESI
            $redirectURL = ContextTool::instance()->domain()."/loginActions.php?context=" . urlencode( $loginResult['destUrl'] ) . "&params=" . urlencode( $encryptedParams );
        
            return $redirectURL;
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:60,代码来源:BlockServiceAgreement.php

示例7: dailyValue

    /**
     * @param string $name
     * @param mixed $value
     * @param string $cacheFileName
     * @return mixed|null
     */
    public static function dailyValue( $name, $value = null, $cacheFileName = null )
    {
        if ( $value === null && isset($memoryCache[$name]) && $cacheFileName === null )
        {
            return self::$memoryCache[$name];
        }
        else
        {
            if (is_null($cacheFileName))
            {
                $cacheFileName = self::DAILY_CACHE_FILE . '_' . ClusterTool::clusterIdentifier();
            }

            $cache = new eZPHPCreator(
                eZSys::cacheDirectory(),
                $cacheFileName . '.php',
                '',
                array()
            );

            $expiryTime = time() - 24 * 3600;

            // reading
            if ($cache->canRestore($expiryTime))
            {
                $values = $cache->restore(array('cacheTable' => 'cacheTable'));

                if (is_null($value))
                {
                    if (isset($values['cacheTable'][$name]))
                    {
                        return $values['cacheTable'][$name];
                    }
                    else
                    {
                        return null;
                    }
                }
            }
            else
            {
                $values = array('cacheTable' => array());
            }

            $values['cacheTable'][$name] = $value;
            if ( $cacheFileName == self::DAILY_CACHE_FILE . '_' . ClusterTool::clusterIdentifier() )
                self::$memoryCache = $values['cacheTable'];

            // writing
            $cache->addVariable('cacheTable', $values['cacheTable']);
            $cache->store(true);
            $cache->close();
        }

        return null;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:62,代码来源:cacheTool.php

示例8: fetchByClusterIdentifier

    /**
     * @return TouPpPopin
     */
    public static function fetchByClusterIdentifier()
    {
        $conditions = array(
            "cluster_identifier" => ClusterTool::clusterIdentifier(),
        );

        $results = self::fetchObjectList(self::definition(), null, $conditions, null, 1);

        return !is_null($results) ? array_pop($results) : null;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:13,代码来源:TouPpPopin.php

示例9: getFetchParams

 /**
  * @return array
  */
 public static function getFetchParams()
 {
     return array(
         'indent'       => 'on',
         'q'            => '',
         'start'        => 0,
         'rows'         => 10,
         'fl'           => 'meta_node_id_si, attr_view_counter_'.ClusterTool::clusterIdentifier().'_i, attr_content_rating_'.ClusterTool::clusterIdentifier().'_f',
         'qt'           => 'ezpublish',
         'explainOther' => '',
         'hl.fl'        => '',
         'sort'         => 'attr_online_date_dt desc, attr_headline_lc_s asc'
     );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:17,代码来源:mmhomepage.php

示例10: htmlBuildListResult

    public function htmlBuildListResult()
    {
        $this->resultHandler->parseRequestParams();

        $this->pushResult('cluster_identifier', ClusterTool::clusterIdentifier());
        $this->pushResult('class_identifiers' , $this->resultHandler->contentClassIdentifiers);
        $this->pushResult('is_logged_in'      , (bool)$this->user());
        $this->pushResult('tou_validated'     , ($this->user() && $this->user()->toUValidated()));
        $this->pushResult('num_found'         , 0);
        $this->pushResult('sort_list'         , $this->resultHandler->sortList);
        $this->pushResult('facets'            , $this->getFacetsAsArray());

        if ( $this->applicationObject && !empty($this->applicationObject->configurationContentService) )
            $this->pushResult('content_service_configuration', $this->applicationObject->configurationContentService);
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:15,代码来源:ContentListSolrOnly.php

示例11: formatSolrResponseAttributes

    /**
     * @param $solrResponse
     * @return array
     */
    protected function formatSolrResponseAttributes($solrResponse)
    {
        $formatedResult = array();
        foreach($solrResponse as $item)
        {
            $formatedResult[] = array(
                'headline'      =>        $item['attr_headline_t'],
                'description'   =>        $item['attr_promo_description_t'],
                'url'           =>        $item['attr_'.ClusterTool::clusterIdentifier().'_url_s'],
                'category'      =>        $item['attr_category_t'],
                'date'          =>        $item['attr_date_dt'],
            );
        }

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

示例12: reset

 public function reset()
 {
     $this->_logData = array(
         'guid'       => uniqid(),
         'cluster'    => \ClusterTool::clusterIdentifier(),
         'dateGMT'    => gmdate('Y-m-d H:i:s'),
         'dateLocal'  => date('Y-m-d H:i:s'),
         'action'     => null,
         'step'       => null,
         'uuid'       => null,
         'esb_status' => null,
         'msg'        => null,
         'referer'    => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
         'ip'         => \eZSys::clientIP(),
         'method'     => $_SERVER['REQUEST_METHOD'],
     );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:17,代码来源:UserLog.php

示例13: getStaticPath

    /**
     * @param string $clusterIdentifier
     * @param string $applicationIdentifier
     * @param string $bannerType
     * @return string
     */
    public static function getStaticPath( $clusterIdentifier, $applicationIdentifier, $bannerType )
    {
        if ( $clusterIdentifier !== ClusterTool::clusterIdentifier() )
        {
            ClusterTool::setCurrentCluster($clusterIdentifier);
        }
        $applicationLocalized = CacheApplicationTool::buildLocalizedApplicationByIdentifier( $applicationIdentifier );
        if ( !($applicationLocalized instanceof ApplicationLocalized) )
        {
            return null;
        }
        $bannerArray = $applicationLocalized->getBanners();
        if( isset( $bannerArray[$bannerType] ) && !empty( $bannerArray[$bannerType] ) )
        {
            return preg_replace( '#/extension#', 'extension/', $bannerArray[$bannerType] );
        }

        return null;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:25,代码来源:bannerPathTool.php

示例14: search

    /**
     * @param string $query
     * @param int $limit
     * @return array
     */
    public static function search( $query, $limit = 3 )
    {
        if ( !empty( $query ) )
        {
            $params = array(
                'qf' => self::META_APPLICATION_KEYWORD . ' ' . self::HEADLINE_KEYWORD,
                'qt' => 'ezpublish',
                'start' => 0,
                'rows' => $limit,
                'q' => '"' . StringTool::removeAccents( strtolower( $query ) ) . '"',
                'fq' => 'cluster_identifier_s:' . ClusterTool::clusterIdentifier() . ' AND ' . self::META_INSTALLATION_ID_MS_KEY . ':' . self::META_INSTALLATION_ID_MS_VAL,
                'fl' => '*,score',
                'sort' => 'name_s asc'
            );

            $result = SolrTool::rawSearch( $params, 'php', false );
            return $result;
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:24,代码来源:applicationSearch.php

示例15: __construct

    public function __construct()
    {
        // Guzzle RESTclient
        $this->builder = ServiceBuilder::factory(__DIR__ . '/../../classes/service/descriptor.php');


        $this->client = $this->builder['ldap'];

        // Logger
        $filter = new ezcLogFilter();
        $filter->severity = ezcLog::ERROR | ezcLog::INFO | ezcLog::WARNING;
        $this->logger = ezcLog::getInstance();
        $logFileName = "ws.log";
        if ( SolrSafeOperatorHelper::clusterIni('WebService', 'CountrySpecificLogs', 'merck.ini') == 'enabled' )
        {
            $clusterId = ClusterTool::clusterIdentifier();
            $logFileName = "ws_{$clusterId}.log";
        }
        $this->logger->getMapper()->appendRule(new ezcLogFilterRule( $filter, new ezcLogUnixFileWriter( "var/log/", $logFileName, 157286400, 3 ), true ) );
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:20,代码来源:WSHelper.php


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