static::class is only since 5.5 :(

This commit is contained in:
Robin Appelman 2015-10-16 15:49:20 +02:00
commit 2e2fe951e9
3 changed files with 16 additions and 5 deletions

View file

@ -55,6 +55,6 @@ class DirectoryFilter extends DirectoryWrapper {
'filter' => $filter
)
);
return self::wrapWithOptions($options);
return self::wrapWithOptions($options, '\Icewind\Streams\DirectoryFilter');
}
}

View file

@ -75,11 +75,12 @@ class DirectoryWrapper implements Directory {
/**
* @param string $options the options for the context to wrap the stream with
* @param string $class
* @return resource
*/
protected static function wrapWithOptions($options) {
protected static function wrapWithOptions($options, $class) {
$context = stream_context_create($options);
stream_wrapper_register('dirwrapper', static::class);
stream_wrapper_register('dirwrapper', $class);
$wrapped = opendir('dirwrapper://', $context);
stream_wrapper_unregister('dirwrapper');
return $wrapped;