Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes stream wrapper functionality #19

Merged
merged 1 commit into from
Mar 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/NamespacedPathStackResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Laminas\View\Exception as ViewException;
use Laminas\View\Renderer\RendererInterface;
use Laminas\View\Resolver\TemplatePathStack;
use Laminas\View\Stream;
use SplFileInfo;
use SplStack;
use Traversable;
Expand All @@ -17,17 +16,13 @@
use function file_exists;
use function get_class;
use function gettype;
use function in_array;
use function ini_get;
use function is_array;
use function is_object;
use function is_string;
use function iterator_to_array;
use function pathinfo;
use function preg_match;
use function sprintf;
use function stream_get_wrappers;
use function stream_wrapper_register;
use function substr;

use const PATHINFO_EXTENSION;
Expand Down Expand Up @@ -58,14 +53,6 @@ class NamespacedPathStackResolver extends TemplatePathStack
*/
public function __construct(?iterable $options = null)
{
$this->useViewStream = (bool) ini_get('short_open_tag');
if ($this->useViewStream) {
if (! in_array('laminas.view', stream_get_wrappers())) {
/** @psalm-suppress DeprecatedClass */
stream_wrapper_register('laminas.view', Stream::class);
}
}

if (null !== $options) {
$this->setOptions($options);
}
Expand Down Expand Up @@ -221,11 +208,6 @@ private function getPathFromNamespace(string $template, string $namespace): ?str
}
}

/** @psalm-suppress DeprecatedMethod */
if ($this->useStreamWrapper()) {
// If using a stream wrapper, prepend the spec to the path
$filePath = 'laminas.view://' . $filePath;
}
return $filePath;
}
}
Expand Down