1. Go to this page and download the library: Download crodas/service-provider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$service = new \ServiceProvider\Provider(
'production.config.yml', // the configuration file
'where/services/are/defined/', // where the files are defined. It can use * comodin
'production.generated.php' // to improve things we generate code, here is where to save it
);
$db = $service->get('mysql');
$db->query("SELECT * FROM users");
$service = new \ServiceProvider\Provider(
'production.config.yml', // the configuration file
'where/services/are/defined/', // where the files are defined. It can use * comodin
'production.generated.php' // to improve things we generate code, here is where to save it
);
$events = $service->get('event_manager');
$result = $events->trigger('foo.bar', array('arg1' => 'foo'));
var_dump('this event had ' . $result->getCalls() . ' handlers');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.