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

GLOB_BRACE fails on Win 7 using Xampp stack #219

Merged
merged 1 commit into from
Dec 9, 2015

Conversation

weierophinney
Copy link
Member

Using code like

return ConfigFactory::fromFiles(
glob('config/autoload/{global,local}.php', GLOB_BRACE)
);

as described in Expressive example for config/config.php does not work on a stack described in the header (see http://zend-expressive.readthedocs.org/en/stable/usage-examples/#hello-world-using-a-configuration-driven-container).

http://www.php.net/function.glob notes: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris. On my system it produces "Catchable fatal error: Argument 2 passed to Zend\Stdlib\ArrayUtils::merge() must be of the type array, integer given..."

Is there a requirement to change examples, or change Zend Config Factory::fromFiles, or change Zend Stdlib ArrayUtils::merge?

@weierophinney
Copy link
Member

Since we're already depending on zend-stdlib, I'll provide a patch shortly that uses Zend\Stdlib\Glob for this.

@weierophinney
Copy link
Member

This is already fixed on current master of zend-expressive-skeleton:

As such, the only change needed is an update to the documentation to reflect those updates.

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.
@weierophinney
Copy link
Member

@mike-a — I've converted this issue to a pull request that now contains the updated documentation.

@mike-a
Copy link
Author

mike-a commented Dec 9, 2015

Thanks for fast response!

@mike-a mike-a closed this Dec 9, 2015
@weierophinney
Copy link
Member

Reopening, as I've not merged the changes yet! 😄

@weierophinney weierophinney reopened this Dec 9, 2015
@weierophinney weierophinney merged commit a2c848e into zendframework:master Dec 9, 2015
weierophinney added a commit that referenced this pull request Dec 9, 2015
weierophinney added a commit that referenced this pull request Dec 9, 2015
weierophinney added a commit that referenced this pull request Dec 9, 2015
@weierophinney weierophinney deleted the hotfix/glob-docs branch December 9, 2015 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants