Download the PHP package helmich/schema2class without Composer

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

JSONSchema to PHP class converter

Build PHP classes from JSON schemas automatically.

Example

Consider a simple JSON schema (ironically stored in YAML format), stored in a file example.yaml:

Using this converter, you can automatically generate PHP classes from this schema with accessor and conversion functions:

This command will automatically try to infer a PHP target namespace from your composer.json file and automatically create the appropriate PHP classes:

Then, use the classes in your code:

Compatibility

This tool requires PHP 8.2 or newer to run.

The generated code can be backwards-compatible up until PHP 5.6. Use the --target-php flag to set the desired PHP version that the generated code should be compatible with. When using a configuration file, use the targetPHPVersion property.

Creation result

The generated classes have these features:

As an example, a shortened version with all comments removed, from the above schema shows the location, only containing the city (country is behaving the same, but with a different name)

Installation

Install using Composer:

Using configuration files

In many projects, you're going to want to keep an evolving JSON schema in sync with the generated PHP classes continuously. For this reason, S2C allows you to create a configuration file .s2c.yaml that stores the most common conversion options:

You can store your local configuration in this yaml file and start the generation process by calling

This will scan for .s2c.yaml in the current directory and use it's parameters. If you need to have different files for multiple schemas, you can provide a config file as a parameter.


All versions of schema2class with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
symfony/console Version ~3.0|~4.0|~5.0|~6.0|~7.0
symfony/yaml Version ~3.0|~4.0|~5.0|~6.0|~7.0
justinrainbow/json-schema Version ^6.0
ext-json Version *
composer/semver Version ^3.0
laminas/laminas-code Version ^4.12
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 helmich/schema2class contains the following files

Loading the files please wait ....