Download the PHP package eloquent/liberator without Composer

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

No longer maintained

This package is no longer maintained. See this statement for more info.

Liberator

A proxy for circumventing PHP access modifier restrictions.

Installation and documentation

What is Liberator?

Liberator allows access to protected and private methods and properties of objects as if they were marked public. It can do so for both objects and classes (i.e. static methods and properties).

Liberator's primary use is as a testing tool, allowing direct access to methods that would otherwise require complicated test harnesses or mocking to test.

Usage

For objects

Take the following class:

Normally there is no way to call foo() or access $bar from outside the SeriousBusiness class, but Liberator allows this to be achieved:

For classes

The same concept applies for static methods and properties:

To access these, a class liberator must be used instead of an object liberator, but they operate in a similar manner:

Alternatively, Liberator can generate a class that can be used statically:

Unfortunately, there is (currently) no getStatic() or setStatic() in PHP, so accessing static properties in this way is a not as elegant as it could be.

Applications for Liberator


All versions of liberator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8
eloquent/pops Version ^5
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 eloquent/liberator contains the following files

Loading the files please wait ....