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

Warning occurs in "vfs://path/to" #2166

Closed
chihiro-adachi opened this issue Oct 6, 2016 · 2 comments
Closed

Warning occurs in "vfs://path/to" #2166

chihiro-adachi opened this issue Oct 6, 2016 · 2 comments

Comments

@chihiro-adachi
Copy link

I'm using vfsStream.
https://github.com/mikey179/vfsStream

from twig 1.26.0, php warning occurs:

Warning: file_get_contents(vfs:/twig_dir/test.twig): failed to open stream: Invalid argument in /path/to/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 131

<?php
require_once 'vendor/autoload.php';

use org\bovigo\vfs\vfsStream;

vfsStream::setup('twig_dir');
$twig_dir = vfsStream::url('twig_dir');

file_put_contents($twig_dir.'/test.twig', '<h1>test</h1>');

$loader = new \Twig_Loader_Filesystem($twig_dir);
$twig = new \Twig_Environment($loader);

echo $twig->render('test.twig');

this code, twig 1.24.2 OK, twig 1.26.0 NG

The path of the URL format(ex: vfs://path/to/test.twig) is not available, is specifications?

@fabpot
Copy link
Contributor

fabpot commented Oct 13, 2016

Can you check that #2178 fixed your issue?

fabpot added a commit that referenced this issue Oct 13, 2016
This PR was merged into the 1.x branch.

Discussion
----------

made it possible to store templates with vfsStream

closes #2166

Commits
-------

4d60758 made it possible to store templates with vfsStream
@chihiro-adachi
Copy link
Author

@fabpot
i confirmed this fix.it is ok.
thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants