Download the PHP package asm/phpflo-bundle without Composer
On this page you can find all versions of the php package asm/phpflo-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phpflo-bundle
PhpFloBundle
This bundle is based on Henri Bergius library phpflo whose README I really suggest to read :-) The intention for creating this bundle is an easier inclusion into e.g. symfony environments with the need for flow programming. I had to rewrite part of the initial Network class to make use of a component registry to easily manage components via DIC. Also all component services should be defined as "public: false" to not clutter the DIC.
Installation
You can either just add via:
Attention: This need minimum-stability: dev set on rootlevel Otherwise you can first add phpflo and then the bundle.
This will first add phpflo with dev stability and the the bundle. This is due to composer's handling of stabilities for indirect dependencies.
Configuration
After adding the bundle, you have a new factory service phpflo.network which uses a registry of all your accordingly tagged services. Another possibility is to use phpflo.network_di service. The difference between these services is: network uses a registry and components are registered only once and collected during compile time. This is useful when using the network within on request cycle and build it only once. If you are working e.g. with a long running process, you should us the network_di where every component will be fetched as a fresh object from DIC for every network build. You can add components using following steps:
Component class
Keep in mind to extend the PhpFlo\Component or implement PhpFlo\ComponentInterface!
service definition (phpflo.network)
You can name the service whatever you want: The only two important things are the tags. It needs name "phpflo.component" to be found in compiler pass and the alias will be used as component name for the graph file.
service definition (phpflo.network_di)
graph file (app/config/my_graph.json)
The builder will automatically search for the provided graph file in '''app/config''' - if you need subdirectories, you can provide the filename in the formate '''subdir/graph.json'''
processes definition (network_di)
Add the service name as component name!
Example
Within a symfony controller with access to the DIC, you can simply create a graph like this:
License
PhpFloBundle is licensed under the MIT license. See the LICENSE for the full license text. Free Software, Hell Yeah!