Download the PHP package fivelab/resource without Composer

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

Russia has become a terrorist state.

 #StandWithUkraine 

Resource System

Build Status

Add functionality for work with resources in you application and serialize this resources to any formats.

Support formats:

Requirements

Installation

Add Resource package in your composer.json:

`

Now tell composer to download the library by running the command:

Problem

More web applications use API (Application Programming Interface) with difference result structures. It's difficult for developers and clients (who use this API) because each developer can return any data (JSON or XML). And in more cases, applications does not support media types and return JSON data with any Content-Type header.

And in most cases, developers use real entities from database for map to JSON (as an example symfony/serializer). This work funny, because one entity in backend application can representation to many resources for clients. As an example: we have User entity with more data. If user authorized, we must return all data, but if user not logged, we must return less data (id and avatar as an example). Yes, more people speak what we have a group system, but what will happen if I say that we should have more than 100 groups? Yes, in large application it's real case.

In this library we try to resolve all issue related with API.

Note: we don't speak - API, we must speak - Resource, because all operations (create, edit, delete, etc...) are performed on one resource (Blog as an example).

Solution

  1. Full isolate between model in database and resource for representation. Model from database convert to resource via Assembler. Blog -> Assembler -> BlogResource. By this we can create any resources for one model in database. (For Blog as example: BlogResoure, PremiumBlogResoure, HotBlogResource, etc...). We don't use group system for separate, we have a separate assembler for each resource.
  2. We full support media type (Content-Type/Accept). If client accept json, we return json, if client accept xml, we return xml (but previously we must configure it ;) ). And - one resource, many formats ;)

Note: in our library we use symfony/serializer with custom normalizers and additional functionality. As result, all you custom normalizers/denormaizers will be normal work with our library.

License

This library is under the MIT license. See the complete license in library

Development

For easy development you can use our Dockerfile:

After run docker container, please install vendors:

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

Contributors:

Thanks to everyone participating in the development of this Resource library!


All versions of resource with dependencies

PHP Build Version
Package Version
Requires php Version ~8.0
symfony/serializer Version ~5.4 | ~6.0
symfony/event-dispatcher Version ~5.4 | ~6.0
symfony/property-access Version ~5.4 | ~6.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 fivelab/resource contains the following files

Loading the files please wait ....