Completes the Index Queue page indexer request and returns the response
with the collected results.

@return void
555383
public function shutdown()
    {
        $this->dispatcher->shutdown();

        // make sure that no other output messes up the data
        ob_end_clean();

        $this->response->sendHeaders();
        echo $this->response->getContent();

        // exit since we don't want anymore output
        exit;
    }
840000
public function handleAfterCompletion()
    {
        $survey = $this->getSurvey();
        $event  = $survey->getSurveyCompletedEvent();

        if ($event) {
            try {
                $changed = $event->processTokenData($this);
                if ($changed && is_array($changed)) {

                    $this->setRawAnswers($changed);

                    return $changed;
                }
            } catch (\Exception $e) {
                $this->logger->log(sprintf(
                        "After completion event error for token %s on survey '%s' using event '%s': %s",
                        $this->_tokenId,
                        $this->getSurveyName(),
                        $event->getEventName(),
                        $e->getMessage()
                        ), \Zend_Log::ERR);
            }
        }
    }
415222
public function index() {
        $this->paginate = array_merge(array(
            'limit' => 25,
            'contain' => array_keys($this->Model->belongsTo)
        ), $this->Model->admin['paginate']);

        $this->set('results', $this->paginate($this->Model));
    }
816261
private function processSearchResponse()
    {
        /** @var SearchResponse $obj_search_response */
        $obj_search_response = $this->obj_last_response;
        $obj_response = (object)[
            'status' => $this->describeStatusCode($obj_search_response->getStatus()->getCode()),
            'hits' => $obj_search_response->getMatchedCount(),
            'count' => $obj_search_response->getResultSize(),
            'results' => []
        ];
        $obj_mapper = new Mapper();
        foreach($obj_search_response->getResultList() as $obj_result) {
            /** @var SearchResult $obj_result */
            $obj_doc = $obj_mapper->fromGoogle($obj_result->getDocument(), $obj_result->getExpressionList());
            $obj_response->results[] = (object)[
                'score' => ($obj_result->getScoreSize() > 0 ? $obj_result->getScore(0) : 0),
                'doc' => $obj_doc
            ];
        }

        // Map facets from results
        // @todo Restructure/review response object and moving this code to Mapper
        if($obj_search_response->getFacetResultSize() > 0) {
            $obj_response->facets = []; // create the empty facets placeholder in the response
            /** @var \google\appengine\FacetResult $obj_facet */
            foreach($obj_search_response->getFacetResultList() as $obj_facet) {
                $arr_facet_values = [];
                /** @var \google\appengine\FacetResultValue $obj_facet_value */
                foreach($obj_facet->getValueList() as $obj_facet_value) {
                    $arr_facet_values[] = [
                        'agg' => $obj_facet_value->getName(),
                        'count' => $obj_facet_value->getCount()
                    ];
                }
                $obj_response->facets[$obj_facet->getName()] = $arr_facet_values;
            }
        }

        return $obj_response;
    }
210412
public function execute() {
        if (!\core_search\manager::is_indexing_enabled()) {
            return;
        }
        $globalsearch = \core_search\manager::instance();

        // Get total indexing time limit.
        $timelimit = get_config('core', 'searchindextime');
        $start = time();

        // Do normal indexing.
        $globalsearch->index(false, $timelimit, new \text_progress_trace());

        // Do requested indexing (if any) for the rest of the time.
        if ($timelimit != 0) {
            $now = time();
            $timelimit -= ($now - $start);
            if ($timelimit <= 1) {
                // There is hardly any time left, so don't try to do requests.
                return;
            }
        }
        $globalsearch->process_index_requests($timelimit, new \text_progress_trace());
    }
535460
public function next()
    {
        $this->pageIndex++;
        $this->position++;

        if (count($this->pageIterator->current()) <= $this->pageIndex && $this->nextResultToken()) {
            $this->pageIterator->next();
            $this->pageIndex = 0;
        }
    }
119021
public function runIndexing()
    {
        $iterator = $this->getResourceIterator();
        $indexIterator = new IndexIterator($iterator);
        $indexIterator->setServiceLocator($this->getServiceLocator());
        $searchService = $this->getServiceLocator()->get(Search::SERVICE_ID);
        $result = $searchService->index($indexIterator);
        $this->logDebug($result . ' resources have been indexed by ' . static::class);
        return $result;
    }
35664
public function indexOfDeleted()
    {
        $this->authorize('readList', Content::class);
        $input  = $this->validator->validate('list');
        $params = $this->processor->process($input)->getProcessedFields();

        $results = $this->repository->getDeletedContents(
            $params['filter'],
            $params['orderBy'],
            $params['page'],
            $params['perPage']
        );

        return $this->respondWithSuccess($results, new ContentTransformer);
    }
440817
public function finish()
    {
        if ($this->isCache || $this->noStarted || $this->finished) {
            return null;
        }

        $this->finished = true;

        ob_get_level() > 0 && ob_end_clean();

        $this->handle && fclose($this->handle);

        if (App::state() === 4) {
            is_file($this->cacheTmp) && unlink($this->cacheTmp);
            return null;
        }

        Storage::put($this->cacheName);

        if (filesize($this->cacheTmp) > 0 && rename($this->cacheTmp, $this->cacheName)) {
            $headers = implode('\');header(\'', headers_list());

            if ($headers !== '') {
                $headers = 'header(\'' . $headers . '\');';
            }

            file_put_contents($this->cacheName . '.1', REQUEST_TIME + $this->expires);
            file_put_contents($this->cacheName . '.php', '<?php ' . $headers);

            if (static::allowHeaders()) {
                Response::putHeader('Etag', sha1_file($this->cacheName));
                Response::cache($this->expires, $this->modified);
                Response::dispatch();
            }

            if (App::state() > 2) {
                $this->show();
            } else {
                App::on('ready', array($this, 'show'));
            }
        }
    }
625073
public function indexAction()
    {
        if ($this->getRequest()->isAjax()) {
            try {
                $this->loadLayout(null, false, false);
                $this->getLayout()->getUpdate()->setCacheId(null);
                $this->getLayout()->getUpdate()->addHandle(strtolower($this->getFullActionName()) . '_AJAX');
            } catch (Exception $e) {
                Mage::logException($e);
                $this->getResponse()->setHeader('Content-Type', 'application/json');
                $this->getResponse()->setBody(Zend_Json::encode(['error' => true, 'message' => $e->getMessage()]));
            }
        }

        $this->loadLayout();
        $this->renderLayout();
    }
461784
public function index() {
		$this->loadModel('Queue.QueueProcesses');
		$status = $this->QueueProcesses->status();

		$current = $this->QueuedJobs->getLength();
		$pendingDetails = $this->QueuedJobs->getPendingStats();
		$new = 0;
		foreach ($pendingDetails as $pendingDetail) {
			if ($pendingDetail['fetched'] || $pendingDetail['failed']) {
				continue;
			}
			$new++;
		}

		$data = $this->QueuedJobs->getStats();

		$taskFinder = new TaskFinder();
		$tasks = $taskFinder->allAppAndPluginTasks();

		$servers = $this->QueueProcesses->find()->distinct(['server'])->find('list', ['keyField' => 'server', 'valueField' => 'server'])->toArray();
		$this->set(compact('new', 'current', 'data', 'pendingDetails', 'status', 'tasks', 'servers'));
		$this->helpers[] = 'Tools.Format';
		$this->helpers[] = 'Tools.Time';
		$this->helpers[] = 'Tools.Text';
	}
181644
public function execute()
    {
        // clean up
        $cleanUpResult = $this->cleanUpIndex();

        // initialize for re-indexing
            /** @var Queue $indexQueue */
        $indexQueue = GeneralUtility::makeInstance(Queue::class);
        $indexQueueInitializationResults = $indexQueue->getInitializationService()
            ->initializeBySiteAndIndexConfigurations($this->getSite(), $this->indexingConfigurationsToReIndex);

        return ($cleanUpResult && !in_array(false, $indexQueueInitializationResults));
    }
386298
public function indexAction()
    {
        if (\App\Registry::$cache) {
            \App\Registry::$cache->flush();
            $this->getMessenger()->addMessage('messenger.cache.cleared', true);
        }
        if ($this->getRequest()->getReferer()) {
            $this->getResponse()->redirectToUrl(urldecode($this->getRequest()->getReferer()));
        }
        $this->getResponse()->redirect('cmsAdmin');
    }
435414
public function index()
    {
        $options = $this->getQueryHelperOptions();
        $items = $this->repo->allPaged($options);

        if ( ! $items)
        {
            return $this->respondNotFound('Unable to fetch the selected resources');
        }

        $response = [
            'data' => [],
            'meta' => [
                'pagination' => []
            ]
        ];

        $resource = new Fractal\Resource\Collection($items->getCollection(), new $this->transformerClass);
        $resource->setPaginator(new Fractal\Pagination\IlluminatePaginatorAdapter($items));

        $response['data'] = $this->fractal->createData($resource)->toArray()['data'];

        $paginator = new Fractal\Pagination\IlluminatePaginatorAdapter($items);

        $response['meta']['pagination'] = [
            'total' => $paginator->getTotal(),
            'count' => $paginator->count(),
            'per_page' => $paginator->getPerPage(),
            'current_page' => $paginator->getCurrentPage(),
            'total_pages' => $paginator->getLastPage()
        ];

        return $response;
    }
993904
public function index()
    {
        $this->loadModel('Block.Blocks');
        if ($this->request->isPost()) {
            if ($this->_reorder()) {
                $this->Flash->success(__d('block', 'Blocks ordering updated!'));
            }
            $this->redirect(['plugin' => 'Block', 'controller' => 'manage', 'action' => 'index']);
        }

        $front = $this->Blocks->inFrontTheme();
        $back = $this->Blocks->inBackTheme();
        $unused = $this->Blocks->unused();

        $this->set(compact('front', 'back', 'unused'));
        $this->title(__d('block', 'Site Blocks'));
        $this->Breadcrumb
            ->push('/admin/system/structure')
            ->push(__d('block', 'Manage Blocks'), '#');
    }
113758
public function finishedCrawling()
    {
        if (! $this->crawledBadUrls()) {
            return;
        }

        $urlsGroupedByStatusCode = $this->urlsGroupedByStatusCode;

        $this->mail->send('laravel-link-checker::crawlReport', compact('urlsGroupedByStatusCode'), function ($message) {
            $message->from(config('laravel-link-checker.reporters.mail.from_address'));
            $message->to(config('laravel-link-checker.reporters.mail.to_address'));
            $message->subject(config('laravel-link-checker.reporters.mail.subject'));
        });
    }
904113
public function index() {
		$queueProcesses = $this->paginate();

		$this->set(compact('queueProcesses'));
		$this->helpers[] = 'Tools.Format';
		$this->helpers[] = 'Tools.Time';
		$this->helpers[] = 'Shim.Configure';
	}