upload and validate module compressed file

@param array $input
@return \Illuminate\Support\Facades\Response
507972
public function upload(array $input)
    {
        $file                     = $this->resolveTempFileName($input['file']);
        $input['file']->directory = $file['directory'];
        $input['file']->filename  = $file['filename'];
        Validator::resolver(function($translator, $data, $rules, $messages) {
            return new CustomModule($translator, $data, $rules, $messages);
        });

        $validation = $this->validator->on('upload')->with($input, [], [
            'source' => trans('antares/foundation::response.modules.validator.invalid-structure')
        ]);


        return ($validation->fails()) ? Response::make($validation->getMessageBag()->first(), 400) :
                Response::json([
                    'html' => $this->manifestDecorator($validation->getManifest()),
                    'path' => $file['subdir'] . DIRECTORY_SEPARATOR . $file['filename']], 200);
    }
1371021
public function makeFiles($input, array $attributes = array(), array $config = array()) {
		$files = array();
		$uploads = hypeApps()->uploader->handle($input, $attributes, $config);
		foreach ($uploads as $upload) {
			if ($upload->file instanceof \ElggEntity) {
				$files[] = $upload->file;
			}
		}
		return $files;
	}
796964
public function validate(array $input = []): ValidationResult
    {
        $results = [];

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

            $rules = $this->parser->parseRulesDefinition($definition);

            $results[$key] = $rules->validate($key, $input);

        }

        return new ValidationResult($results, $this->translator);
    }
75255
public function create(array $input)
    {
        $input = $this->onlyFillable($input);

        return $this->modelInstance->create($input);
    }
1371430
public function process(array $input)
    {
        if($this->v->validate($input))
        {
            Event::fire("form.processing", array($input));
            return $this->callRepository($input);
        }
        else
        {
            $this->errors = $this->v->getErrors();
            throw new ValidationException;
        }
    }
49224
public static function createFromArray(array $input)
    {
        if (!empty($input['empty'])) {
            return static::createEmpty();
        }
        foreach (['lower', 'upper', 'lowerInclusive', 'upperInclusive'] as $key) {
            if (array_key_exists($key, $input)) {
                return new static(
                    array_key_exists('lower', $input) ? $input['lower'] : null,
                    array_key_exists('upper', $input) ? $input['upper'] : null,
                    array_key_exists('lowerInclusive', $input) ? $input['lowerInclusive'] : true,
                    array_key_exists('upperInclusive', $input) ? $input['upperInclusive'] : false
                );
            }
        }
        return new static(array_shift($input), array_shift($input));
    }
283052
private function remapFiles(array $input)
    {
        $output = array();

        foreach ($input as $name => $array) {
            foreach ($array as $field => $value) {
                $pointer = &$output[$name];
                if (!is_array($value)) {
                    $pointer[$field] = $value;
                    continue;
                }

                $stack = array(&$pointer);
                $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($value), RecursiveIteratorIterator::SELF_FIRST);

                foreach ($iterator as $key => $value) {
                    array_splice($stack, $iterator->getDepth() + 1);
                    $pointer = &$stack[count($stack) - 1];
                    $pointer = &$pointer[$key];
                    $stack[] = &$pointer;

                    if (!$iterator->hasChildren()) {
                        $pointer[$field] = $value;
                    }
                }
            }
        }

        // Remove broken files as well
        return $this->removeBrokenFiles($output);
    }
836628
public function create(array $input)
    {
        $this->cache->tags($this->getModel())->flush();
        return $this->repository->create($input);
    }
548111
public function post(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
723079
protected function handleFileDelete(array $input = [])
    {
        if (array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
            $input[Field::FILE_DELETE_FLAG] = $input['key'];
            unset($input['key']);
        }

        Input::replace($input);

        return $input;
    }
1086939
public function sanitize( $input ) {
		$new_input = [];
		foreach ( array_keys( (array) $input ) as $id ) {
			$new_input[ sanitize_file_name( $id ) ] = sanitize_text_field( $input[ $id ] );
		}

		return $new_input;
	}
1164742
public function withInput( array $input = null )
	{
		$input = $input ?: $this->request->input();

		$this->session->flashInput( $this->removeFilesFromInput( $input ) );

		return $this;
	}
861109
private function convert($input)
    {
        if (is_array($data = json_decode($input, true))) {
            if (array_key_exists('signatures', $data) || array_key_exists('recipients', $data)) {
                $this->log(LogLevel::DEBUG, 'The input seems to be a JWS or a JWE.');

                return $data;
            } elseif (array_key_exists('signature', $data)) {
                $this->log(LogLevel::DEBUG, 'The input seems to be a flattened JWS.');

                return $this->fromFlattenedSerializationSignatureToSerialization($data);
            } elseif (array_key_exists('ciphertext', $data)) {
                $this->log(LogLevel::DEBUG, 'The input seems to be a flattened JWE.');

                return $this->fromFlattenedSerializationRecipientToSerialization($data);
            }
        } elseif (is_string($input)) {
            $this->log(LogLevel::DEBUG, 'The input may be a compact JWS or JWE.');

            return $this->fromCompactSerializationToSerialization($input);
        }
        $this->log(LogLevel::ERROR, 'The input is not supported');
        throw new \InvalidArgumentException('Unsupported input');
    }
532440
public function respond($input, $status = self::INTERNAL_ERROR, array $header = [])
    {
        return ResponseHelper::fill($this->response, $input, $status, $header);
    }
120006
protected function createMigration($input)
    {
        if ($input->withMigration) {
            $this->call(
                'create:migration',
                [
                    'model-name' => $input->modelName,
                    '--table-name' => $input->table,
                    '--migration-class-name' => $input->migrationClass,
                    '--connection-name' => $input->connectionName,
                    '--engine-name' => $input->engineName,
                    '--resource-file' => $input->resourceFile,
                    '--template-name' => $input->template,
                    '--without-timestamps' => $input->withoutTimeStamps,
                    '--with-soft-delete' => $input->withSoftDelete,
                    '--force' => $input->force,
                ]
            );
        }

        return $this;
    }
65927
protected function parseFilterInput(array $input)
    {
        if (count($input) === 0) {
            return [];
        }

        $allowed = [];
        $model = $this->model;

        if (property_exists($model, 'filterableProperties')) {
            $allowed = $model::$filterableProperties;
        }

        $filter = [];
        foreach ($input as $key => $value) {
            if (is_numeric($key) || !preg_match('/^[A-Za-z0-9_]*$/', $key)) {
                throw new InvalidRequest("Invalid filter parameter: $key");
            }

            // check if in the list of allowed filter properties
            if (!in_array($key, $allowed)) {
                throw new InvalidRequest("Invalid filter parameter: $key");
            }

            $filter[$key] = $value;
        }

        return $filter;
    }
524427
public function validate( $input )
    {
        // Check if we got readaccess to the provided file name at all.
        if ( !is_file( $input ) || !is_readable( $input ) )
        {
            throw new phpillowRuntimeException( 'Given image file not found: ' . $input );
        }

        // Use getimagesize to determine the filetype of the image, and compare
        // with whitelist of supported image formats.
        $imageData = getimagesize( $input );
        if ( ( $imageData === false ) ||
             ( !in_array( $imageData[2], $this->supportedImageFormats ) ) )
        {
            throw new phpillowValidationException( 'Unsupported image format provided.', array() );
        }

        // If all checks passed, we assume that this is a proper image file.
        return $input;
    }