doing all tasks to get the required informations that the plugin needs
result is stored in an internal array

@return void
517747
public function execute()
    {
        if (empty($this->_filecontent) || empty($this->_ids)) {
            return;
        }
        foreach ($this->_filecontent as $disk=>$result) {
            // set the start and end offset in the result string at the beginning and end respectively
            // just in case we don't find the two strings, so that it still works as expected.
            $startIndex = 0;
            $endIndex = 0;
            $vendorInfos = "";

            // locate the beginning string offset for the attributes
            if (preg_match('/(Vendor Specific SMART Attributes with Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE))
               $startIndex = $matches[0][1];

            // locate the end string offset for the attributes, this is usually right before string "SMART Error Log Version" or "SMART Error Log not supported" or "Error SMART Error Log Read failed" (hopefully every output has it!)
            if (preg_match('/(SMART Error Log Version)|(SMART Error Log not supported)|(Error SMART Error Log Read failed)/', $result, $matches, PREG_OFFSET_CAPTURE))
               $endIndex = $matches[0][1];

            if ($startIndex && $endIndex && ($endIndex>$startIndex))
                 $vendorInfos = preg_split("/\n/", substr($result, $startIndex, $endIndex - $startIndex));

            if (!empty($vendorInfos)) {
                $labels = preg_split('/\s+/', $vendorInfos[1]);
                foreach ($labels as $k=>$v) {
                    $labels[$k] = str_replace('#', '', strtolower($v));
                }
                $i = 0; // Line number
                foreach ($vendorInfos as $line) {
                    $line = preg_replace('/^\s+/', '', $line);
                    $values = preg_split('/\s+/', $line);
                    if (count($values) > count($labels)) {
                        $values = array_slice($values, 0, count($labels), true);
                    }
                    $j = 0;
                    $found = false;
                    foreach ($values as $value) {
                        if ((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id')) {
                          $arrFullVa = preg_split('/-/', $this->_ids[$value]);
                          if (($arrFullVa[0]=="#replace") && !empty($arrFullVa[1]))
                              $value=$arrFullVa[1];
                        }
                        if (((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id') || ($found && (in_array($labels[$j], array_values($this->_ids)))) || ($found && $labels[$j] == 'attribute_name'))) {
                            $this->_result[$disk][$i][$labels[$j]] = $value;
                            $found = true;
                        }
                        $j++;
                    }
                    $i++;
                }
            } else {
                //SCSI and MVMe devices
                if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) {
                    if (preg_match('/\nread\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[7]!=null)) {
                            $this->_result[$disk][0]['id'] = 1;
                            $this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
                            $this->_result[$disk][0]['raw_value'] = trim($values[7]);
                        }
                    } elseif (preg_match('/\Media and Data Integrity Errors\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[5]!=null)) {
                            $vals=preg_replace('/,/', '', trim($values[5]));
                            $this->_result[$disk][0]['id'] = 1;
                            $this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
                            $this->_result[$disk][0]['raw_value'] = $vals;
                        }
                    }
                }
                if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) {
                    if (preg_match('/\nElements in grown defect list\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[5]!=null)) {
                            $this->_result[$disk][1]['id'] = 5;
                            $this->_result[$disk][1]['attribute_name'] = "Reallocated_Sector_Ct";
                            $this->_result[$disk][1]['raw_value'] = trim($values[5]);
                        }
                    }
                }
                if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) {
                    if (preg_match('/\n +number of hours powered up = (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[7]!=null)) {
                            $vals=preg_split('/[,\.]/', trim($values[7]));
                            $this->_result[$disk][2]['id'] = 9;
                            $this->_result[$disk][2]['attribute_name'] = "Power_On_Hours";
                            $this->_result[$disk][2]['raw_value'] =  $vals[0];
                        }
                    } elseif (preg_match('/\nPower On Hours\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[3]!=null)) {
                            $vals=preg_replace('/,/', '', trim($values[3]));
                            $this->_result[$disk][2]['id'] = 9;
                            $this->_result[$disk][2]['attribute_name'] = "Power_On_Hours";
                            $this->_result[$disk][2]['raw_value'] =  $vals;
                        }
                    }
                }
                if (!empty($this->_ids[194]) && ($this->_ids[194]=="raw_value")) {
                    if (preg_match('/\nCurrent Drive Temperature\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[3]!=null)) {
                            $this->_result[$disk][3]['id'] = 194;
                            $this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
                            $this->_result[$disk][3]['raw_value'] = trim($values[3]);
                        }
                    } elseif (preg_match('/\nTemperature\: (.*) Celsius/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[1]!=null)) {
                            $this->_result[$disk][3]['id'] = 194;
                            $this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
                            $this->_result[$disk][3]['raw_value'] = trim($values[1]);
                        }
                    }
                }
                if (!empty($this->_ids[12]) && ($this->_ids[12]=="raw_value")) {
                    if (preg_match('/\nPower Cycles\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[2]!=null)) {
                            $vals=preg_replace('/,/', '', trim($values[2]));
                            $this->_result[$disk][4]['id'] = 12;
                            $this->_result[$disk][4]['attribute_name'] = "Power_Cycle_Count";
                            $this->_result[$disk][4]['raw_value'] = $vals;
                        }
                    }
                }
                if (!empty($this->_ids[192]) && ($this->_ids[192]=="raw_value")) {
                    if (preg_match('/\nUnsafe Shutdowns\: (.*)\n/', $result, $lines)) {
                        $values=preg_split('/ +/', $lines[0]);
                        if (!empty($values) && ($values[2]!=null)) {
                            $vals=preg_replace('/,/', '', trim($values[2]));
                            $this->_result[$disk][5]['id'] = 192;
                            $this->_result[$disk][5]['attribute_name'] = "Unsafe_Shutdown_Count";
                            $this->_result[$disk][5]['raw_value'] = $vals;
                        }
                    }
                }
            }
        }
        //Usage test
        $newIds = array();
        foreach ($this->_ids as $id=>$column_name) {
            $found = 0;
            foreach ($this->_result as $diskName=>$diskInfos) {
                if ($found!=2) foreach ($diskInfos as $lineInfos) {
                    if ($found!=2) {
                        $found = 0;
                        foreach ($lineInfos as $label=>$value) {
                            if (($found==0) && ($label=="id") && ($value==$id))
                                $found = 1;
                            if (($found==1) && ($label==$column_name))
                                $found = 2;
                        }
                    }
                }
            }
            if ($found==2) $newIds[$id] = $this->_ids[$id];
        }
        $this->_ids = $newIds;
    }
263610
public function index() {
        $plugins = Admin::getModels();
        $counts = array();

        // Gather record counts
        foreach ($plugins as $plugin) {
            foreach ($plugin['models'] as $model) {
                if ($model['installed']) {
                    $object = Admin::introspectModel($model['class']);

                    if ($object->hasMethod('getCount')) {
                        $count = $object->getCount();
                    } else {
                        $count = $object->find('count', array(
                            'cache' => array($model['class'], 'count'),
                            'cacheExpires' => '+24 hours'
                        ));
                    }

                    $counts[$model['class']] = $count;
                }
            }
        }

        $this->set('plugins', $plugins);
        $this->set('counts', $counts);
    }
613180
public function getResults()
    {
        if (empty($this->results)) {
            $this->results = $this->stmt->fetchAll();
        }

        return $this->results;
    }
1002300
private function _fetch_plugin_plans() {
            $this->_logger->entrance();
            $api = $this->get_current_or_network_user_api_scope();

            /**
             * @since 1.2.3 When running in DEV mode, retrieve pending plans as well.
             */
            $result = $api->get( $this->add_show_pending( "/plugins/{$this->_module_id}/plans.json" ), true );

            if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
                for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
                    $result->plans[ $i ] = new FS_Plugin_Plan( $result->plans[ $i ] );
                }

                $result = $result->plans;
            }

            return $result;
        }
460115
public function getPlugins(): array
    {
        if (!\in_array('plugins', $this->_params, true)) {
            //Plugin data was not retrieved when refresh() was called last. Get it now.
            $this->_params[] = 'plugins';
            $this->refresh($this->_params);
        }

        return $this->get('plugins');
    }
254788
public function renderResults()
    {
        if (!$this->results && $this->query) {
            $this->performSearch();
        }

        if (!$this->outputController) {
            return user_error('Call renderResults() on a DocumentationViewer instance.', E_USER_ERROR);
        }
        
        $request = $this->outputController->getRequest();
        $data = $this->getSearchResults($request);
        $templates = array('DocumentationViewer_search');

        if ($request->requestVar('format') && $request->requestVar('format') == "atom") {
            // alter the fields for the opensearch xml.
            $title = ($title = $this->getTitle()) ? ' - '. $title : "";
            
            $link = Controller::join_links(
                $this->outputController->Link(),
                'DocumentationOpenSearchController/description/'
            );
            
            $data->setField('Title', $data->Title . $title);
            $data->setField('DescriptionURL', $link);
            
            array_unshift($templates, 'OpenSearchResults');
        }
        
        return $this->outputController->customise($data)->renderWith($templates);
    }
383464
private function _getResultData()
    {
        $def = $this->actionChain->getCurrentAction();
        $result = $def['result'];
        if (is_string($result)) {
            return $this->getAttribute($result);
        } elseif (is_array($result)) {
            return array_pop($result);
        } else {
            return null;
        }
    }
788150
protected function define_execution() {
        global $DB;

        $plugins = enrol_get_plugins(true);
        $enrols = $DB->get_records('enrol', array(
                'courseid' => $this->task->get_courseid()));

        // Allow each enrol plugin to add annotations.
        foreach ($enrols as $enrol) {
            if (isset($plugins[$enrol->enrol])) {
                $plugins[$enrol->enrol]->backup_annotate_custom_fields($this, $enrol);
            }
        }
    }
129781
protected function loadStatsArray() {
        if (!is_array($this->stats)) {
            $stats = $this->instance->loadStatus($this->cacheKeyPrefix, $this->cacheKeySuffix);
            if (!empty($stats)) {
                $this->stats = unserialize($stats);
            }

            // make sure unserialize and load were successfull and we have array
            if (!is_array($this->stats)) {
                $this->stats = array();
            }
        }
    }
918820
protected function _populate() {
		if ($this->closed() || !$this->_result->valid()) {
			return;
		}
		$data = $this->_result->current();
		$result = $this->_set($data, null, ['exists' => true, 'original' => true]);
		$this->_result->next();

		return $result;
	}
90930
public function getResultsListPlugin()
    {
        /* @var ResultsPluginService $pluginService */
        $pluginService = $this->getServiceLocator()->get(ResultsPluginService::SERVICE_ID);

        $event = new ResultsListPluginEvent($pluginService->getAllPlugins());
        $this->getServiceLocator()->get(EventManager::SERVICE_ID)->trigger($event);

        // return the list of active plugins
        return array_filter($event->getPlugins(), function ($plugin) {
            return !is_null($plugin) && $plugin->isActive();
        });
    }
190115
public function void() {
		$json = array();

		$this->load->language('extension/payment/pp_express_order');

		if (isset($this->request->get['order_id'])) {
			$order_id = $this->request->get['order_id'];
		} else {
			$order_id = 0;
		}

		$this->load->model('extension/payment/pp_express');

		$paypal_info = $this->model_extension_payment_pp_express->getOrder($order_id);

		if ($paypal_info) {
			$request = array(
				'METHOD'          => 'DoVoid',
				'AUTHORIZATIONID' => $paypal_info['authorization_id'],
				'MSGSUBID'        => uniqid(mt_rand(), true)
			);

			$response = $this->model_extension_payment_pp_express->call($request);

			if (isset($response['ACK']) && ($response['ACK'] != 'Failure') && ($response['ACK'] != 'FailureWithWarning')) {
				$transaction = array(
					'paypal_order_id'       => $paypal_info['paypal_order_id'],
					'transaction_id'        => '',
					'parent_id'             => $paypal_info['authorization_id'],
					'note'                  => '',
					'msgsubid'              => '',
					'receipt_id'            => '',
					'payment_type'          => 'void',
					'payment_status'        => 'Void',
					'pending_reason'        => '',
					'transaction_entity'    => 'auth',
					'amount'                => '',
					'debug_data'            => json_encode($response)
				);

				$this->model_extension_payment_pp_express->addTransaction($transaction);

				$this->model_extension_payment_pp_express->editPayPalOrderStatus($order_id, 'Complete');

				$json['capture_status'] = 'Complete';

				$json['success'] = $this->language->get('text_success');
			} else {
				$json['error'] = (isset($response['L_SHORTMESSAGE0']) ? $response['L_SHORTMESSAGE0'] : $this->language->get('error_transaction'));
			}
		} else {
			$json['error'] = $this->language->get('error_not_found');
		}

		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}
806312
private function bindResult()
    {
        $this->result = array_fill(0, count($this->resultFields), null);

        $resultReferences = array();
        foreach ($this->result as $key => &$result) {
            $resultReferences[$key] = &$result;
        }

        call_user_func_array(array($this->mysqliStatement, 'bind_result'), $resultReferences);

        $this->result = $resultReferences;
    }
536972
public function indexTask()
	{
		// var to hold output
		$output = new stdClass();
		$output->component = substr($this->_option, 4);
		$bits = explode('v', get_class($this));
		$output->version   = str_replace('_', '.', end($bits));
		$output->tasks     = array();
		$output->errors    = array();

		// create reflection class of file
		$classReflector = new ReflectionClass($this);

		if ($this->isDynamic)
		{
			$model = $this->resolveModel();
			$properties = $model->getStructure()->getTableColumns($model->getTableName());
			$properties = $this->normalizeProperties($properties);

			$output->version = 1;
		}

		// loop through each method and process doc
		foreach ($classReflector->getMethods() as $method)
		{
			// create docblock object & make sure we have something
			$phpdoc = new \phpDocumentor\Reflection\DocBlock($method);

			// skip constructor
			if (substr($method->getName(), -4) != 'Task' || in_array($method->getName(), array('registerTask', 'unregisterTask')))
			{
				continue;
			}

			// skip method in the parent class (already processed), 
			/*if ($className != $method->getDeclaringClass()->getName())
			{
				//continue;
			}*/

			// skip if we dont have a short desc
			// but put in error
			if (!$phpdoc->getShortDescription())
			{
				$output->errors[] = Lang::txt(
					'JLIB_APPLICATION_ERROR_DOCBLOCK_MISSING',
					$method->getName(),
					str_replace(PATH_ROOT, '', $classReflector->getFileName())
				);
				continue;
			}

			// create endpoint data array
			$endpoint = array(
				'name'        => substr($method->getName(), 0, -4),
				'description' => preg_replace('/\s+/', ' ', $phpdoc->getShortDescription()),
				'method'      => '',
				'uri'         => '',
				'parameters'  => array()
			);

			// loop through each tag
			foreach ($phpdoc->getTags() as $tag)
			{
				// get tag name and content
				$name    = strtolower(str_replace('api', '', $tag->getName()));
				$content = $tag->getContent();

				// handle parameters separately
				// json decode param input
				if ($name == 'parameter')
				{
					$parameter = json_decode($content);

					if (json_last_error() != JSON_ERROR_NONE)
					{
						$output->errors[] = Lang::txt(
							'JLIB_APPLICATION_ERROR_DOCLBOCK_PARSING',
							$method->getName(),
							str_replace(PATH_ROOT, '', $classReflector->getFileName())
						);
						continue;
					}

					$endpoint['parameters'][] = (array) $parameter;
					continue;
				}

				if ($name == 'uri' && $method->getName() == 'indexTask')
				{
					$content .= $output->component;

					if ($this->isDynamic)
					{
						$content .= '/' . $this->_controller;
					}
				}

				// add data to endpoint data
				$endpoint[$name] = $content;
			}

			if ($this->isDynamic && $endpoint['name'] != 'index')
			{
				$endpoint['uri'] = str_replace('{component}', $output->component, $endpoint['uri']);
				$endpoint['uri'] = str_replace('{controller}', $this->_controller, $endpoint['uri']);
				$endpoint['uri'] = str_replace('{primary key}', '{' . $model->getPrimaryKey() . '}', $endpoint['uri']);

				foreach ($properties as $prop => $type)
				{
					$parameter = array(
						'name'        => $prop,
						'description' => '',
						'type'        => $type,
						'required'    => false,
						'default'     => null
					);

					if ($prop == $model->getPrimaryKey() && in_array($endpoint['name'], array('read', 'update', 'delete')))
					{
						$parameter['required'] = true;

						if (in_array($endpoint['name'], array('read', 'delete')))
						{
							$endpoint['parameters'] = array($parameter);
							break;
						}
					}

					$endpoint['parameters'][] = $parameter;
				}
			}

			// add endpoint to output
			$output->tasks[] = $endpoint;
		}

		if (count($output->errors) <= 0)
		{
			unset($output->errors);
		}

		$this->send($output);
	}
1351148
public function get()
    {
        $encoded_results = json_encode($this->results);

        // Clear results by resetting ID counter and results' container
        $this->results = [];
        $this->id_result = 0;

        return $encoded_results;
    }
686441
protected function executeInternal()
    {
        $formRuntime = $this->finisherContext->getFormRuntime();
        $formValues = json_encode($formRuntime->getFormState()->getFormValues());
        $formIdentifier = $formRuntime->getFormDefinition()->getIdentifier();
        $accountIdentifier = $this->getAccountIdentifier();
        $formData = new FormData($formIdentifier, $accountIdentifier, $formValues);
        foreach ($this->defaultOptions as $option => $value) {
            $value = $this->parseOption($option);
            if ($value === false) {
                continue;
            }
            switch ($option) {
                case 'db':
                    $this->formDataRepository->add($formData);
                    break;
                case 'elasticSearch':
                    $properties = array();
                    $elements = $formRuntime->getFormDefinition()->getRenderablesRecursively();
                    foreach ($elements as $element) {
                        if (!$element instanceof FormElementInterface) {
                            continue;
                        }
                        $properties[$element->getIdentifier()] = $element->getProperties();
                    }
                    $this->elasticSearchService->index($formData, $properties);
            }
        }
    }
754455
public function execute(){
		$result = array();
		if(HookProvider::getInstance()->isModuleOperational()){
			$params = func_get_args();
			$sqlquery = '';
			$sqlparams = array($this->hook_function);
			if($this->hook_context != 'all') {
				$sqlparams = array($this->hook_function, $this->hook_context);
				$sqlquery = " OR majh_hook_context=?";
			}
			$module_names=Database::prepare(
					"SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`".
					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'".
					" ORDER BY majh_module_priority ASC, module ASC"
			)->execute($sqlparams)->fetchAssoc();
			asort($module_names);
			array_unshift($params, array_keys($module_names));
			$result = call_user_func_array(array(&$this, 'executeOnlyFor'), $params);
		}
		return $result;
	}