Download the PHP package jerome-breton/casperjs-installer without Composer
On this page you can find all versions of the php package jerome-breton/casperjs-installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jerome-breton/casperjs-installer
More information about jerome-breton/casperjs-installer
Files in jerome-breton/casperjs-installer
Package casperjs-installer
Short Description A Composer package which installs the CasperJS binary for your project.
License MIT
Informations about the package casperjs-installer
casperjs-installer
A Composer package which installs the CasperJS and PhantomJS binary (Linux, Windows, Mac) into the bin path of your project.
Installation
To install CasperJS and PhantomJS as a local, per-project dependency to your project, simply add a dependency on
jerome-breton/casperjs-installer
to your project's composer.json
file.
For a development dependency, change require
to require-dev
.
The version number of the package specifies the CasperJS version! But for now, no versions of PhantomJS are prebuilt for 1.0. versions, so for now, only dev-master is working, and will fetch the last 1.9. PhantomJS version.
The download source used is: https://github.com/n1k0/casperjs/zipball/master
You can set the Composer configuration directive bin-dir
to change the
vendor binaries
installation folder. Important! Composer will install the binaries into vendor\bin
by default.
The scripts
section is necessary, because currently Composer does not pass events to the handler scripts of
dependencies. If you leave it away, you might execute the installer manually.
Now, assuming that the scripts section is set up as required, CasperJS and PhantomJS binary will be installed into the bin folder and updated alongside the project's Composer dependencies.
How does this work internally?
-
Fetching the CasperJS Installer In your composer.json you require the package "casperjs-installer". The package is fetched by composer and stored into
./vendor/jerome-breton/casperjs-installer
. It contains only one file theCasperJsInstaller\\Installer
. -
Fetching PhantomJS This installer depends on jakoch/phantomjs-installer to install PhantomJS and follows the same strategy. This project has been created with major part of Jakoch work. The CasperJsInstaller will call Jakoch's
PhantomJSInstaller\\Installer
. -
Platform-specific download of PhantomJS The
PhantomInstaller\\Installer
is run as a "post-install-cmd". That's why you need the "scripts" section in your "composer.json". The installer creates a new composer in-memory package "casperjs" and downloads the correct Phantom version to the folder./vendor/jerome-breton/casperjs
. All CasperJS files reside there, especially thesamples
. - Installation into bin folder
A launcher is created to declare PhantomJS path and launch CasperJS from
./vendor/jerome-breton/casperjs
to your composer configuredbin-dir
folder.