• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ClusterTool类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了ClusterTool类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: processOptions

function processOptions($options)
{

    if ($options['clusterIdentifier'] == null)
    {
        throw new Exception("No clusters given. Should pass argument clusterIdentifier with value 'all' if all clusters are requested");
    }

    $allClusters = ClusterTool::getAllClusters();
    if ($options['clusterIdentifier'] == 'all')
    {
        $clusters = $allClusters;
    } else
    {
        $clusters = explode(',', $options['clusterIdentifier']);
        $clusters = array_filter($clusters, function($v) use ($allClusters) {
            return in_array($v, $allClusters);
        });
    }
    $exclude = isset($options['exclude']) ? filter_var($options['exclude'], FILTER_VALIDATE_BOOLEAN) : false;
    if ($exclude)
    {
        $clusters = array_diff($allClusters, $clusters);
    }
    $parsedOptions = array(
        'clusters' => $clusters,
        'exclude' => $exclude,
    );
    return $parsedOptions;
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:quiz_move_to_hall_of_fame.php


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


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


示例7: parseOptions

function parseOptions(array $options)
{
    $parsedOptions = array();
    $parsedOptions['clusterIdentifier'] = isset($options['clusterIdentifier']) ? explode(',', $options['clusterIdentifier']) : ClusterTool::globCluster();
    $parsedOptions['path'] = isset($options['path']) ? $options['path'] : DEFAULT_BANNER_PATH;
    $parsedOptions['convertPath'] = isset($options['convertPath']) ? $options['convertPath'] : eZINI::instance('image.ini')->variable('ImageMagick', 'ExecutablePath');
    return $parsedOptions;
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:8,代码来源:convert_hero_banners.php


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


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


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


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


示例12: parseOptions

function parseOptions(array $options)
{
    $parsedOptions = array();

    $existingClusters = ClusterTool::globCluster();
    if (empty($options['clusterIdentifier'])) {
        $parsedOptions['clusters'] = $existingClusters;
    } else {
        $clusterList = explode(',', $options['clusterIdentifier']);
        $clusterList = array_intersect($clusterList, $existingClusters);
        $parsedOptions['clusters'] = $clusterList;
    }
    return $parsedOptions;
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:14,代码来源:generate_json_translations.php


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


示例14: getApplicationTemplate

    /**
     * @param int $applicationTypeId
     * @return ApplicationTemplate
     */
    public static function getApplicationTemplate( $applicationTypeId )
    {
        $conditionList = ClusterTool::clusterOverride( array('application_type_id' => $applicationTypeId ) );

        foreach ( $conditionList as $condition )
        {
            $applicationTemplate = self::fetchObject( self::definition(), null, $condition );
            if ( $applicationTemplate instanceof self )
            {
                return $applicationTemplate;
            }
        }

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


示例15: getStaticConfiguration

    /**
     * @param int $applicationId
     * @return ApplicationStaticConfiguration
     */
    static public function getStaticConfiguration( $applicationId )
    {
        $conditionList = ClusterTool::clusterOverride( array('application_id' => $applicationId) );

        foreach ( $conditionList as $condition )
        {
            $staticConfiguration = self::fetchObject( self::definition(), null, $condition );

            if ( $staticConfiguration instanceof self )
            {
                return $staticConfiguration;
            }
        }

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


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


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


示例18: getExternalConfiguration

    /**
     * @param int $applicationId
     * @return ExternalLinkHandler
     */
    public static function getExternalConfiguration( $applicationId )
    {
        $conditionList = ClusterTool::clusterOverride( array('application_id' => $applicationId) );

        foreach ( $conditionList as $condition )
        {
            $externalConfiguration = self::fetchObject( self::definition(), null, $condition );

            if ( $externalConfiguration instanceof self )
            {
                $externalConfiguration->buildExternalLinkHandler();

                return $externalConfiguration;
            }
        }

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


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


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CodFormat类代码示例发布时间:2022-05-23
下一篇:
PHP Club类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap