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


PHP eZDebug::accumulatorStart方法代码示例

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


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

示例1: rawSearch

    /**
     * Helper for solr raw searches.
     * Deals with the language, meta_installation, section and visibility filters + solr sharding if any
     * @param array $params
     * @param string $requestType
     * @param bool $useDefaultFilters
     * @return array
     */
    public static function rawSearch( $params, $requestType = 'php', $useDefaultFilters = true, $includeIsInvisible = true )
    {
        eZDebug::accumulatorStart( __CLASS__ . '::' . __FUNCTION__, 'Merck' );

        $findINI = eZINI::instance( 'ezfind.ini' );
        $solrINI = eZINI::instance( 'solr.ini' );
        $siteINI = eZINI::instance();
        $currentLanguage = $siteINI->variable( 'RegionalSettings', 'ContentObjectLocale' );

        // always use extended Dismax query handler when available
        if( isset($params['qt']) && $params['qt'] == 'ezpublish' )
            $params['defType'] = 'edismax';

        if ( $useDefaultFilters )
        {
            if ( !isset( $params['fq'] ) )
                $params['fq'] = '';
            else
                $params['fq'] .= ' AND ';
            $params['fq'] .= implode( ' AND ', array(
                'meta_installation_id_ms:' . eZSolr::installationID(),
                '(attr_offline_date_dt:"1970-01-01T01:00:00Z" OR attr_offline_date_dt:[NOW TO *])',
                '( meta_section_id_si:1 OR meta_section_id_si:3 )',
            ) );
            if ($includeIsInvisible) {
                $params['fq'] .= ' AND ' . 'attr_is_invisible_' . ClusterTool::clusterIdentifier() . '_b:false';
            }
        }

        if ( $findINI->variable( 'LanguageSearch', 'MultiCore' ) == 'enabled' )
        {
            $languageMapping = $findINI->variable( 'LanguageSearch', 'LanguagesCoresMap' );
            $shardMapping = $solrINI->variable( 'SolrBase', 'Shards' );
            $fullSolrURI = $shardMapping[$languageMapping[$currentLanguage]];
        }
        else
        {
            $fullSolrURI = $solrINI->variable( 'SolrBase', 'SearchServerURI' );
            // Autocomplete search should be done in current language and fallback languages
            $validLanguages = array_unique(
                array_merge(
                    LocaleTool::languageList(),
                    array( $currentLanguage )
                )
            );
            if( $useDefaultFilters )
                $params['fq'] .= ' AND meta_language_code_ms:(' . implode( ' OR ', $validLanguages ) . ')';
        }

        solrTool::solrStopWordsFilter( $params );    //excluding stopwords
        self::parseBooleanOperators( $params );      // translations for bookean operators
        $solrBase = new eZSolrBase( $fullSolrURI );
        $result = $solrBase->rawSolrRequest( '/select', $params, $requestType );
        if ( !$result )
            self::addNoCacheHeaders();
        
        eZDebug::accumulatorStop( __CLASS__ . '::' . __FUNCTION__ );

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

示例2: parse

    function parse( $tpl, $sourceText, &$rootElement, $rootNamespace, &$resourceData )
    {
        $relatedResource = $resourceData['resource'];
        $relatedTemplateName = $resourceData['template-filename'];

        $currentRoot =& $rootElement;
        $leftDelimiter = $tpl->LDelim;
        $rightDelimiter = $tpl->RDelim;
        $sourceLength = strlen( $sourceText );
        $sourcePosition = 0;

        eZDebug::accumulatorStart( 'template_multi_parser_1', 'template_total', 'Template parser: create text elements' );
        $textElements = $this->parseIntoTextElements( $tpl, $sourceText, $sourcePosition,
                                                      $leftDelimiter, $rightDelimiter, $sourceLength,
                                                      $relatedTemplateName );
        eZDebug::accumulatorStop( 'template_multi_parser_1' );

        eZDebug::accumulatorStart( 'template_multi_parser_2', 'template_total', 'Template parser: remove whitespace' );
        $textElements = $this->parseWhitespaceRemoval( $tpl, $textElements );
        eZDebug::accumulatorStop( 'template_multi_parser_2' );

        eZDebug::accumulatorStart( 'template_multi_parser_3', 'template_total', 'Template parser: construct tree' );
        $this->parseIntoTree( $tpl, $textElements, $currentRoot,
                              $rootNamespace, $relatedResource, $relatedTemplateName );
        eZDebug::accumulatorStop( 'template_multi_parser_3' );
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:26,代码来源:eztemplatemultipassparser.php

示例3: searchActivities

 public function searchActivities($query, $limit = 20, $sorting = 'best')
 {
     $result = array('result' => array());
     $accumulator = $this->debugAccumulatorGroup . '_google_activities_search';
     eZDebug::accumulatorStart($accumulator, $this->debugAccumulatorGroup, 'activities/search');
     $cacheFileHandler = $this->getCacheFileHandler('_activities_search', array($query, $limit, $sorting));
     try {
         if ($this->isCacheExpired($cacheFileHandler)) {
             eZDebug::writeDebug(array('query' => $query, 'limit' => $limit, 'sorting' => $sorting), self::$debugMessagesGroup);
             $response = $this->API->activities->search($query, array('maxResults' => $limit, 'orderBy' => $sorting));
             $activities = array();
             $currentTime = time();
             foreach ($response['items'] as $activity) {
                 $createdAt = strtotime($activity['published']);
                 $activity['created_ago'] = self::getCreatedAgoString($createdAt, $currentTime);
                 $activity['created_timestamp'] = $createdAt;
                 $activities[] = $activity;
             }
             $cacheFileHandler->fileStoreContents($cacheFileHandler->filePath, serialize($activities));
         } else {
             $activities = unserialize($cacheFileHandler->fetchContents());
         }
         eZDebug::accumulatorStop($accumulator);
         $result['result'] = $activities;
         return $result;
     } catch (Exception $e) {
         eZDebug::accumulatorStop($accumulator);
         eZDebug::writeError($e, self::$debugMessagesGroup);
         return $result;
     }
 }
开发者ID:sdaoudi,项目名称:nxc_social_networks,代码行数:31,代码来源:google.php

示例4: get_html

 function get_html($url, $args = '', $asArray = false)
 {
     eZDebug::createAccumulator('get_html ' . $url, 'OCoembed', $url);
     eZDebug::accumulatorStart('get_html ' . $url, 'OCoembed', $url, false);
     $provider = false;
     if (!isset($args['discover'])) {
         $args['discover'] = false;
     }
     foreach ($this->providers as $matchmask => $data) {
         list($providerurl, $regex) = $data;
         // Turn the asterisk-type provider URLs into regex
         if (!$regex) {
             $matchmask = '#' . str_replace('___wildcard___', '(.+)', preg_quote(str_replace('*', '___wildcard___', $matchmask), '#')) . '#i';
         }
         if (preg_match($matchmask, $url)) {
             $provider = str_replace('{format}', 'json', $providerurl);
             // JSON is easier to deal with than XML
             break;
         }
     }
     if (!$provider && $args['discover']) {
         $provider = $this->discover($url);
     }
     if (!$provider || false === ($data = $this->fetch($provider, $url, $args))) {
         eZDebug::accumulatorStop('get_html ' . $url, false);
         return false;
     }
     if ($asArray) {
         eZDebug::accumulatorStop('get_html ' . $url, false);
         return get_object_vars($data);
     }
     eZDebug::accumulatorStop('get_html ' . $url, false);
     return $this->data2html($data, $url);
 }
开发者ID:rantoniazzi,项目名称:ocembed,代码行数:34,代码来源:ocoembed.php

示例5: getTimeline

 public function getTimeline($pageID = false, $limit = 20, $type = 'feed')
 {
     $result = array('result' => array());
     $accumulator = $this->debugAccumulatorGroup . '_facebook_timeline';
     eZDebug::accumulatorStart($accumulator, $this->debugAccumulatorGroup, 'timeline');
     $cacheFileHandler = $this->getCacheFileHandler('_timeline', array($pageID, $limit, $type));
     try {
         if ($this->isCacheExpired($cacheFileHandler)) {
             eZDebug::writeDebug(array('page_id' => $pageID, 'limit' => $limit), self::$debugMessagesGroup);
             $response = $this->API->api(($pageID === false ? 'me/home' : '/' . $pageID) . '/' . $type, array('access_token' => $this->acessToken, 'limit' => $limit));
             $messages = array();
             $currentTime = time();
             foreach ($response['data'] as $message) {
                 $createdAt = strtotime($message['created_time']);
                 $message['created_ago'] = self::getCreatedAgoString($createdAt, $currentTime);
                 $message['created_timestamp'] = $createdAt;
                 if (isset($message['message'])) {
                     $message['message'] = self::fixMessageLinks($message['message']);
                 }
                 $messages[] = $message;
             }
             $cacheFileHandler->fileStoreContents($cacheFileHandler->filePath, serialize($messages));
         } else {
             $messages = unserialize($cacheFileHandler->fetchContents());
         }
         eZDebug::accumulatorStop($accumulator);
         $result['result'] = $messages;
         return $result;
     } catch (Exception $e) {
         eZDebug::accumulatorStop($accumulator);
         eZDebug::writeError($e->getMessage(), self::$debugMessagesGroup);
         return $result;
     }
 }
开发者ID:sdaoudi,项目名称:nxc_social_networks,代码行数:34,代码来源:facebook.php

示例6: getMediaRecent

 public function getMediaRecent($pageID = false, $limit = 20)
 {
     $result = array('result' => array());
     $accumulator = $this->debugAccumulatorGroup . '_instagram_media_recent';
     eZDebug::accumulatorStart($accumulator, $this->debugAccumulatorGroup, 'media_recent');
     $cacheFileHandler = $this->getCacheFileHandler('_media_recent', array($pageID, $limit));
     try {
         if ($this->isCacheExpired($cacheFileHandler)) {
             eZDebug::writeDebug(array('page_id' => $pageID, 'limit' => $limit), self::$debugMessagesGroup);
             $items = array();
             $userData = eZHTTPTool::getDataByURL('https://api.instagram.com/v1/users/search?' . 'q=' . $pageID . '&' . 'client_id=' . $this->API['key']);
             $userID = false;
             if ($userData !== false) {
                 $userDataArray = json_decode($userData, true);
                 if (count($userDataArray['data'])) {
                     foreach ($userDataArray['data'] as $user) {
                         if ($user['username'] == $pageID) {
                             $userID = $user['id'];
                             break;
                         }
                     }
                 }
             }
             if ($userID !== false) {
                 $leftLimit = $limit;
                 $feedData = eZHTTPTool::getDataByURL('https://api.instagram.com/v1/users/' . $userID . '/media/recent/?' . 'access_token=' . $this->API['token']);
                 if ($feedData !== false) {
                     $feedDataArray = json_decode($feedData, true);
                     if (isset($feedDataArray['data'])) {
                         $items = array_merge($items, array_slice($feedDataArray['data'], 0, $leftLimit));
                         $leftLimit = $leftLimit - count($feedDataArray['data']);
                     }
                     $endlessLoopBreaker = 0;
                     while ($endlessLoopBreaker < 50 && $leftLimit > 0 && isset($feedDataArray['pagination']['next_url'])) {
                         $endlessLoopBreaker++;
                         $feedData = eZHTTPTool::getDataByURL($feedDataArray['pagination']['next_url']);
                         if ($feedData !== false) {
                             $feedDataArray = json_decode($feedData, true);
                             $items = array_merge($items, array_slice($feedDataArray['data'], 0, $leftLimit));
                         }
                         $leftLimit = $leftLimit - count($feedDataArray['data']);
                     }
                 }
             }
             $cacheFileHandler->fileStoreContents($cacheFileHandler->filePath, serialize($items));
         } else {
             $items = unserialize($cacheFileHandler->fetchContents());
         }
         eZDebug::accumulatorStop($accumulator);
         $result['result'] = $items;
         return $result;
     } catch (Exception $e) {
         eZDebug::accumulatorStop($accumulator);
         eZDebug::writeError($e->getMessage(), self::$debugMessagesGroup);
         return $result;
     }
 }
开发者ID:sdaoudi,项目名称:nxc_social_networks,代码行数:57,代码来源:instagram.php

示例7: search

 function search($searchText, $params = array(), $searchTypes = array())
 {
     eZDebug::createAccumulator('Search', 'eZ Find');
     eZDebug::accumulatorStart('Search');
     $error = 'Server not running';
     $asObjects = isset($params['AsObjects']) ? $params['AsObjects'] : true;
     //distributed search: fields to return can be specified in 2 parameters
     $params['FieldsToReturn'] = isset($params['FieldsToReturn']) ? $params['FieldsToReturn'] : array();
     if (isset($params['DistributedSearch']['returnfields'])) {
         $params['FieldsToReturn'] = array_merge($params['FieldsToReturn'], $params['DistributedSearch']['returnfields']);
     }
     $coreToUse = null;
     $shardQueryPart = null;
     if ($this->UseMultiLanguageCores === true) {
         $languages = $this->SiteINI->variable('RegionalSettings', 'SiteLanguageList');
         if (array_key_exists($languages[0], $this->SolrLanguageShards)) {
             $coreToUse = $this->SolrLanguageShards[$languages[0]];
             if ($this->FindINI->variable('LanguageSearch', 'SearchMainLanguageOnly') != 'enabled') {
                 $shardQueryPart = array('shards' => implode(',', $this->SolrLanguageShardURIs));
             }
         }
         //eZDebug::writeNotice( $languages, __METHOD__ . ' languages' );
         eZDebug::writeNotice($shardQueryPart, __METHOD__ . ' shards');
         //eZDebug::writeNotice( $this->SolrLanguageShardURIs, __METHOD__ . ' this languagesharduris' );
     } else {
         $coreToUse = $this->Solr;
     }
     if ($this->SiteINI->variable('SearchSettings', 'AllowEmptySearch') == 'disabled' && trim($searchText) == '') {
         $error = 'Empty search is not allowed.';
         eZDebug::writeNotice($error, __METHOD__);
         $resultArray = null;
     } else {
         eZDebug::createAccumulator('Query build', 'eZ Find');
         eZDebug::accumulatorStart('Query build');
         $queryBuilder = new ezfeZPSolrQueryBuilder($this);
         $queryParams = $queryBuilder->buildSearch($searchText, $params, $searchTypes);
         if (!$shardQueryPart == null) {
             $queryParams = array_merge($shardQueryPart, $queryParams);
         }
         eZDebug::accumulatorStop('Query build');
         eZDebugSetting::writeDebug('extension-ezfind-query', $queryParams, 'Final query parameters sent to Solr backend');
         eZDebug::createAccumulator('Engine time', 'eZ Find');
         eZDebug::accumulatorStart('Engine time');
         $resultArray = $coreToUse->rawSearch($queryParams);
         eZDebug::accumulatorStop('Engine time');
     }
     if ($resultArray) {
         $searchCount = $resultArray['response']['numFound'];
         $objectRes = $this->buildResultObjects($resultArray, $searchCount, $asObjects, $params);
         $stopWordArray = array();
         eZDebug::accumulatorStop('Search');
         return array('SearchResult' => $objectRes, 'SearchCount' => $searchCount, 'StopWordArray' => $stopWordArray, 'SearchExtras' => new ezfSearchResultInfo($resultArray));
     } else {
         eZDebug::accumulatorStop('Search');
         return array('SearchResult' => false, 'SearchCount' => 0, 'StopWordArray' => array(), 'SearchExtras' => new ezfSearchResultInfo(array('error' => ezpI18n::tr('ezfind', $error))));
     }
 }
开发者ID:OpencontentCoop,项目名称:ocsearchtools,代码行数:57,代码来源:ocsolr.php

示例8: parse

 /**
  * Parses CSV File
  * @throws SQLICSVException
  * @return SQLICSVDoc
  */
 public function parse()
 {
     eZDebug::accumulatorStart('sqlicsvdoc_loading', 'sqlicsvdoc', 'Loading CSV file in memory');
     $this->csvFile = @fopen($this->options['csv_path'], 'r');
     if (!$this->csvFile) {
         throw new SQLICSVException("Cannot open CSV file '{$this->options['csv_path']}' for reading");
     }
     $this->rows = SQLICSVRowSet::fromCSVFile($this->csvFile, $this->options);
     eZDebug::accumulatorStop('sqlicsvdoc_loading');
     return $this;
 }
开发者ID:nicolasaguenot,项目名称:sqliimport,代码行数:16,代码来源:sqlicsvdoc.php

示例9: testAccumulatorStartMultipleResursiveCounter

 /**
  * Test scenario for issue #13956: eZDebug::accumulatorStop( $key, true ) does not remove the recursive counter
  *
  * @link http://issues.ez.no/13956
  * @group issue_13956
  */
 function testAccumulatorStartMultipleResursiveCounter()
 {
     self::markTestSkipped("Pending bugfix");
     eZDebug::accumulatorStart(__METHOD__, false, false, true);
     eZDebug::accumulatorStart(__METHOD__, false, false, true);
     eZDebug::accumulatorStop(__METHOD__, true);
     eZDebug::accumulatorStop(__METHOD__, true);
     eZDebug::accumulatorStart(__METHOD__, false, false, true);
     $debug = eZDebug::instance();
     $this->assertEquals(0, $debug->TimeAccumulatorList[__METHOD__]['recursive_counter']);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:17,代码来源:ezdebug_regression.php

示例10: execute

 public function execute($process, $event)
 {
     eZDebug::createAccumulatorGroup('nxc_social_networks_publish', 'NXC Social Networks Publish');
     $processParams = $process->attribute('parameter_list');
     $classIDs = unserialize($event->attribute('data_text1'));
     $object = eZContentObject::fetch($processParams['object_id']);
     if (in_array($object->attribute('contentclass_id'), $classIDs) === false) {
         return eZWorkflowType::STATUS_ACCEPTED;
     }
     $dataMap = $object->attribute('data_map');
     $handlers = $event->attribute('handlers');
     foreach ($handlers as $handler) {
         $options = $handler->getOptions();
         if (isset($options['publish_only_on_create']) && (bool) $options['publish_only_on_create'] === true && $object->attribute('current_version') != 1) {
             continue;
         }
         $classAttributeIDs = $handler->attribute('classattribute_ids');
         foreach ($classAttributeIDs as $classAttributeID) {
             $classAttribute = eZContentClassAttribute::fetch($classAttributeID, false);
             if ($classAttribute['contentclass_id'] != $object->attribute('contentclass_id')) {
                 continue;
             }
             $attributeContent = false;
             foreach ($dataMap as $objectAttribute) {
                 if ($objectAttribute->attribute('contentclassattribute_id') == $classAttributeID) {
                     $attributeContent = $objectAttribute->attribute('content');
                     break;
                 }
             }
             if ($attributeContent === false) {
                 continue;
             }
             $accumulator = 'nxc_social_networks_publish_to_' . $handler->attribute('type');
             eZDebug::accumulatorStart($accumulator, 'nxc_social_networks_publish', 'Publishing message to ' . $handler->attribute('name'));
             try {
                 $handler->publish($object, $attributeContent);
             } catch (Exception $e) {
                 eZDebug::writeError($e->getMessage(), 'NXC Social Networks Publish');
             }
             eZDebug::accumulatorStop($accumulator);
         }
     }
     return eZWorkflowType::STATUS_ACCEPTED;
 }
开发者ID:sdaoudi,项目名称:nxc_social_networks,代码行数:44,代码来源:nxcsocialnetworkspublishtype.php

示例11: tidyCleaner

 /**
  * Tidyfication of the strings
  *
  * @param string $str
  * @return string
  */
 public function tidyCleaner($str)
 {
     eZDebug::accumulatorStart('eztidytemplateoperator', 'Tidy', 'Tidy template operator');
     if (!class_exists('tidy')) {
         eZDebug::writeError("phpTidy isn't installed", 'eZTidy::tidyCleaner()');
         return $str;
     }
     $str = trim($str);
     if ($str == "") {
         return "";
     }
     $this->tidy = new tidy();
     $this->tidy->parseString($str, $this->config, $this->options['charset']);
     $this->tidy->cleanRepair();
     $this->isTidyfied = true;
     $this->reportWarning();
     $output = tidy_get_output($this->tidy);
     if (strtolower($this->options['showTidyElement']) == 'enabled') {
         return "<!-- Tidy - Begin -->\n" . $output . "\n<!-- Tidy - End -->";
     }
     eZDebug::accumulatorStop('eztidytemplateoperator');
     return $output;
 }
开发者ID:philandteds,项目名称:eztidy,代码行数:29,代码来源:eztidy.php

示例12: generateNodeListCache

 public function generateNodeListCache($nodeList)
 {
     eZDebug::accumulatorStart('StaticCacheMugo', '', 'StaticCacheMugo');
     if (!empty($nodeList)) {
         foreach ($nodeList as $nodeId) {
             $urls = $this->nodeId2Urls($nodeId);
             foreach ($urls as $url) {
                 if ($this->pathPrefixModifier) {
                     $this->applyPreFixModifier($url);
                 }
                 $key = md5($url);
                 if (!isset(self::$urlsToPurge[$key])) {
                     if ($this->uriTransformation) {
                         eZURI::transformURI($url);
                     }
                     if ($this->urlModifierMatch) {
                         $url = preg_replace($this->urlModifierMatch, $this->urlModifierReplace, $url);
                     }
                     // exclude URLs based on configured patterns
                     if (!empty($this->omitUrlPatterns)) {
                         $matched = false;
                         foreach ($this->omitUrlPatterns as $pattern) {
                             $matched = preg_match($pattern, $purgeUrl);
                         }
                         // skip it and process next URL
                         if ($matched) {
                             continue;
                         }
                     }
                     // add final version of URL to list
                     self::$urlsToPurge[$key] = $url;
                 }
             }
         }
     }
     eZDebug::accumulatorStop('StaticCacheMugo', '', 'StaticCacheMugo');
 }
开发者ID:yannschepens,项目名称:mugo_varnish,代码行数:37,代码来源:StaticCacheMugoVarnish.php

示例13: arrayQuery

    function arrayQuery( $sql, $params = array(), $server = false )
    {
        $retArray = array();
        if ( $this->IsConnected )
        {
            $limit = false;
            $offset = 0;
            $column = false;
            // check for array parameters
            if ( is_array( $params ) )
            {
                if ( isset( $params["limit"] ) and is_numeric( $params["limit"] ) )
                    $limit = $params["limit"];

                if ( isset( $params["offset"] ) and is_numeric( $params["offset"] ) )
                    $offset = $params["offset"];

                if ( isset( $params["column"] ) and ( is_numeric( $params["column"] ) or is_string( $params["column"] ) ) )
                    $column = $params["column"];
            }

            if ( $limit !== false and is_numeric( $limit ) )
            {
                $sql .= "\nLIMIT $offset, $limit ";
            }
            else if ( $offset !== false and is_numeric( $offset ) and $offset > 0 )
            {
                $sql .= "\nLIMIT $offset, 18446744073709551615"; // 2^64-1
            }
            $result = $this->query( $sql, $server );

            if ( $result == false )
            {
                $this->reportQuery( __CLASS__, $sql, false, false );
                return false;
            }

            $numRows = mysql_num_rows( $result );
            if ( $numRows > 0 )
            {
                if ( !is_string( $column ) )
                {
                    eZDebug::accumulatorStart( 'mysql_loop', 'mysql_total', 'Looping result' );
                    for ( $i=0; $i < $numRows; $i++ )
                    {
                        if ( $this->InputTextCodec )
                        {
                            $tmpRow = mysql_fetch_array( $result, MYSQL_ASSOC );
                            $convRow = array();
                            foreach( $tmpRow as $key => $row )
                            {
                                eZDebug::accumulatorStart( 'mysql_conversion', 'mysql_total', 'String conversion in mysql' );
                                $convRow[$key] = $this->OutputTextCodec->convertString( $row );
                                eZDebug::accumulatorStop( 'mysql_conversion' );
                            }
                            $retArray[$i + $offset] = $convRow;
                        }
                        else
                            $retArray[$i + $offset] = mysql_fetch_array( $result, MYSQL_ASSOC );
                    }
                    eZDebug::accumulatorStop( 'mysql_loop' );

                }
                else
                {
                    eZDebug::accumulatorStart( 'mysql_loop', 'mysql_total', 'Looping result' );
                    for ( $i=0; $i < $numRows; $i++ )
                    {
                        $tmp_row = mysql_fetch_array( $result, MYSQL_ASSOC );
                        if ( $this->InputTextCodec )
                        {
                            eZDebug::accumulatorStart( 'mysql_conversion', 'mysql_total', 'String conversion in mysql' );
                            $retArray[$i + $offset] = $this->OutputTextCodec->convertString( $tmp_row[$column] );
                            eZDebug::accumulatorStop( 'mysql_conversion' );
                        }
                        else
                            $retArray[$i + $offset] =& $tmp_row[$column];
                    }
                    eZDebug::accumulatorStop( 'mysql_loop' );
                }
            }
        }
        return $retArray;
    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:84,代码来源:ezmysqldb.php

示例14: suggestedTerms

    public function suggestedTerms()
    {
        if ( mb_strlen($this->searchQuery, 'UTF-8') < 3 )
        {
            return array();
        }

        eZDebug::accumulatorStart(__CLASS__.'::'.__FUNCTION__, 'Merck' );

        $solrHighlightParams = $this->solrHighlightParams();
        $suggestions         = array();
        $filters             = array();
        $solrFilter          = $this->solrFilter();
        $solrFacetsFiler     = $this->solrFacetsFilter();

        if( $solrFilter )
            $filters[] = $solrFilter;
        if( $solrFacetsFiler )
            $filters[] = $solrFacetsFiler;

        $queries = array();
        $terms   = MMGlobalSearchDictionaryTerm::fetchSolrTerms( $this->searchQuery, null, $this->suggestedTermsLimit() * 3 );

        foreach( $terms as $term )
        {
            $query = array();

            foreach( explode( ' ', $solrHighlightParams['hl.fl'] ) as $field )
                $query[] = $field.':"'.addslashes( $term ).'"';

            $queries[] = implode( ' OR ', $query );
        }

        $params = array(
                'start'	        => 0,
                'rows'	        => 0,
                'q'		        => '*:*',
                'fq'	        => implode(' AND ' , $filters),
                'facet'	        => 'true',
                'facet.query'   => $queries,
        );
        $solrResults = SolrTool::rawSearch( $params );

        $i = 0;
        foreach( $solrResults['facet_counts']['facet_queries'] as $solrTerm => $solrTermCount )
        {
            if( $solrTermCount )
            {
                $term = $terms[$i];
                if( strtolower( trim( $term ) ) != strtolower( trim( $this->searchQuery, ' "' ) ) )
                {
                    $suggestions[] = array(
                        't'	=> $term,
                        'c'	=> $solrTermCount);

                    if( count( $suggestions ) >= $this->suggestedTermsLimit() )
                        break;
                }
            }
            $i++;
        }


        // sort
        usort( $suggestions, function($a, $b){
            return ($a['c'] < $b['c']);
        } );

        eZDebug::accumulatorStop( __CLASS__.'::'.__FUNCTION__ );

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

示例15: accumulatorStart

 public static function accumulatorStart($val, $group = false, $label = false, $data = null)
 {
     // allow 3rd party code to leave in perf. measuring hooks with minimal speed loss
     if (!self::$activated) {
         return false;
     }
     $startTime = microtime(true);
     if (eZPerfLoggerDebug::isDebugEnabled()) {
         eZDebug::accumulatorStart($val, $group, $label);
     }
     if (!isset(self::$timeAccumulatorList[$val])) {
         self::$timeAccumulatorList[$val] = array('group' => $group, 'data' => array(), 'time' => 0, 'maxtime' => 0);
     }
     self::$timeAccumulatorList[$val]['temp_time'] = $startTime;
     if ($data !== null) {
         self::$timeAccumulatorList[$val]['data'][] = $data;
     }
 }
开发者ID:gggeek,项目名称:ezperformancelogger,代码行数:18,代码来源:ezperflogger.php


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