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

Commit

Permalink
Merge branch 'hotfix/glob-docs' into develop
Browse files Browse the repository at this point in the history
Forward port #219
  • Loading branch information
weierophinney committed Dec 9, 2015
2 parents d6041e1 + 880f733 commit 4c6d334
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ All notable changes to this project will be documented in this file, in reverse

- Nothing.

## 1.0.0rc4 - TBD

Fourth release candidate.

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#219](https://github.com/zendframework/zend-expressive/pull/219) updates the
"Hello World Using a Configuration-Driven Container" usage case to use
zend-stdlib's `Glob::glob()` instead of the `glob()` native function, to
ensure the documented solution is portable across platforms.

## 1.0.0rc3 - 2015-12-07

Third release candidate.
Expand Down
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 4c6d334

Please sign in to comment.