2017 © Pedro Peláez
 

custom-installer casperjs-installer

A Composer package which installs the CasperJS binary for your project.

image

jerome-breton/casperjs-installer

A Composer package which installs the CasperJS binary for your project.

  • Thursday, September 28, 2017
  • by jerome-breton
  • Repository
  • 2 Watchers
  • 3 Stars
  • 9,788 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

casperjs-installer

Latest Stable Version Total Downloads Latest Unstable Version Build Status License, (*1)

A Composer package which installs the CasperJS and PhantomJS binary (Linux, Windows, Mac) into the bin path of your project., (*2)

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., (*3)

{
    "require": {
        "jerome-breton/casperjs-installer": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "CasperJsInstaller\\Installer::install"
        ],
        "post-update-cmd": [
            "CasperJsInstaller\\Installer::install"
        ]
    }
}

For a development dependency, change require to require-dev., (*4)

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., (*5)

The download source used is: https://github.com/n1k0/casperjs/zipball/master, (*6)

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., (*7)

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., (*8)

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., (*9)

How does this work internally?

  1. 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 the CasperJsInstaller\\Installer., (*10)

  2. 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., (*11)

  3. 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 the samples., (*12)

  4. Installation into bin folder A launcher is created to declare PhantomJS path and launch CasperJS from ./vendor/jerome-breton/casperjs to your composer configured bin-dir folder., (*13)

The Versions

28/09 2017

dev-master

9999999-dev

A Composer package which installs the CasperJS binary for your project.

  Sources   Download

MIT

The Requires

 

by Jérôme Breton

phantomjs binaries headless casperjs

02/07 2015

1.1-beta3

1.1.0.0-beta3

A Composer package which installs the CasperJS binary for your project.

  Sources   Download

MIT

The Requires

 

by Jérôme Breton

phantomjs binaries headless casperjs