Skip to content

A Composer Package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project.

License

Notifications You must be signed in to change notification settings

boedah/phantomjs-installer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phantomjs-installer

Latest Stable Version Total Downloads Build Status License

A Composer package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project.

Installation

To install PhantomJS as a local, per-project dependency to your project, simply add a dependency on jakoch/phantomjs-installer to your project's composer.json file.

{
    "require": {
        "jakoch/phantomjs-installer": "1.9.7"
    }
}

The version number of the package specifies the PhantomJS version! "dev-master" is "v1.9.7". The download source used is: https://bitbucket.org/ariya/phantomjs/downloads/

Currently Composer does not pass events to the handler scripts of dependencies. You might execute the installer a) manually or b) by adding the following additional settings to your composer.json:

{
    "scripts": {
        "post-install-cmd": [
            "PhantomInstaller\\Installer::installPhantomJS"
        ],
        "post-update-cmd": [
            "PhantomInstaller\\Installer::installPhantomJS"
        ]
    }
}

Now, assuming that the scripts section is set up as required, the PhantomJS binary will be installed into the /bin folder and updated alongside the project's Composer dependencies.

How does this work internally?

  1. Fetching the PhantomJS Installer In your composer.json you require the package "phantomjs-installer". The package is fetched by composer and stored into ./vendor/jakoch/phantomjs-installer. It contains only one file the PhantomInstaller\\Installer.

  2. 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 "phantomjs", detects your OS and downloads the correct Phantom version to the folder ./vendor/jakoch/phantomjs. All PhantomJS files reside there, especially the examples.

  3. Installation into /bin folder The binary is then copied from ./vendor/jakoch/phantomjs to your /bin folder.

About

A Composer Package which installs the PhantomJS binary (Linux, Windows, Mac) into /bin of your project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published