Download the PHP package leedavis81/altr-ego without Composer

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

Create an AltrEgo

Build Status Total Downloads Latest Stable Version

A tool to allow you access to an object's protected / private properties by breaking PHP scope. This is useful in testing scenarios where you want to quickly verify a hidden encapsulated routine within your application. Often when you just want to test a small part of your application, that routine can be (rightly so) encapsulated and set to private / protected. And is uncallable from your test suite. Running through the process of creating, mocking and injecting dependencies just to get your object in a valid state for your test can be very timely. This tool will help you call that private routine or inspect that protected property directly.

AltrEgo allows you to completely maintain your object's state throughout any manipulations. If you decide you want the scope to come back into play, you simply fetch your object back. Any changes made during its time as an "AltrEgo" object will remain.

This library uses adapters for different versions of PHP.

If you're using 5.3

Then PHP's Reflection classes are used to break the scope of your object.

For 5.4 this library uses closure scope binding

PHP 5.4 has a new "scope breaking" feature with the use of closures. Take a look at Davey Shafik's closure puzzle blog post top get a good understanding of how this works. This method is far quicker than using PHP's built in Reflection tools. Tests I've performed "breaking scope" this way have given a speed increase in of around 52%.

Usage

Limitations

  1. Whenever accessing an array property it will be converted (and maintained) as an ArrayObject. This is due to limitation on setting array values when using PHP overloading (__get). If this is a problem you can either get the value directly, then overwrite it with a modified one. Or once you've retrieved the modified ArrayObject simply run ->toArray() on it.

All versions of altr-ego 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 leedavis81/altr-ego contains the following files

Loading the files please wait ....