Download the PHP package friendsofhyperf/grpc-validation without Composer

On this page you can find all versions of the php package friendsofhyperf/grpc-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package grpc-validation

gRPC Validation

中文说明

Validate a protobuf request before a Hyperf gRPC service method runs.

Installation

The component targets Hyperf 3.2 and requires hyperf/context, hyperf/di, hyperf/grpc-server, and hyperf/validation. Composer installs these dependencies, and the package's ConfigProvider automatically registers the validation aspect. There is no component configuration file to publish.

Basic Usage

Add Validation to a gRPC service method and define Hyperf validation rules for the protobuf message fields:

HiUser and HiReply in this example are project-specific classes generated from your .proto definitions. The component validates the first Google\Protobuf\Internal\Message argument passed to the annotated method.

Annotation Options

Option Type Default Behavior
rules array [] Hyperf validation rules used when no resolvable formRequest is provided.
messages array [] Custom validation messages used with rules.
formRequest string '' A container-resolvable Hyperf\Validation\Request\FormRequest class. Its rules() and messages() methods replace the inline values.
scene string '' Passed to FormRequest::scene(). When empty, the annotated method name is used.
resolve bool true When true, failed validation immediately throws a gRPC validation exception.

Using a Form Request

Pass a Form Request class when rules should be shared. The class must be resolvable from the container:

The component calls scene(), then reads rules() and messages(). It does not execute the complete Form Request validation lifecycle, so methods such as authorize(), attributes(), and withValidator() are not used. It also does not call Form Request's protected scene-filtering method. To make scene affect the selected rules, implement that selection in rules(), for example by reading getScene().

If formRequest is not set or cannot be resolved from the container, the component falls back to the annotation's inline rules and messages.

Validation Behavior


All versions of grpc-validation with dependencies

PHP Build Version
Package Version
Requires hyperf/context Version ~3.2.0
hyperf/di Version ~3.2.0
hyperf/grpc-server Version ~3.2.0
hyperf/validation Version ~3.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package friendsofhyperf/grpc-validation contains the following files

Loading the files please wait ...