Fixes #15302: Fixed yii\caching\DbCache so that getValues now behaves the same as getValue with regards to streams

This commit is contained in:
edwards-sj
2017-12-09 22:18:55 +00:00
committed by Alexander Makarov
parent d604d80823
commit 23630abe6d
3 changed files with 73 additions and 1 deletions

View File

@ -170,7 +170,11 @@ class DbCache extends Cache
$results[$key] = false;
}
foreach ($rows as $row) {
$results[$row['id']] = $row['data'];
if (is_resource($row['data']) && get_resource_type($row['data']) === 'stream') {
$results[$row['id']] = stream_get_contents($row['data']);
} else {
$results[$row['id']] = $row['data'];
}
}
return $results;