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

Twig_Loader_String Error #84

Closed
matwils opened this issue Feb 18, 2016 · 12 comments
Closed

Twig_Loader_String Error #84

matwils opened this issue Feb 18, 2016 · 12 comments

Comments

@matwils
Copy link

matwils commented Feb 18, 2016

Hello,

I just updated my composer.json file from php-phantomjs version 3.* to version 4.* and am now getting the following error when using phantomjs:

The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead or Twig_Environment::createTemplate().

The "phantomjs.twig.string_loader" service relies on the deprecated "Twig_Loader_String" class. It should either be deprecated or its implementation upgraded.

Any help on how to fix this would be greatly appreciated.

Thanks,

Matt

@wwendorf
Copy link

I'm having the same problem. Not sure where or how to fix this. Am switching to v3 for now to see if it works under v3.

@wwendorf
Copy link

If I switch to "jonnyw/php-phantomjs": "3.*" in composer.json, I get this error:

Not quoting the scalar "@phantomjs.procedure.procedure_factory" starting with "@" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.

@jonnnnyw
Copy link
Owner

Sorry for the lateness on this, have been on holiday. Will release a fix for this in the morning (GMT).

@wwendorf
Copy link

Thanks. Can you please comment when done so I get an email on it?

I appreciate the quick fix!

Wade

@jonnnnyw
Copy link
Owner

This has been patched in v4.3.1. Let me know how you get on.

@wwendorf
Copy link

Hi Jonnnyw, I updated and it doesn't give me those errors anymore, but it is also not saving the screen capture. The bin dir is 777 permissions with the same owner as the rest of the laravel app. Any suggestions?

@wwendorf
Copy link

Running under ubuntu in a vagrant environment.

Wade

Here's my code:

` $client = Client::getInstance();
$client->getEngine()->setPath('../bin');

    $request  = $client->getMessageFactory()->createCaptureRequest(Input::get('url'));
    $response = $client->getMessageFactory()->createResponse();

    $filename = 'screenshot' . Carbon::now()->format('Y-m-d-H:i:s') . ".jpg";
    $file = '../bin/' . $filename;

    $request->setOutputFile($file);

    $client->send($request, $response);

    rename($file, 'screenshots/' . $filename);

    echo '<img src="screenshots/' . $filename . '>';`

@wwendorf
Copy link

Ok, more information:

sh: 1: ../bin: Permission denied

However, the permissions for that directory are set to 777

@jonnnnyw
Copy link
Owner

I would set your bin path to an absolute path not a relative 1

@wwendorf
Copy link

Tried that too.

@wwendorf
Copy link

I have tried setting the bin path the /usr/bin (location phantomjs was installed to with an apt-get) and /vagrant/bin

@jonnnnyw
Copy link
Owner

Closing this ticket as the original issue is fixed. Please refer to the other tickets for your additional issue.

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

No branches or pull requests

3 participants