Download the PHP package russbalabanov/tiny-rest without Composer

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

Tiny-rest

Heyyy! I just released this library and currently writing some docs for it, so please wait a while.

But if you are eager and cannot wait:

Installation

Configuration

Please modify your services.yaml file to register this two services

Transfer Objects

Transfer object is a tiny wrapper for HTTP request. The transfer object SHOULD NOT contain entities or convert some user data into complex custom objects. The general idea is having a validatable object which will contain pure user data

Annotation

Property

name - By default the name equals to the name of the property but can be changed for the cases when there is manual mapping needed

mapped - whether the value will be set to Transfer object or not. Default: true

type - There are cases when the value should be casted to a certain type, for example using Transfer Object as filter in a repository. This types are available for type cast: string, integer, float, array, datetime, boolean. Default value is string

Mapping

The annotation should be used for describing the transfer strategy with the entity. By default the column name equals to the name of the property. The annotation cannot be used without @Property() annotation

column - By default the name equals to the name of the property but can be changed for the cases when there is manual mapping needed

mapped - Can be set as false for cases when the property should not transfer it's data to the entity. Default: true

Relation

The @Relation() annotation is built for the cases when the plain value in the transfer object should be converted into relation entity.

byField - Default: id

Events

OnObjectHydrated

Triggers after object hydration but before validation

OnObjectValid

Triggers after object validation

Usage

Create, Update, List and Pagination

The idea of all operations was to allow user to care less about the trivial and usual stuff and focus on business logic

Create

To create an entity out of request you will need only three agruments. Request object, TransferObject (as a tiny wrapper for the request) and an Entity object.

Update

The update method is almost the same as create() with one exception. If you are doing a PUT HTTP method all the ORM fields (except @Id) will be cleared

Pagination

Providers for collections

ORM
DBAL
NativeQuery
Entity
Array

Handling exceptions and sending API Errors

When you don't want to bother much with validation errors, you may want to go for this solution.

WARNING: This project is currently in aplha stage, which means minimal risk of BC does exist.

Do you like the project? Smash the star button, this will motivate me to make it even better!


All versions of tiny-rest with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
pagerfanta/pagerfanta Version ^2.0
doctrine/common Version ^2.9
doctrine/dbal Version ^2.8
symfony/validator Version ^4.0|^5.0
doctrine/orm Version ^2.6
symfony/property-access Version ^4.0|^5.0
symfony/http-foundation Version ^4.0|^5.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 russbalabanov/tiny-rest contains the following files

Loading the files please wait ....