Download the PHP package anax/proxy without Composer

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

Anax Proxy

Latest Stable Version Join the chat at https://gitter.im/canax/proxy

Build Status CircleCI

Build Status Scrutinizer Code Quality Code Coverage

Maintainability Codacy Badge

Anax proxy is a module for static proxy to access framework resources, services, that are available in $di service container.

The basic idea is to allow static access like this Session::start(). You can see it as a wrapper above the ordinary way using $di->get("session")->start(). It is syntactic sugar.

You can compare it to the implementation of Laravel Facade.

Table of content

You can also read this documentation online.

Install

You can install the module from anax/proxy on Packagist using composer.

Development

To work as a developer you clone the repo and install the local environment through make. Then you can run the unit tests.

Init the proxy factory

You start by initiating the proxy factory in the frontcontroller index.php.

Or like this to take into account if the module is installed or not.

The service container $di is injected and an autoloader is created to catch and dynamic create classes for the proxy class to map the service in $di.

Use services through the proxy

You start by defining the proxy service class through its service name, like this.

You can then use it through static access Db::connect() which behind the scenes translates to $di->get("db")->connect().

This is how it can be used with a route.

Here is the same route implemented, with $app style programming and dependency to the (globaly) scoped variable $app which is a front for $di.

Above example uses $app which itself does a $di->get("service") behind the scene.

So, it is a matter of syntactic sugar, a layer of user friendliness you might approve of, or not.

Related design patterns

Laravel have an implementation as Laravel Facade. This might indicate they relate to the design pattern Facade design pattern.

People have argued that the implementation is more of the design pattern Proxy design pattern.

People have also argued that it is an implementation of the design pattern Singleton design pattern.

Dependency

Using psr11 through psr/container.

License

This software carries a MIT license. See LICENSE.txt for details.


All versions of proxy with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
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 anax/proxy contains the following files

Loading the files please wait ....