Download the PHP package synatos/porta without Composer

On this page you can find all versions of the php package synatos/porta. 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 porta

Porta

Porta is greek and means door. This project can be used as door for your Rest API endpoints. The Open API standard allows to describe exactly what information in a rest api is coming in and leaving a server. The standard can be used for 1.) Description / Documentation of interfaces with tools like swagger 2.) Validation of incoming and outgoing Rest Messages 3.) Generation of Request/Response classes that allow to transfer untyped array/json to typed Objects.

Description

Porta is an Open API 3.0 Schema Validator for Http Requests. Key features of this implementation:

Installation

Import/Export

You can easily import export JSON/Yaml Files

Validation

Request Validation

Request can easily be validated against a given schema. Important: make sure the content type for the request is set in the http header. Open API allows several artifacts to be validated:

The example below shows how a http request is validated against the open API Schema.

Register your own format validator

The Open API Specification allows to define formats to specify a datatype in more detail

"However, format is an open value, so you can use any formats, even not those defined by the OpenAPI Specification, such as:" (Source https://swagger.io/docs/specification/data-models/data-types/#string)

With porta you can register your own validator to handle formats. See the example below:

Generate PHP Class from Schema

Schemas get easily get larger and parsing json/yaml including the file load can become time consuming. Therefore an existing schema can be compiled into a class the has the schema as array inline

This compile a class with the following content:

Generate Open API Class

You can generate for a given schema a class that will contain all the typed properties. Futhermore two method \JsonSerializable and fromArray(array $data) allow to initialize from array and generated an array again. This way you do not need to access arrays anymore but can create the Schema object from an array and work fully typed with the object.

The generated class will look like this

Model Manipulation

Every artifact in Open API has a object representation. So you can easily build up Schema, Operations or any other part

Further Readings


All versions of porta with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
symfony/yaml Version *
gm314/nitria Version *
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 synatos/porta contains the following files

Loading the files please wait ....