Download the PHP package macfja/php-kvo without Composer

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

PhpKVO

API

What is KVO ?

KVO (Key Value Observing) is a design pattern which allows an object to get notified about changes.
It allow you keep your object synchronized each other without creating a hard link thanks to Subject/Observer design pattern.
KVC (Key Value Coding) and KVO (Key Value Observing) are heavily used in Cocoa Framework (Objective-C)

Installation

The simplest way to install the library is to use Composer:

Usage


A complete examples can be found in the directory examples.

API

API of Observable interface

Implemented in AbstractObservable, Proxy.
A trait for quick implementation is available: ObservableTrait

API of Observable::addObserverForKey method

This method allow you to subscribe to key value changes notification.

Type Variable Description
Listener $listener The object that subscribe to the changes notification.
string $key The key to listen.
int|0 $options optional The list of options. (More information below)
mixed|null &$context optional The context: data to send with the notification. This value passed by reference.

API, The Observable::addObserverForKey options list.

API of Observable::willChangeValueForKey method

This method trigger a notification for all Listener that registered for a key with the option Observer::OPTION_PRIOR.
This method should be call before the key value change.

Type Variable Description
string $key The key that is changed.
string $source The source/type of change. (More information below).
null|mixed $oldValue optional The current value of the key.
null|mixed $requestedValue optional The requested new value of the key.

API of Observable::didChangeValueForKey method

This method trigger a notification for all Listener that registered for a key without the option Observer::OPTION_PRIOR.
This method should be call after the key value change.

Type Variable Description
string $key The key that is changed.
string $source The source/type of change. (More information below).
mixed|null $oldValue optional The value of the key before the change.
mixed|null $requestedValue optional The requested new value of the key.
mixed|null $newValue optional The current value of the key.

API of Observer::setValueForKey method

This method change the value of a key and handle the call of methods Observable::willChangeValueForKey and Observable::didChangeValueForKey.

Type Variable Description
string $key The key to change.
mixed $value The new value.

API, the Observable::willChangeValueForKey and Observable::didChangeValueForKey source value

Note: You can use your own source type, it's just a string.

Note: Observer::SOURCE_INITIAL, If the Listener has the option Observer::OPTION_INITIAL, then when registered, this source is used

API of Listener interface

API of Listener::observeValueForKeyPath method

This method is call every time an observed key is modified.

Type Variable Description
string $keyPath The modified key.
object $key The modified object.
array $change The changed data. (More information below)
mixed &$context The changed context (provided on subscription).

API, The Listener::observeValueForKeyPath change array


All versions of php-kvo with dependencies

PHP Build Version
Package Version
Requires eloquent/pops Version ^4.1
php Version >=5.4.0
macfja/value-provider Version ^0.3.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 macfja/php-kvo contains the following files

Loading the files please wait ....