Fix new loader

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-03-11 22:39:35 +01:00
commit 064d01292a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -56,7 +56,6 @@ class HashWrapper extends Wrapper {
public static function wrap($source, $hash, $callback) { public static function wrap($source, $hash, $callback) {
$context = stream_context_create(array( $context = stream_context_create(array(
'hash' => array( 'hash' => array(
'source' => $source,
'hash' => $hash, 'hash' => $hash,
'callback' => $callback, 'callback' => $callback,
) )
@ -69,7 +68,7 @@ class HashWrapper extends Wrapper {
} }
public function stream_open($path, $mode, $options, &$opened_path) { public function stream_open($path, $mode, $options, &$opened_path) {
$context = $this->loadContext('callback'); $context = $this->loadContext();
$this->callback = $context['callback']; $this->callback = $context['callback'];
$this->hashContext = hash_init($context['hash']); $this->hashContext = hash_init($context['hash']);
return true; return true;