Download the PHP package hesam-mousavi/falcon-container without Composer
On this page you can find all versions of the php package hesam-mousavi/falcon-container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hesam-mousavi/falcon-container
More information about hesam-mousavi/falcon-container
Files in hesam-mousavi/falcon-container
Package falcon-container
Short Description Powerful 'dependency-injection container'(service container), and 'service-provider' with composite autowiring and binding
License MIT
Informations about the package falcon-container
Why Falcon Container?
The complexity of existing packages providing service containers and providers led to the creation of this project. Falcon doesn't force you to create a BIND. If a bind exists for an ID, it uses it; otherwise, it proceeds with AUTOWIRE
.
Getting Started
-
add this package to your project:
composer require hesam-mousavi/falcon-container
- add composer autoload:
Registering Providers
Each provider consists of two methods: register
and boot
. As you know, first the register method of all providers is executed, then the boot method is called.
providers.php File
Then in a file, for example named providers.php, you should include the path to the created provider.
<?php
return [
\HesamMousavi\FalconContainer\Providers\TestServiceProvider::class,
];
Providers
After creating an instance of the container, you can run all providers by calling the runProviders method and passing the path to the providers.php file.
$container = \HesamMousavi\FalconContainer\FalconContainer::getInstance();
$container->runProviders(__DIR__.'/bootstrap/providers.php');
These steps help you use service providers in your Falcon Container plugin, adding more capabilities to your project. 🚀