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


PHP ClusterTool::resetCurrentCluster方法代码示例

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


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

示例1: setClusterIdentifier

 /**
  * Changes clusterIdentifier state internally !
  *
  * @param string $clusterIdentifier
  */
 public static function setClusterIdentifier ($clusterIdentifier)
 {
     if ($clusterIdentifier == "")
         ClusterTool::resetCurrentCluster();
     elseif ( in_array($clusterIdentifier, ClusterTool::globCluster()) || $clusterIdentifier == 'cluster_master' )
         ClusterTool::setCurrentCluster($clusterIdentifier);
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:12,代码来源:solrsafeoperatorhelper.php

示例2: array

if( is_null($filename) )
    $script->shutdown(1, 'No File provided - Aborting');

if( !($f = fopen($filename, 'r')) )
    $script->shutdown(2, 'Could not open source file - Aborting');

$db = eZDB::instance();


ClusterTool::setCurrentCluster($cluster);
$appsById = array();
foreach( $db->arrayQuery( sprintf( "SELECT application_id FROM mm_application_localized WHERE cluster_identifier = '%s'", $cluster ) ) as $row )
    $appsById[$row['application_id']] = CacheApplicationTool::buildLocalizedApplicationByApplication($row['application_id'] );
uasort( $appsById, function($a, $b){ return strnatcasecmp( $a->applicationObject->attribute('identifier'), $b->applicationObject->attribute('identifier') ); });

ClusterTool::resetCurrentCluster();



$dumpCmd = 'mysqldump -h'.$db->Server.' -u'.$db->User.' -p'.$db->Password.' '.$db->DB.' mm_application mm_application_localized > "'.eZINI::instance()->variable('FileSettings', 'VarDir').'/mm_application_import_dump.'.date('YmdHis').'.sql"';
$dump = exec($dumpCmd);

$headers = fgetcsv($f, null, ',', '"');

while ( $r= fgetcsv($f, null, ',', '"') )
{
    $row = array_combine($headers, $r);

    // we map the fields
    foreach( array(
        'App Name (icon)'			=> 'name',
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:import_apps_from_zoho.php

示例3: getData

    /**
     * @see ezfSolrDocumentFieldBase::getData()
     * @return array
     */
    public function getData()
    {
        $data           = parent::getData();
        $content        = $this->ContentObjectAttribute->content();
        
        /* @var $content array */
        foreach ( array_merge( self::taxonomyAttribute(), array_keys($content) ) as $taxonomyIdentifier )
        {
            $taxonomyValues              = isset( $content[$taxonomyIdentifier] ) ? $content[$taxonomyIdentifier] : array(); 
            $subattrSourceIdValues       = array();
            $subattrSourceIdFieldName    = self::getCustomSubattributeFieldName(
                                                $taxonomyIdentifier,
                                                'source_id');
            
            foreach ( $taxonomyValues as $taxonomyValue )
            {
                if( preg_match( '#^symptom_.*$#', $taxonomyValue ) )
                {
                    $sourceKey                  = $taxonomyValue;
                    $subattrSourceIdValues[]    = $sourceKey;
                    
                    // we need a few more things for the symptoms
                    /* @type $node eZContentObjectTreeNode */
                    $contentObject = $this->ContentObjectAttribute->object();
                    $node          = $contentObject->mainNode();
                    $clusters      = NodeTool::getArticleClusters($node);

                    foreach( $clusters as $cluster )
                    {
                        ClusterTool::setCurrentCluster($cluster);

                        $ini = eZINI::fetchFromFile('extension/'.$cluster.'/settings/site.ini');
                        $node->setCurrentLanguage( $ini->variable('RegionalSettings', 'ContentObjectLocale') );

                        $applicationLocalized = CacheApplicationTool::buildLocalizedApplicationByIdentifier( MerckManualShowcase::mainApplicationIdentifier() );
                        if ( !$applicationLocalized )
                            continue;

                        $customSymptomAttributeKey = 'attr_custom_symptom_'.$cluster.'_s';
                        $labelTranslations         = FacetFilteringTool::getTaxonomyTranslation( 'symptom' );
                        $label                     = $labelTranslations[$sourceKey];
                        $url                       = preg_replace( '#^[^/]+#', '', MerckManualFunctionCollection::getMerckManualNodeUrl( 'meck-manual-showcase', $node, $ini->variable('RegionalSettings', 'ContentObjectLocale') ) );

                        ClusterTool::resetCurrentCluster();

                        $customSymptomAttributeValueParts = array(
                            mb_strtolower(mb_substr(StringTool::removeAccents( StringTool::CJK2Pinyin($label) ), 0, 1)),
                            $label,
                            $url
                        );

                        $data[$customSymptomAttributeKey] = implode( '##', $customSymptomAttributeValueParts );
                    }
                }
                else if ( preg_match('#^222\.[0-9]+$#', $taxonomyValue ) )
                {
                    $sourceKey                  = $taxonomyValue;
                    $subattrSourceIdValues[]    = $sourceKey;

                    /* @type $node eZContentObjectTreeNode */
                    /* @type $dataMap eZContentObjectAttribute[] */
                    $contentObject                    = $this->ContentObjectAttribute->object();
                    $node                             = $contentObject->mainNode();
                    $clusters                         = NodeTool::getArticleClusters($node);
                    $customSymptomAttributeValueParts = array(
                        $content['layer_natom'][0],
                        $content['sub_layer_natom'][0],
                    );

                    foreach( $clusters as $cluster )
                    {
                        ClusterTool::setCurrentCluster($cluster);

                        $customSymptomAttributeKey        = 'attr_custom_layer_sublayer_natom_'.$cluster.'_s';
                        $data[$customSymptomAttributeKey] = implode( '##', $customSymptomAttributeValueParts );

                        ClusterTool::resetCurrentCluster();
                    }
                }
                else
                    $subattrSourceIdValues[] = trim( $taxonomyValue );
            }

            $data[$subattrSourceIdFieldName] = empty($subattrSourceIdValues) ? '' : $subattrSourceIdValues;
        }
        
        return $data;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:92,代码来源:kezfsolrdocumentfieldserialize.php

示例4: modify


//.........这里部分代码省略.........

                            if ( !empty($mediaDatamap['question']->DataText) )
                            {
                                self::addValueToDoc( $docList, 'attr_media_content_quiz_question_' . $cluster . '_ms', trim(strip_tags($mediaDatamap['question']->DataText)), false );
                            }

                            if ( !$mediaDatamap['points']->hasContent() )
                                continue;

                            $totalQuizzes+= $mediaDatamap['points']->content();
                        }
                    }
                }

                $withMediaDuration    = true;
                $typeMedias           = NodeOperatorHelper::getPictosMedia( $contentMainNode, $withMediaDuration );
                $typeMediasSerialized = base64_encode( json_encode($typeMedias) );

                // getPictosMedia as solr field
                self::addValueToDoc( $docList, 'attr_media_content_types_' . $cluster . '_bst', $typeMediasSerialized, false );

                // getMediaCount as solr field
                $mediaCount = NodeOperatorHelper::getMediaCount($contentMainNode);
                self::addValueToDoc( $docList, 'attr_media_content_count_' . $cluster . '_i', $mediaCount, false );

                // Used only for Quizz
                if ( $totalQuizzes > 0 )
                    self::addValueToDoc( $docList, 'attr_media_content_quiz_points_' . $cluster . '_i', $totalQuizzes, false );
            }
            
            unset($isHidden);
        }

        ClusterTool::resetCurrentCluster();

        $concernedNode = $contentMainNode;
        $concernedNode->setCurrentLanguage($articleLanguageArray[0]);

        if ( $contentMainNode->attribute('depth') > 4 )
        {
            $concernedNode = $contentMainNode->fetchParent();
            $concernedNode->setCurrentLanguage($articleLanguageArray[0]);
        }

        /* @type $concernedDM eZContentObjectAttribute[] */
        $concernedDM = $concernedNode->dataMap();
        $tags        = $concernedDM['tags'];

        $MerckManualAboutSectionId = eZIni::instance('merck.ini')->variable('MerckManualAboutSettings', 'SectionSourceId');
        $taxonomiesAttribute       = $concernedDM['serialized_taxonomies'];

        if( $taxonomiesAttribute instanceof eZContentObjectAttribute && $taxonomiesAttribute->hasContent() )
        {
            $taxonomies = $taxonomiesAttribute->content();

            foreach( array_keys($publisherFolderRelations['clusters']) as $cluster )
            {
                self::addValueToDoc(
                    $docList,
                    "attr_exclude_from_search_{$cluster}_b",
                    $MerckManualAboutSectionId && in_array($MerckManualAboutSectionId, $taxonomies['section']),
                    false
                );
            }
        }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:66,代码来源:kezfsolrarticleindex.php


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