Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Updated usage example to use zend-stdlib Glob
Browse files Browse the repository at this point in the history
In order to demonstrate a solution that works cross-platform, we need to use
`Zend\Stdlib\Glob`. This patch alters all examples that used `glob` to use
`Zend\Stdlib\Glob::glob` instead.
  • Loading branch information
weierophinney committed Dec 8, 2015
1 parent 7fd4015 commit a2c848e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions doc/book/usage-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ repository, and also provides a mechanism for slip-streaming in
configuration based on our environment (you might use different settings in
development than in production, after all!).
First, install zend-config:
First, install zend-config and zend-stdlib:
```bash
$ composer require zendframework/zend-config
$ composer require zendframework/zend-config zendframework/zend-stdlib
```
Now we can start creating our configuration files and container factories.
Expand All @@ -269,10 +269,13 @@ In `config/config.php`, place the following:
```php
<?php
use Zend\Config\Factory as ConfigFactory;
use Zend\Stdlib\Glob;
return ConfigFactory::fromFiles(
glob('config/autoload/{global,local}.php', GLOB_BRACE)
);
$files = Glob::glob('config/autoload/{{,*.}global,{,*.}local}.php', Glob::GLOB_BRACE);
if (0 === count($files)) {
return [];
}
return ConfigFactory::fromFiles($files);
```
In `config/autoload/global.php`, place the following:
Expand All @@ -299,9 +302,10 @@ In `config/dependencies.php`, place the following:
```php
<?php
use Zend\Config\Factory as ConfigFactory;
use Zend\Stdlib\Glob;
return ConfigFactory::fromFiles(
glob('config/autoload/dependencies.{global,local}.php', GLOB_BRACE)
Glob::glob('config/autoload/dependencies.{global,local}.php', Glob::GLOB_BRACE)
);
```
Expand Down

0 comments on commit a2c848e

Please sign in to comment.