Executes the bulk command.
@return mixed
@throws yii\base\InvalidCallException
508757
public function execute()
    {
        //valid endpoints are /_bulk, /{index}/_bulk, and {index}/{type}/_bulk
        if ($this->index === null && $this->type === null) {
            $endpoint = ['_bulk'];
        } elseif ($this->index !== null && $this->type === null) {
            $endpoint = [$this->index, '_bulk'];
        } elseif ($this->index !== null && $this->type !== null) {
            $endpoint = [$this->index, $this->type, '_bulk'];
        } else {
            throw new InvalidCallException('Invalid endpoint: if type is defined, index must be defined too.');
        }

        if (empty($this->actions)) {
            $body = '{}';
        } elseif (is_array($this->actions)) {
            $body = '';
            foreach ($this->actions as $action) {
                $body .= Json::encode($action) . "\n";
            }
        } else {
            $body = $this->actions;
        }

        return $this->db->post($endpoint, $this->options, $body);
    }
15947
public function execute() 
	{
		if ($this->methodName=='system.multiCall') {
			return $this->client->system->multiCall( $this->client->_multiCallArgs );
		} else { // system.multicall
			return $this->client->system->multicall( $this->client->_multiCallArgs );
		}
	}
655184
public function run()
    {
        $searchModel = new LanguageSourceSearch([
            'searchEmptyCommand' => $this->controller->module->searchEmptyCommand,
        ]);
        $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());

        return $this->controller->render('translate', [
            'dataProvider' => $dataProvider,
            'searchModel' => $searchModel,
            'searchEmptyCommand' => $this->controller->module->searchEmptyCommand,
            'language_id' => Yii::$app->request->get('language_id', ''),
        ]);
    }
710918
public function runAction()
    {
        try {
            $this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));

            $sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());

            $esConfigLocation = ConfigLocation::fromPath(Definition::getSystemConfigDir());

            $this->commandBus->dispatch(InitializeEventStore::setUpWithSqliteDbAdapter($sqliteDbFile, $esConfigLocation));

        } catch (\Exception $ex) {
            $this->commandBus->dispatch(UndoSystemSetUp::removeConfigs(
                Definition::getSystemConfigDir(),
                Definition::getSystemConfigDir(),
                Definition::getEventStoreSqliteDbFile()
            ));

            throw $ex;
        }

        return $this->redirect()->toRoute('prooph.link/system_config');
    }
442269
public function execute()
    {
        $collection = $this->filter->getCollection($this->templateCollectionFactory->create());
        $collectionSize = $collection->getSize();

        foreach ($collection as $item) {
            //@codingStandardsIgnoreLine
            $item->delete();
        }

        $this->messageManager->addSuccessMessage(__('A total of %1 record(s) have been deleted.', $collectionSize));

        /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        return $resultRedirect->setPath('*/*/');
    }
785147
public function run()
    {
        $scanTimeLimit = Yii::$app->getModule('translatemanager')->scanTimeLimit;

        if (!is_null($scanTimeLimit)) {
            set_time_limit($scanTimeLimit);
        }

        $scanners = Yii::$app->getModule('translatemanager')->scanners;
        if (!empty($scanners)) {
            $this->scanners = $scanners; // override scanners from module configuration (custom scanners)
        }

        $this->_initLanguageArrays();

        $languageSource = new LanguageSource();

        return $languageSource->insertLanguageItems($this->_languageElements);
    }
939009
public function execute()
    {
        $this->phpci->quiet = true;
        $success = true;

        $php = $this->phpci->findBinary('php');

        foreach ($this->directories as $dir) {
            if (!$this->lintDirectory($php, $dir)) {
                $success = false;
            }
        }

        $this->phpci->quiet = false;

        return $success;
    }
774116
public function execute() {
        $this->log
            ->printAsMessage()
            ->info($this->getDescription())
            ->printEmptyLine()
            ->printAsOutput();

        ksort($this->config['commands']);

        $maxCommandLength = 0;

        foreach (array_keys($this->config['commands']) as $command) {
            if (is_string($command) && strlen($command) > $maxCommandLength) {
                $maxCommandLength = strlen($command);
            }
        }

        $tab = 4;
        $minLength = $tab * (int) ($maxCommandLength / $tab) + $tab;

        foreach ($this->config['commands'] as $command => $details) {
            $this->log->info(
                str_pad($command, $minLength) . '<dim>' . $details['description'] . '</dim>'
            );
        }

        return $this;
    }
1196970
public function run() {

		$name	= Yii::$app->request->post( 'name' );
		$type	= Yii::$app->request->post( 'type' );
		$data	= [];

		$modelService = $this->controller->modelService;

		// For models having type columns
		if( isset( $type ) ) {

			$data = $modelService->searchByNameType( $name, $type );
		}
		else {

			$data = $modelService->searchByName( $name );
		}

		// Trigger Ajax Success
		return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
	}
781951
public function executeFull()
    {
        $storeIds = array_keys($this->storeManager->getStores());

        foreach ($storeIds as $storeId) {
            $dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
            $this->indexerHandler->cleanIndex([$dimension]);
            $this->indexerHandler->saveIndex([$dimension], $this->fullAction->rebuildStoreIndex($storeId));
        }
    }
90091
public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        if ($this->enableClientScript) {
            $id = $this->options['id'];
            $options = Json::htmlEncode($this->getClientOptions());
            $attributes = Json::htmlEncode($this->attributes);
            $view = $this->getView();
            ActiveFormAsset::register($view);
            $view->registerJs("jQuery('#$id').yiiActiveForm($attributes, $options);");
        }

        echo Html::endForm();
    }
333321
public function execute()
	{
		// open a Redis connection and execute the queued commands
		foreach ($this->queue as $command)
		{
			for ($written = 0; $written < strlen($command); $written += $fwrite)
			{
				$fwrite = fwrite($this->connection, substr($command, $written));
				if ($fwrite === false)
				{
					throw new \RedisException('Failed to write entire command to stream');
				}
			}
		}

		// Read in the results from the pipelined commands
		$responses = array();
		for ($i = 0; $i < count($this->queue); $i++)
		{
			$responses[] = $this->readResponse();
		}

		// Clear the queue and return the response
		$this->queue = array();

		if ($this->pipelined)
		{
			$this->pipelined = false;
			return $responses;
		}
		else
		{
			return $responses[0];
		}
	}
981923
protected function executeCommand()
    {
        $process = new SymfonyProcess(
            $this->makeCommand(),
            $this->target->workingDir
        );

        $process->run();

        $output = $this->outputToCollection($process->getOutput());

        if ($output->count() == 0) {
            return $output;
        }

        if ($rootItem = $this->target->resource->rootItem) {
            return collect($output[$rootItem]);
        }

        return $output;
    }
449777
public function run() {

		$countryId	= Yii::$app->request->post( 'country-id' );
		$provinceId	= Yii::$app->request->post( 'province-id' );

		if( isset( $countryId ) && $countryId > 0 ) {

			$provinces = $this->modelService->getMapByCountryId( $countryId, [ 'default' => true, 'defaultValue' => Yii::$app->core->provinceLabel ] );

			$data = !empty( $provinceId ) ? CodeGenUtil::generateSelectOptionsFromArray( $provinces, intval( $provinceId ) ) : CodeGenUtil::generateSelectOptionsFromArray( $provinces );

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
1297533
public function run()
    {
        foreach ($this->getCommands() as $command)
        {
            $this->transformer->transform($command);

            $this->application->add($command);
        }

        return $this->application->run();
    }
144300
public function execute()
    {
        $this->setOption(CURLINFO_HEADER_OUT, true); // track outgoing headers too
        $headers = ["Content-type: application/json", "Accept: application/json", "Authentication: {$this->authentication}", "Timestamp: {$this->timestamp}"];
        $this->setOption(CURLOPT_HTTPHEADER, $headers);
        return curl_exec($this->handle);
    }
179490
public function run() {

		$provinceId	= Yii::$app->request->post( 'province-id' );

		if( isset( $provinceId ) && $provinceId > 0 ) {

			$regions = $this->modelService->getMapByProvinceId( $provinceId );

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $regions );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}