Composer and phantomjs (for PDF and Excel reports on Analytics)

Despite the directions in the google drive they don’t actually work because composer wants a composer.json file which doesn’t get created when we do: $ brew install composer. All it does is creates a composer.lock file. And then when we try to use composer to install all of our projects dependencies which it would usually get from our composer.json file (much like npm’s package.json file) it can’t find any! Well, we can just create one and copy/paste our dependencies into it and then all will, once again, be right in the world.

Install composer with brew: $ brew install composer You can check the install with: $ composer -V

create a composer.json file within project directory ( ~/Sites/project/ ): $ vim composer.json

I went into to github and copy/pasted the composer.lock contents into our new composer.lock file. (use :wq to exit vim. :D )

Now, we can run $ composer install which will go through and install all the dependencies. Now we’ll have a /bin/ directory (before we didnt). cd into it and then give phantomjs read/write priviliges with. $ chmod 777 phantomjs

go and get your reporting on.