Download the PHP package rstoetter/cdependencymanager-php without Composer
On this page you can find all versions of the php package rstoetter/cdependencymanager-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rstoetter/cdependencymanager-php
More information about rstoetter/cdependencymanager-php
Files in rstoetter/cdependencymanager-php
Package cdependencymanager-php
Short Description A PHP class, which is able to resolve dependencies
License MIT
Informations about the package cdependencymanager-php
The repository \rstoetter\cdependencymanager-php
Index
Description
Use Cases
Provided Classes
Namespaces
Installation
Usage Example
More Informations
Description
The class cDependencyManager is a PHP class, which is able to resolve dependencies (ie between classes, URLs, HTML scripts .. ).
You feed the class with the known dependencies of the objects you are providing and it generates an array with the objects you provided now arranged in the correct order, which is defined by the dependencies between the specific objects
Use Cases
For example, if we want to create a HTML header, which loads the necessary modules in the correct order. One file after another and the dependant files should not be loaded until the files they are dependant from have been loaded.
In order to get the correct order you must not know the correct order. It is enough to know the implicit dependencies of each file. Therefore you provide the basic rules for the file ( it's unique key and the files it depends directly on) and the class cDependencyManager will then calculate the correct order of the whole dependency structure for you.
Provided Classes
The class \rstoetter\cdependencymanager\cDependencyManager is the main class of the repository cdependencymanager-php.
There are no helper classes necessary in order to use the class cDependencyManager:
But you will need PHP 7 or later to use this repository
Namespace
Use the namespace rstoetter\cdependencymanager in order to access the classes provided by the repository cdependencymanager-php.
Installation
The releases of the repository cdependencymanager-php are hosted by Packagist, the main composer repository. The repository assumes that you have composer installed. Simply add:
"require" : {
"rstoetter/cdependencymanager-php" : ">=1.0.0"
}
to your composer.json, and then you can simply install it with the command:
composer install
Usage Example
The code above will output the following result:
#08 file_without_dependencies
#19 file_without_dependencies
#16 file_without_dependencies
#15 file_without_dependencies
#01 file_without_dependencies
#13 dependant from #1
#03 dependant from #1
#02 dependant from #1
#14 dependant from #1
#04 dependant from #3
#05 dependant from #3
#06 dependant from #2 and #3
#07 dependant from #2 and #3
#18 dependant from #5 and #2
#10 dependant from #7
#11 dependant from #7
#17 dependant from #7
#09 dependant from #7
#12 dependant from #9
More Information
See the project wiki of cdependencymanager-php for more technical informations.