Download the PHP package tasso/prototype without Composer

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

Prototype Build Status

Simple prototype-based programming in PHP

Prototype programming is a flavor of object-oriented programming that deals with objects without categorization provided by classes or interfaces. All objects can be identified and differentiated by duck typing. Basically, properties and methods are put in objects on runtime, instead of previously declared in classes; inheritance is obtained by object cloning and dynamic insertion of properties. Thus parent objects act as prototypes for their children.

This allow you to quickly code, once you do structural changes in your source code while you're programming. However, although good for small projects, it can generate unmaintainable applications. It's recommmended that you use prototyping to prototype application modules first and implement an equivalent traditional class-based structure after.

Installation

The recommended way to install this package is through Composer. Create a common composer.json file and run:

Documentation

Basic usage

All prototypes are instances of TassoEvan\Prototype\Prototype class. Properties can be added and removed exactly like the native stdClass. The key difference between Prototype and stdClass is that the last one doesn't handle callable arguments and closures well. You can call closures in a Prototype instance exactly as they are methods.

Also, you can use Prototype instances as closures too:

Property wrappers

All properties assigned to Prototype instances are wrapped in instances of abstract class TassoEvan\Prototype\Property. It can be done explicitly instantiating these objects or calling static methods from TassoEvan\Prototype\Prototype, implicitly wrapping normal properties by simple assignment though.

Explicitly, instanciating TassoEvan\Prototype\Property:

Explicitly, via static methods of TassoEvan\Prototype\Prototype:

Implicitly (TassoEvan\Prototype\NormalProperty only):

TassoEvan\Prototype\NormalProperty

A normal property can be assigned, evaluated and called (if it is callable) as any variable or object public property in PHP.

TassoEvan\Prototype\ReadOnlyProperty

A read only property can't be overwritten. In strict mode, a exception will be thrown when a new assignment is done.

TassoEvan\Prototype\LazyProperty

A lazy property has the ability to be lazy-loaded: at first try to get a value (or call it), a callable named loader is invoked to generate the property value, that will be stored. After loaded, the property behaves like a normal property.

TassoEvan\Prototype\ProxyProperty

TassoEvan\Prototype\DynamicProperty

A dynamic property doesn't have a stored value: you should define a getter and a setter callables to offer some value. Can be useful to represent or be a facade to service providers and containers.

Additional features

Contributions

You are free to fork and contribute to this project.


All versions of prototype with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 tasso/prototype contains the following files

Loading the files please wait ....