Download the PHP package yeast/loafpan without Composer

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

Loafpan

QA

A simple PHP 8 native object expansion (or hydration as some call it) framework

Features

Installation

Very quick use

Usage

To start using Loafpan, you first need to annotate your objects, in the next few examples we will create to fake classes to explain the details

An expandable object is called a "Unit", Units either need to be either annotated with Unit or have a custom expander registered. However for now we'll cover annotated Units

In the first example, Sandwich is a purely setter based unit, and will use the default constructor to instantiate the object and then set the properties manually.

Loafpan is here guided by the Field attributes, which signal which properties can be applied from an object.

Topping however is a purely expander based, and will take only a string, as this is the only instantiation method available

Expander functions are public static functions with either 1 or 2 arguments (the optional second one being a Loafpan instance), the first argument defines the input type that can be used to expand the object from, e.g. Topping can be made from a string alone

While Topping only defines 1 Expander, you can add multiple, be aware that the results can be unpredictable when the types overlap.

With the 2 classes we just defined, a valid json object for Sandwich would be

which will roughly translate into

Finally, applying all this, create a Loafpan instance with a directory in which it can scribble php files and call expand with the class you want to expand into, in our case Sandwich and the user input.

The following example shows this usage

If the options given here doesn't give you enough flexibility, you can always implement your own expander by implementing UnitExpander (\Yeast\Loafpan\UnitExpander) on a class and either registering it to loafpan by using the registerExpander function on a Loafpan instance or setting the expander parameter on the Unit attribute

See src/Expander for some examples of custom UnitExpanders

Default expanders

Todo


All versions of loafpan with dependencies

PHP Build Version
Package Version
Requires nette/php-generator Version ^3.6
brick/varexporter Version ^0.3.5
symfony/polyfill-php81 Version ^1.24
jawira/case-converter Version ^3.4
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 yeast/loafpan contains the following files

Loading the files please wait ....