Download the PHP package litvinenko/app without Composer
On this page you can find all versions of the php package litvinenko/app. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download litvinenko/app
More information about litvinenko/app
Files in litvinenko/app
Package app
Short Description General-purpose Litvinenko\Common\App class that can dispatch events in Magento style and create singletones in Magento style
License
Informations about the package app
General-purpose App class
It can:
- dispatch events in Magento style (see http://www.solvingmagento.com/event-driven-architecture-in-magento-observer-pattern/ or http://codegento.com/2011/04/observers-and-dispatching-events/)
-
create singletones in Magento style (see http://inchoo.net/magento/making-use-of-magento-getsingleton-method/)
This class uses Magento-like XML config files (see http://www.solvingmagento.com/event-driven-architecture-in-magento-observer-pattern/).
Installation
Just install it throw composer. Create composer.json file in your app directory, fill it with
and run
To init App
Just run \Litvinenko\Common\App::init() method and pass to it path to your config file (default path is 'config.xml'). This will register all events and observers.
XML config file for this app is very similar to Magento XML config files (see http://www.solvingmagento.com/event-driven-architecture-in-magento-observer-pattern/).
It should look like:
To dispatch events using App:
firstly, init app:
then, in any place you need paste:
For example,
Working example:
XML file ('example_config.xml')
PHP file