Process the uploaded files, and run the validation

@return	void
192384
public static function process($config = array())
	{
		foreach (static::$upload->getAllFiles() as $file)
		{
			$file->setConfig($config);
			$file->validate();
		}
	}
120414
private static function validation()
    {
        $files = ['Validator', 'ValidationResult'];
        $folder = static::$root.'Validation'.'/';

        self::call($files, $folder);

        //Initiate the validation surface
        Validator::ini();
    }
798291
protected function validateFileManager()
    {
        $selected = $this->isQuery('selected');
        $files = $selected ? $this->data_selected : array($this->data_file);

        $this->setSubmitted('filemanager');
        $this->setSubmitted('files', $files);
        $this->setSubmitted('command', $this->data_command);

        $this->validateComponent("file_manager_{$this->data_command['command_id']}");
        return !$this->hasErrors(false);
    }
333622
protected function process()
    {

        // query whether or not we've to upload the image files
        if ($this->getSubject()->hasCopyImages()) {
            // initialize the image path
            if ($imagePath = $this->getValue(ColumnKeys::IMAGE_PATH)) {
                // upload the file and set the new image path
                $imagePath = $this->getSubject()->uploadFile($imagePath);

                // log a message that the image has been copied
                $this->getSubject()->getSystemLogger()->debug(
                    sprintf('Successfully copied image %s => %s', $imagePath, $imagePath)
                );

                // write the new image path to the target column
                $this->setValue(ColumnKeys::IMAGE_PATH, $imagePath);
            }
        }
    }
740438
protected function validateDownload()
    {
        $this->setSubmitted('download');
        $this->setSubmittedArray('sources');
        $this->validateElement('sources', 'required');
        $this->validateUrlDownload();

        return !$this->hasErrors();
    }
719901
public function isValid()
    {
        // get files for upload
        $this->files = $this->request->getUploadedFiles();

        if (sizeof($this->files) > 0) {

            // do any actions if files exists

            foreach ($this->files as $n => $file) {

                // apply all the validation rules for each file

                foreach ($this->rules as $key => $rule) {

                    if (method_exists($this->validator, 'check' . ucfirst($key)) === true) {
                        $this->validator->{'check' . ucfirst($key)}($file, $rule);
                    }
                }
            }
        }

        $errors = $this->getErrors();

        return (empty($errors) === true) ? true : false;
    }
1236272
public function process()
    {
        $form = $this->getForm();
        if ($form !== null && $form->isSubmitted()) {
            $data = $form->getFormData();
            if (isset($data[$this->id])) {
                $this->selected_value = $data[$this->id];

                $view = $this->getFirstAncestor('SwatView');
                if ($view !== null) {
                    $selection = new SwatViewSelection(array(
                        $this->selected_value
                    ));

                    $view->setSelection($selection, $this);
                }
            }
        }
    }
8156
public function process()
    {
        parent::process();

        $data = $this->getForm()->getFormData();

        $this->crop_width = $data[$this->id . '_width'];
        $this->crop_height = $data[$this->id . '_height'];
        $this->crop_left = $data[$this->id . '_x'];
        $this->crop_top = $data[$this->id . '_y'];

        // deprecated aliases
        $this->crop_box_width = $this->crop_width;
        $this->crop_box_height = $this->crop_height;
        $this->crop_box_left = $this->crop_left;
        $this->crop_box_top = $this->crop_top;
    }
1130179
public function process()
    {
        parent::process();

        $data = &$this->getForm()->getFormData();
        if (isset($data[$this->id])) {
            $this->value = $data[$this->id];
        } else {
            $this->value = null;
        }

        $this->value = ltrim($this->value, '#');

        if ($this->value == '') {
            $this->value = null;
        }

        if ($this->required && $this->value === null) {
            $this->addMessage($this->getValidationMessage('required'));
        } elseif (
            $this->value !== null &&
            !$this->validateColor($this->value)
        ) {
            $message = sprintf(
                Swat::_('“%s” is not a valid color.'),
                $this->value
            );

            $this->addMessage(new SwatMessage($message, 'error'));
        }
    }
510687
public function runValidators()
	{
		$filelistValidator = new FileListValidator($this->input, $this->output);

		$validateFiles = $filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)
			->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)
			->setPhpbbVersion($this->phpbbVersion)
			->setDebug($this->debug)
			->setSafeMode($this->safeMode)
			->validate();

		if (empty($validateFiles))
		{
			$this->output->writelnIfDebug('');
			$this->output->writelnIfDebug("<fatal>No files found for validation.</fatal>");
			return;
		}

		$pluralRule = $this->guessPluralRule();
		$this->output->writelnIfDebug("<notice>Using plural rule #$pluralRule for validation.</notice>");
		$this->output->writelnIfDebug('');

		$this->output->writelnIfDebug("Validating file list:");
		$this->printErrorLevel($this->output);

		$this->maxProgress = sizeof($validateFiles) + 1;
		$this->progressLength = 11 + strlen($this->maxProgress) * 2;

		$filelistValidator = new FileValidator($this->input, $this->output);
		$filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)
			->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)
			->setPhpbbVersion($this->phpbbVersion)
			->setPluralRule($pluralRule)
			->setDebug($this->debug)
			->setSafeMode($this->safeMode);

		foreach ($validateFiles as $sourceFile => $originFile)
		{
			$this->output->writelnIfDebug('');
			$this->output->writelnIfDebug("Validating file: $originFile");
			$filelistValidator->validate($sourceFile, $originFile);
			$this->printErrorLevel($this->output);

			usleep(31250);//125000);
		}

		$this->output->writeln('.');
	}
405569
public function process()
    {
        // Migrate init - to create migration table
        $type = $this->argument('type');

        $migration = Migrator::instance($this);
        $migration->getLatestMigration()
                  ->setMigrationClassName();

        if ($type == '' || $type == 'up') {
            $migration->updateMigration();
        } else {
            $migration->updateMigration('down');
        }

        $this->info('Migration Completed Successfully!');
    }
677276
public function process()
    {
        parent::process();

        $cmd = $this->compile();
        $this->runCmd(
            $cmd,
            '\Thapp\JitImage\Exception\ImageProcessException',
            function ($stderr) {
                $this->clean();
            },
            ['#', PHP_EOL]
        );
    }
41855
public function execute()
    {
        set_error_handler([$this, 'processErrors'], E_WARNING);

        $stream = fopen($this->requestData['url'], 'r', false, $this->streamContext);

        $this->responseBody = stream_get_contents($stream);

        $this->responseHeaders = $http_response_header;

        $this->response = implode("\r\n", $http_response_header) . "\r\n\r\n" . $this->responseBody;

        restore_error_handler();
    }
330386
public function validate(): void
    {
        $this->validateRootFilter();
        $this->validateRelations();
        $this->validateSorts();
        $this->validateOffset();
        $this->validateLimit();
        $this->validateFields();
    }
982508
protected function submitFileManager()
    {
        if ($this->data_access) {
            if ($this->isPosted('process_selected')) {
                $this->submitSelectedFileManager();
            } else if ($this->isPosted('submit') && $this->validateFileManager()) {
                $this->submitCommandFileManager();
            }
        }
    }
1173974
public function process()
    {
        $gridField = $this->getGridField();

        if ($this->Columns) {
            $columns = $this->Columns;
        } elseif ($dataCols = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class)) {
            $columns = $dataCols->getDisplayFields($gridField);
        } else {
            $columns = singleton($gridField->getModelClass())->summaryFields();
        }

        if ($this->IncludeHeader && !$this->HeadersOutput) {
            $this->outputHeader($gridField, $columns);
            $this->HeadersOutput = true;
        }

        $chunkSize = $this->config()->get('chunk_size');

        $this->outputRows($gridField, $columns, $this->currentStep, $chunkSize);

        $this->currentStep += $chunkSize;

        if ($this->currentStep >= $this->totalSteps) {
            // Check to see if we need to wait for some time for asset synchronisation to complete
            $sleepTime = (int) $this->config()->get('sync_sleep_seconds');
            if ($sleepTime > 0) {
                sleep($sleepTime);
            }

            $this->isComplete = true;
        }
    }
1282403
public function run() {
        $uploadedFile = UploadedFile::getInstanceByName($this->inputName);
        $params = Yii::$app->request->getBodyParams();
        $filePath = $this->getUnusedPath($this->tempPath . DIRECTORY_SEPARATOR . $uploadedFile->name);

        $isUploadComplete = ChunkUploader::process($uploadedFile, $filePath);

        if ($isUploadComplete) {
            $fileHash = md5(microtime(true) . $filePath);
            $fileType = isset($params['name']) ? strtolower(substr(stristr($params['name'], '.'), 1)) : strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
            $newFileName = "{$fileHash}.{$fileType}";

            $entityClass = $this->entityClass;
            $entityModel = $entityClass::findOne(['id' => $params['entity_id']]);
            if (is_null($entityModel)) {
                throw new \yii\base\Exception("entity model(id:{$params['entity_id']}) not found!");
            }

            $fileDirPath = $this->_organizer->getFullUploadStoreDir($fileHash, $entityModel);
            $newFilePath = $fileDirPath . DIRECTORY_SEPARATOR . $newFileName;

            if (!copy($filePath, $newFilePath)) {
                throw new Exception("Cannot copy file! {$filePath}  to {$newFilePath}");
            }
            $attachementClass = $this->attachementClass;
            $attachement = new $attachementClass;
            $attachement->loadDefaultValues();
            $attachement->setAttributes([
//                'name' => pathinfo($filePath, PATHINFO_FILENAME),
//                'type' => $attachement->type,
                'name' => $params['name'],
                'entity_id' => $entityModel->id,
                'entity_class' => $this->entityClass,
                'entity_attribute' => $this->entityAttribute,
                'hash' => $fileHash,
                'size' => filesize($filePath),
                'content' => isset($extras['content']) ? $extras['content'] : "",
                'extension' => $fileType,
                'mime_type' => FileHelper::getMimeType($filePath),
                'logic_path' => $this->_organizer->getUploadLogicPath($fileHash, $entityModel),
            ]);

            if ($attachement->save()) {
                @\unlink($filePath);
            }

            if ($this->onComplete) {
                return call_user_func($this->onComplete, $filePath, $params);
            } else {
                return [
                    'filename' => $filePath,
                    'params' => $params,
                ];
            }
        }

        return null;
    }