Download the PHP package eniams/spy without Composer

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

Spy

Build Status

Spy helps you to know if an object was modified and allow you to fire/listen an event when the given object is modified.

⚠️ This project is a work in progress. ⚠️

Installation

How it works ?

Behind the scene:

The initial object will be copied with a specific cloner then value of the initial (copied) object and the manipulated (current) object will be compared on demand to check if there is some modifications.

Suppose you want to spy a foo object to know if it was modified :

  1. Tag the class to spy with an interface that will correspond to the chosen cloner, there is 2 built-in cloners :

    • Eniams\Spy\Cloner\DeepCopyClonerInterface that use the famous library DeepCopy

    or

    • Eniams\Spy\Cloner\SpyClonerLoadPropertyObjectInterface or Eniams\Spy\Cloner\SpyClonerInterface that allows you to clone more deeper the object/array stored in properties

You can create a custom Cloner to copy your object :

If you're using Symfony thanks to the autoconfigure tags you don't have to follow the next step, the created cloner will be registered to the ChainCloner that is responsible to clone the oject to spy. So you can go to step 3.

  1. For Vanilla PHP if you don't want to use the default cloners you can Register yours in the Eniams\Spy\ClonerChainCloner

  2. Time to spy your object :shipit:
Now, you want to want to know if a specific property was modified and get the initial and the current value.
Working with Services container you can store an object in the SpyBase to retrieve it later in your application
Symfony
Vanilla PHP
For simple use case that don't need to clone an object, you can also check the difference between 2 "same" classes.
More advanced use case
You can define a context to check some properties.
You can define dynamically which properties to check
You can exclude some properties.

All versions of spy with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
myclabs/deep-copy Version 1.9.1
symfony/config Version ^4.3|^5.0
symfony/http-kernel Version ^4.3|^5.0
symfony/proxy-manager-bridge Version ^3.4|^4.4|^5.0
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 eniams/spy contains the following files

Loading the files please wait ....