phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.83k stars 200 forks source link

Issue with using 'mksnapshot' to create snapshots #323

Closed nicknmejia closed 7 years ago

nicknmejia commented 7 years ago

Hi there, I've spent the last two days looking for more information on php v8js, specifically how to create and use snapshots, and I am still stuck at a dead end.

I read in issue #205 that I should use mksnapshot --startup_blob=custom_snapshot.bin to create them but my terminal can't find the command. I checked my v8 folder in /opt but it didn't contain anything to indicate it existed. I installed following the directions from the Linux guide if that helps.

Any information would be a huge help! Thanks in advance.

stesie commented 7 years ago

You don't need to use mksnapshot manually, but use V8Js API introduced by #207

This is, just use the static method V8Js::createSnapshot and pass it the extra JavaScript code you need