PHP code example of dflydev / dot-access-configuration
1. Go to this page and download the library: Download dflydev/dot-access-configuration 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/ */
dflydev / dot-access-configuration example snippets
use Dflydev\DotAccessConfiguration\YamlFileConfigurationBuilder;
$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');
$configuration = $configurationBuilder->build();
namespace MyProject;
use Dflydev\DotAccessConfiguration\Configuration;
class MyConf extends Configuration
{
public function someSpecialMethod()
{
// Whatever you want here.
}
}
namespace MyProject;
use Dflydev\DotAccessConfiguration\ConfigurationFactoryInterface;
class MyConfFactory implements ConfigurationFactoryInterface
{
/**
* {@inheritdocs}
*/
public function create()
{
return new MyConf;
}
}
use Dflydev\DotAccessConfiguration\YamlFileConfigurationBuilder;
use MyProject\MyConfFactory;
$configurationBuilder = new YamlFileConfigurationBuilder('config/config.yml');
// Inject your custom Configuration Factory
$configurationBuilder->setConfigurationFactory(new MyConfFactory);
// Will now build instances of MyConfFactory instead of
// the standard Configuration implementation.
$configuration = $configurationBuilder->build();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.