Download the PHP package aza/phpgen without Composer

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

AzaPhpGen

Anizoptera CMF PHP code generation (dump, serialization) component.

https://github.com/Anizoptera/AzaPhpGen

Build Status

Table of Contents

  1. Introduction
  2. Requirements
  3. Installation
  4. Examples
    • Simple dump
    • Array dump
    • Traversable dump
    • Closure (anonymous function) example
    • Custom object dumping with IPhpGenerable interface
    • Bundled CustomCode class usage
    • Custom object dumping with defined handlers
    • AzaPhpGen customization
  5. Tests
  6. Credits
  7. License
  8. Links

Introduction

Allows to dump complex arrays, objects, closures and basic data types as php code. In part, this can be called a some sort of serialization. And you can customize your dumped php code as you wish.

It is very usefull for code compilation (usually for caching purposes).

Features:

Benefits over var_export():

Requirements

Installation

The recommended way to install AzaPhpGen is through composer. You can see package information on Packagist.

Examples

You can use examples/example.php to run all examples.

Example #1 - Simple dump

Example #2 - Array dump

Example #3 - Traversable dump

AzaPhpGen treat all Traversable objects as arrays (with iterator_to_array).

Example #4 - Closure (anonymous function) example

WARNING: Closures are dumped as is. So complex closures are not supported:

Example #5 - Custom object dumping with IPhpGenerable interface

You can customize dumping of your classes by implementing the IPhpGenerable interface.

Example #6 - Bundled CustomCode class usage

For the simpliest varint of IPhpGenerable interface usages you can use bundled class - CustomCode. It just takes the required code as a constructor argument.

Example #7 - Custom object dumping with defined handlers

Second varint of resulting code customization - usage of defined handlers (hooks) for the classes. This way you can customize dump of any possible class!

Example #8 - AzaPhpGen customization

AzaPhpGen has many options. So it's very simple to configure your resulting code for your special needs (code style for example). You can see all available options in the PhpGen class code.

Tests

Tests are in the Tests folder and reach 100% code-coverage. To run them, you need PHPUnit. Example:

$ phpunit --configuration phpunit.xml.dist

Or with coverage report:

$ phpunit --configuration phpunit.xml.dist --coverage-html code_coverage/

Credits

AzaPhpGen is a part of Anizoptera CMF, written by Amal Samally (amal.samally at gmail.com) and AzaGroup team.

License

Released under the MIT license.

Links


All versions of phpgen with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 aza/phpgen contains the following files

Loading the files please wait ....