Browse Source

Documentation updates

Jonny Wenmoth 11 years ago
parent
commit
9db12ab23a

+ 2 - 2
_includes/default.html

@@ -32,7 +32,7 @@
 
 	<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.BASE_PATH }}/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -40,7 +40,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 

+ 292 - 1
_posts/2014-07-23-troubleshooting.md

@@ -6,4 +6,295 @@ tags: []
 fullview: true
 ---
 
-This documentation page will be up in the next couple of days.
+* [It's not installing anything to my bin directory](#its-not-installing-anything-to-my-bin-directory)
+* [I am getting a `InvalidExecutableException` when making a request](#i-am-getting-a-invalidexecutableexception-when-making-a-request)
+* [I am getting a `NotWritableException` when making a request](#i-am-getting-a-notwritableexception-when-making-a-request)
+* [Why do I need the `phantomloader` file?](#why-do-i-need-the-phantomloader-file)
+* [Why am I getting a status code of 0 in the response?](#why-am-i-getting-a-status-code-of-0-in-the-response)
+* [It's not saving my screenshots](#its-not-saving-my-screenshots)
+* [Can I set the screenshot size?](#can-i-set-the-screenshot-size)
+* [Can I set the viewport size?](#can-i-set-the-viewport-size)
+* [How to I debug a request?](#how-to-i-debug-a-request)
+* [I am getting `SyntaxError: Parse error` in the debug log](#i-am-getting-syntaxerror-parse-error-in-the-debug-log)
+
+---
+
+#### It's not installing anything to my bin directory
+
+When installing via composer, as outlined in the [installation guide]({{ site.BASE_PATH }}/installation.html), it is recommended that you define the location of the bin folder for your project. This can be done by adding the following to your `composer.json` file:
+
+{% highlight yaml %}
+
+    #composer.json
+
+    {
+        "config": {
+            "bin-dir": "/path/to/your/projects/bin/dir"
+        }
+    }
+{% endhighlight %}
+
+You need to make sure that this directory exists and is writable before you install your composer depedencies.
+
+Once you have defined your bin folder in your `composer.json` file, run composer install from the root of your project:
+
+{% highlight bash %}
+    
+    #bash
+    
+    $ php composer.phar install
+{% endhighlight %}
+
+This should install 2 files to your bin folder: `phantomjs` and `phantomloader`. If you do not have these 2 files in your bin folder then check that the folder is writable and run composer install again.
+
+> #### Note
+> If you do not define a bin directory in your `composer.json` file then the default install location will be `vendor/bin/`. If you choose to not set a bin folder path then you will need to make sure that this path is set in the client by calling `$client->setBinDir('vendor/bin');` before making a request.
+
+#### I am getting a `InvalidExecutableException` when making a request
+
+If you have installed via composer, as outlined in the [installation guide]({{ site.BASE_PATH }}/installation.html), then you should have 2 files installed in either the `bin` or `vendor/bin/` directory, in the root of your project. These files are called `phantomjs` and `phantomloader`. 
+
+Check that these files exist and are executable by your application. If they do not exist, see [It's not installing anything to my bin directory](#its-not-installing-anything-to-my-bin-directory).
+
+If the PHP PhantomJS library cannot locate either of these files then it will throw a `InvalidExecutableException`. The message in the exception should tell you which one it can't execute. If both of these files exist and they are executable by your application, you may need to set the path to the directory that these files live in before making a request:
+
+{% highlight php %}
+        
+    <?php 
+    
+    use JonnyW\PhantomJs\Client;
+
+    $client = Client::getInstance();
+    $client->setBinDir('/path/to/bin/dir');
+{% endhighlight %}
+
+#### I am getting a `NotWritableException` when making a request
+
+When making a request, the PHP PhantomJS library compiles a temporary script file to your system's tmp folder. The location of this folder is determined through the use of the `sys_get_temp_dir()` function. If this directory is not writable by your application then you will receive this exception.
+
+#### Why do I need the `phantomloader` file?
+
+A proxy loader file is used get around a quirk that PhantomJS has when it encounters a syntax error in a script file. By default, if PhantomJS encounters a syntax error when loading a script file it will not exit execution. This means that PHP PhantomJS will continue to wait for a response from PhantomJS until PHP reaches its script execution timeout period. This also means you won't get any debug information informing you that the PhantomJS script has a syntax error.
+
+To get around this, script files are loaded through a loader script. This handles the event of a syntax error and ensures that PhantomJS exits when an error is encountered.
+
+The `phantomloader` file is required in order for the PHP PhantomJS library to run so please make sure that it was installed to your bin folder and is readable by your application.
+
+Another reason for getting this exception is when you are trying to save screenshots. See [It's not saving my screenshots](#its-not-saving-my-screenshots).
+
+#### Why am I getting a status code of 0 in the response?
+
+A status code of 0 in the response object generally means the request did not complete successfully. This could mean that the URL you are requesting did not return a response or that something happened when making the request that did not raise an error in the PHP PhantomJS library.
+
+Becuase and exception was not thrown, chances are the issue is with PhantomJS itself or at the endpoint you are calling.
+
+One possible reason for this is that your request has timed out before a response was returned from the endpoint that you are requesting. Depending on what you are requesting, some websites seem to take a while to return a response. An example of this is [myspace.com](https://myspace.com/) which, at the time of writing this, takes a considerable amount of time resolve through PhantomJS.
+
+To work around this you can try increasing the timeout period in the PHP PhantomJS client:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+    
+    $timeout = 20000; // 20 seconds
+    
+    $request->setTimeout($timeout);
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
+If you are still having a problem then you should enable debugging, before you make the request, and check the debug log. This contains a dump of information from PhantomJS which could help to track down why you are not getting a response.
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    $client->debug(true); // Set debug flag
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+        
+    $client->send($request, $response);
+    
+    echo $client->getLog(); // Output log
+{% endhighlight %}
+
+You can also try running a test script through your PhantomJS executable, from the command line, to see if you get a valid response back. Save the following script somewhere:
+
+{% highlight javascript %}
+
+    //test-script.js
+
+    var page = require('webpage').create(),
+        url = 'YOUR REQUEST URL', // Change this to the URL you want to request
+        response; 
+
+    page.onResourceReceived = function (r) {
+        response = r;
+    };
+
+    phantom.onError = function(msg, trace) {
+  
+        console.log(msg);
+        console.log(trace);
+        phantom.exit(1);
+    };
+ 
+    page.open (url, 'GET', '', function (status) {
+        
+        console.log(status);
+        console.log(JSON.stringify(response));
+        phantom.exit();
+    });
+{% endhighlight %}
+
+And then, assuming you have saved the script above to `test-script.js` in the root of your project and your PhantomJS executable is located at `bin/phantomjs`, run the following:
+
+{% highlight bash %}
+
+    #bash
+
+    $ bin/phantomjs ./test-script.js
+{% endhighlight %}
+
+You should see an output of the response from PhantomJS:
+
+{% highlight bash %}
+
+    #bash
+
+    success
+    {"contentType":"text/javascript; charset=UTF-8", "headers": ...
+{% endhighlight %}
+
+If you don't see `success` followed by a JSON encoded response object then there is something the with the URL you are requesting or your PhantomJS executable. Try reinstalling PhantomJS. If you see `fail` instead of `success`, chances are the URL you are requesting is invalid or not resolving.
+
+#### It's not saving my screenshots
+
+When making a capture request you need to make sure that you are setting the file location that you want the screenshot saved to, including the filename:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createCaptureRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+    
+    $file = '/path/to/save/your/screen/capture/file.jpg';
+    
+    $request->setCaptureFile($file); // Set the capture file
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
+The file itself does not need to exist but the parent directory must exist and be writable by your application. Check that your application has permissions to write files to the directory you are setting for your screen captures.
+
+#### Can I set the screenshot size?
+
+Yes, you can set the width and height of your capture along with the x and y coordinates of where the capture should start from:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createCaptureRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+    
+    $file = '/path/to/save/your/screen/capture/file.jpg';
+    
+    $top    = 10;
+    $left   = 10;
+    $width  = 200;
+    $height = 400;
+    
+    $request->setCaptureFile($file);
+    $request->setCaptureDimensions($width, $height, $top, $left);
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
+
+#### Can I set the viewport size?
+
+
+Yes, you can set the viewport dimensions on both regular and capture requests:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+        
+    $width  = 200;
+    $height = 400;
+    
+    $request->setViewportSize($width, $height); // Set viewport size
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
+#### How to I debug a request?
+
+By setting the debug flag to `true` on the client, you can get a dump of information output from PhantomJS along with some info events added by the PHP PhantomJS library:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    $client->debug(true); // Set debug flag
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+        
+    $client->send($request, $response);
+    
+    echo $client->getLog(); // Output log
+{% endhighlight %}
+
+You can also get any javacript console errors along with a stack trace from the URL you are calling, in the response object:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+        
+    $client->send($request, $response);
+    
+    var_dump($response->getConsole()); // Outputs array of console errors and stack trace
+{% endhighlight %}
+
+#### I am getting `SyntaxError: Parse error` in the debug log
+
+You will only get this error if the script file that is being run by PhantomJS has a syntax error. If you are writing your own [custom scripts]({{ site.BASE_PATH }}/advanced.html#custom-phantomjs-scripts) then try setting the [debug flag](#how-to-i-debug-a-request) which *should* print some more detailed information in the debug log. Also check that you aren't setting any parameters to `null` in your request object as this could be causing a javascript error due to javascript variables being set to nothing e.g. `var width = ,`.

+ 2 - 0
_posts/2014-07-25-advanced.md

@@ -12,6 +12,8 @@ fullview: true
   * [Using custom request parameters in your script](#using-custom-request-parameters-in-your-script)
   * [Loading your script](#loading-your-script)
 
+---
+
 PhantomJS command line options
 ------------------------------
 

+ 28 - 1
_posts/2014-07-26-usage.md

@@ -13,12 +13,15 @@ This page contains some common examples of how to use the PHP PhantomJS library.
 * [Other Request Methods](#other-request-methods)
 * [Response Data](#response-data)
 * [Screen Captures](#screen-captures)
+* [Set Viewport Size](#set-viewport-size)
 * [Custom Timeout](#custom-timeout)
 * [Delay Page Render](#delay-page-render)
 * [Custom Run Options](#custom-run-options)
 
 For more advanced customization or to load your own PhantomJS scripts, see the [advanced]({{ site.BASE_PATH }}/advanced.html) documentation.
 
+---
+
 Basic Request
 -------------
 
@@ -150,7 +153,7 @@ A standard response gives you access to the following interface:
 | isRedirect()        | Will return true if the response was a redirect or false otherwise.                       | Boolean        |
 | getConsole()        | Returns an array of any javascript errors on the requested page along with a stack trace. | Array          |
 
-If the response contains a status code of 0, chances are the request failed. Check the request [debug log]({{ site.BASE_PATH }}/troubleshooting.html#debugging) for more detailed information about what may have gone wrong.
+If the response contains a status code of 0, chances are the request failed. Check the request [debug log]({{ site.BASE_PATH }}/troubleshooting.html#how-to-i-debug-a-request) for more detailed information about what may have gone wrong.
 
 Screen Captures
 ---------------
@@ -203,6 +206,30 @@ You can also set the width, height, x and y axis for your screen capture:
     $client->send($request, $response);
 {% endhighlight %}
 
+Set Viewport Size
+-----------------
+
+You can easily set the viewport size for a request:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+        
+    $width  = 200;
+    $height = 400;
+    
+    $request->setViewportSize($width, $height);
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
 Custom Timeout
 --------------
 

+ 2 - 0
_posts/2014-07-27-installation.md

@@ -11,6 +11,8 @@ fullview: true
 * [Custom Installation](#custom-installation)
 * [Installing from tarball](#installing-from-tarball)
 
+---
+
 Prerequisites
 -------------
 

+ 1 - 0
_posts/2014-07-28-introduction.md

@@ -18,6 +18,7 @@ Feature List
 *  View javascript console errors
 *  View detailed PhantomJS debuged information
 *  Save screen captures to local disk
+*  Set viewport size
 *  Define screen capture x, y, width and height parameters
 *  Delay page rendering for a specified time
 *  Execute PhantomJS with command line options

+ 25 - 25
_site/404.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -198,9 +198,9 @@
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 30 - 28
_site/advanced.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -157,6 +157,8 @@
   </li>
 </ul>
 
+<hr />
+
 <h2 id="phantomjs-command-line-options">PhantomJS command line options</h2>
 
 <p>The PhantomJS API contains a range of command line options that can be passed when executing the PhantomJS executable. These can also be passed in via the client before a request:</p>
@@ -472,7 +474,7 @@
   <p>If you find that your script isn’t running or that you are receiving a status of ‘0’ back in the response, chances are you have a syntax error in you script. It pays to turn debugging on in the client <code>$client-&gt;debug(true)</code> which will then give you access to some log information through <code>$client-&gt;getLog()</code>.</p>
 </blockquote>
 
-<p>See more detailed information about <a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">troubleshooting</a>.</p>
+<p>See more detailed information about <a href="/troubleshooting.html">troubleshooting</a>.</p>
 
 	  </div>
 
@@ -483,10 +485,10 @@
     <hr>
     <ul class="pager">
         
-        <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html" title="Usage">&larr; Usage</a></li>
+        <li class="previous"><a href="/usage.html" title="Usage">&larr; Usage</a></li>
         
         
-        <li class="next"><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html" title="Troubleshooting">Troubleshooting &rarr;</a></li>
+        <li class="next"><a href="/troubleshooting.html" title="Troubleshooting">Troubleshooting &rarr;</a></li>
         
     </ul>
 
@@ -505,9 +507,9 @@
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 4 - 0
_site/assets/css/style.css

@@ -97,6 +97,10 @@ article{
 	margin-bottom: 20px;
 }
 
+.article_body ul {
+    margin-bottom: 30px;
+}
+
 .post-date {
 	text-transform: uppercase;
 	font-size: 14px;

+ 300 - 18
_site/feed.xml

@@ -3,8 +3,8 @@
 	<channel>
 		<title>PHP PhantomJs</title>
 		<description>Run PhantomJS scripts through PHP</description>
-		<link>http://jonnnnyw.github.io/php-phantomjs/</link>
-		<atom:link href="http://jonnnnyw.github.io/php-phantomjs/feed.xml" rel="self" type="application/rss+xml" />
+		<link>/</link>
+		<atom:link href="/feed.xml" rel="self" type="application/rss+xml" />
 		
 			<item>
 				<title>Introduction</title>
@@ -20,6 +20,7 @@ code etc.&lt;/li&gt;
   &lt;li&gt;View javascript console errors&lt;/li&gt;
   &lt;li&gt;View detailed PhantomJS debuged information&lt;/li&gt;
   &lt;li&gt;Save screen captures to local disk&lt;/li&gt;
+  &lt;li&gt;Set viewport size&lt;/li&gt;
   &lt;li&gt;Define screen capture x, y, width and height parameters&lt;/li&gt;
   &lt;li&gt;Delay page rendering for a specified time&lt;/li&gt;
   &lt;li&gt;Execute PhantomJS with command line options&lt;/li&gt;
@@ -59,7 +60,7 @@ code etc.&lt;/li&gt;
     
     &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;composer require &lt;span class=&quot;s2&quot;&gt;&amp;quot;jonnyw/php-phantomjs:3.*&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 
-&lt;p&gt;If you would like to use another installation method or would like to see more detailed installation instructions, see the &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/installation.html&quot;&gt;installation&lt;/a&gt; documentation.&lt;/p&gt;
+&lt;p&gt;If you would like to use another installation method or would like to see more detailed installation instructions, see the &lt;a href=&quot;/installation.html&quot;&gt;installation&lt;/a&gt; documentation.&lt;/p&gt;
 
 &lt;h2 id=&quot;basic-usage&quot;&gt;Basic Usage&lt;/h2&gt;
 
@@ -112,12 +113,12 @@ code etc.&lt;/li&gt;
     &lt;span class=&quot;c1&quot;&gt;// Send the request&lt;/span&gt;
     &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 
-&lt;p&gt;For more detailed examples see the &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/usage.html&quot;&gt;usage&lt;/a&gt; section, or to create your own custom scripts check out the &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/advanced.html&quot;&gt;advanced&lt;/a&gt; documentation.&lt;/p&gt;
+&lt;p&gt;For more detailed examples see the &lt;a href=&quot;/usage.html&quot;&gt;usage&lt;/a&gt; section, or to create your own custom scripts check out the &lt;a href=&quot;/advanced.html&quot;&gt;advanced&lt;/a&gt; documentation.&lt;/p&gt;
 
 </description>
 				<pubDate>Mon, 28 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/introduction.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/introduction.html</guid>
+				<link>/introduction.html</link>
+				<guid isPermaLink="true">/introduction.html</guid>
 			</item>
 		
 			<item>
@@ -129,6 +130,8 @@ code etc.&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#installing-from-tarball&quot;&gt;Installing from tarball&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 
+&lt;hr /&gt;
+
 &lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
 
 &lt;p&gt;PHP PhantomJS requires PHP &lt;strong&gt;5.3.0&lt;/strong&gt; or greater to run.&lt;/p&gt;
@@ -235,8 +238,8 @@ code etc.&lt;/li&gt;
 &lt;p&gt;Make sure the components are in your include path and that the PhantomJS executable is installed to your projects bin folder as mentioned in the &lt;a href=&quot;#custom-installation&quot;&gt;Custom Installation&lt;/a&gt; section.&lt;/p&gt;
 </description>
 				<pubDate>Sun, 27 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/installation.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/installation.html</guid>
+				<link>/installation.html</link>
+				<guid isPermaLink="true">/installation.html</guid>
 			</item>
 		
 			<item>
@@ -249,12 +252,15 @@ code etc.&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#other-request-methods&quot;&gt;Other Request Methods&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#response-data&quot;&gt;Response Data&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#screen-captures&quot;&gt;Screen Captures&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#set-viewport-size&quot;&gt;Set Viewport Size&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#custom-timeout&quot;&gt;Custom Timeout&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#delay-page-render&quot;&gt;Delay Page Render&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href=&quot;#custom-run-options&quot;&gt;Custom Run Options&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 
-&lt;p&gt;For more advanced customization or to load your own PhantomJS scripts, see the &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/advanced.html&quot;&gt;advanced&lt;/a&gt; documentation.&lt;/p&gt;
+&lt;p&gt;For more advanced customization or to load your own PhantomJS scripts, see the &lt;a href=&quot;/advanced.html&quot;&gt;advanced&lt;/a&gt; documentation.&lt;/p&gt;
+
+&lt;hr /&gt;
 
 &lt;h2 id=&quot;basic-request&quot;&gt;Basic Request&lt;/h2&gt;
 
@@ -415,7 +421,7 @@ code etc.&lt;/li&gt;
   &lt;/tbody&gt;
 &lt;/table&gt;
 
-&lt;p&gt;If the response contains a status code of 0, chances are the request failed. Check the request &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html#debugging&quot;&gt;debug log&lt;/a&gt; for more detailed information about what may have gone wrong.&lt;/p&gt;
+&lt;p&gt;If the response contains a status code of 0, chances are the request failed. Check the request &lt;a href=&quot;/troubleshooting.html#how-to-i-debug-a-request&quot;&gt;debug log&lt;/a&gt; for more detailed information about what may have gone wrong.&lt;/p&gt;
 
 &lt;h2 id=&quot;screen-captures&quot;&gt;Screen Captures&lt;/h2&gt;
 
@@ -461,6 +467,26 @@ code etc.&lt;/li&gt;
     
     &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 
+&lt;h2 id=&quot;set-viewport-size&quot;&gt;Set Viewport Size&lt;/h2&gt;
+
+&lt;p&gt;You can easily set the viewport size for a request:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+        
+    &lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setViewportSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
 &lt;h2 id=&quot;custom-timeout&quot;&gt;Custom Timeout&lt;/h2&gt;
 
 &lt;p&gt;By default, each request will timeout after 5 seconds. You can set a custom timeout period (in milliseconds) for each request:&lt;/p&gt;
@@ -535,8 +561,8 @@ code etc.&lt;/li&gt;
 &lt;p&gt;See the &lt;a href=&quot;http://phantomjs.org/api/command-line.html&quot;&gt;PhantomJS Documentation&lt;/a&gt; for a full list of command line options.&lt;/p&gt;
 </description>
 				<pubDate>Sat, 26 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/usage.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/usage.html</guid>
+				<link>/usage.html</link>
+				<guid isPermaLink="true">/usage.html</guid>
 			</item>
 		
 			<item>
@@ -552,6 +578,8 @@ code etc.&lt;/li&gt;
   &lt;/li&gt;
 &lt;/ul&gt;
 
+&lt;hr /&gt;
+
 &lt;h2 id=&quot;phantomjs-command-line-options&quot;&gt;PhantomJS command line options&lt;/h2&gt;
 
 &lt;p&gt;The PhantomJS API contains a range of command line options that can be passed when executing the PhantomJS executable. These can also be passed in via the client before a request:&lt;/p&gt;
@@ -867,20 +895,274 @@ code etc.&lt;/li&gt;
   &lt;p&gt;If you find that your script isn’t running or that you are receiving a status of ‘0’ back in the response, chances are you have a syntax error in you script. It pays to turn debugging on in the client &lt;code&gt;$client-&amp;gt;debug(true)&lt;/code&gt; which will then give you access to some log information through &lt;code&gt;$client-&amp;gt;getLog()&lt;/code&gt;.&lt;/p&gt;
 &lt;/blockquote&gt;
 
-&lt;p&gt;See more detailed information about &lt;a href=&quot;http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html&quot;&gt;troubleshooting&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;See more detailed information about &lt;a href=&quot;/troubleshooting.html&quot;&gt;troubleshooting&lt;/a&gt;.&lt;/p&gt;
 </description>
 				<pubDate>Fri, 25 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/advanced.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/advanced.html</guid>
+				<link>/advanced.html</link>
+				<guid isPermaLink="true">/advanced.html</guid>
 			</item>
 		
 			<item>
 				<title>Troubleshooting</title>
-				<description>&lt;p&gt;This documentation page will be up in the next couple of days.&lt;/p&gt;
+				<description>&lt;ul&gt;
+  &lt;li&gt;&lt;a href=&quot;#its-not-installing-anything-to-my-bin-directory&quot;&gt;It’s not installing anything to my bin directory&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#i-am-getting-a-invalidexecutableexception-when-making-a-request&quot;&gt;I am getting a &lt;code&gt;InvalidExecutableException&lt;/code&gt; when making a request&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#i-am-getting-a-notwritableexception-when-making-a-request&quot;&gt;I am getting a &lt;code&gt;NotWritableException&lt;/code&gt; when making a request&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#why-do-i-need-the-phantomloader-file&quot;&gt;Why do I need the &lt;code&gt;phantomloader&lt;/code&gt; file?&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#why-am-i-getting-a-status-code-of-0-in-the-response&quot;&gt;Why am I getting a status code of 0 in the response?&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#its-not-saving-my-screenshots&quot;&gt;It’s not saving my screenshots&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#can-i-set-the-screenshot-size&quot;&gt;Can I set the screenshot size?&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#can-i-set-the-viewport-size&quot;&gt;Can I set the viewport size?&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#how-to-i-debug-a-request&quot;&gt;How to I debug a request?&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#i-am-getting-syntaxerror-parse-error-in-the-debug-log&quot;&gt;I am getting &lt;code&gt;SyntaxError: Parse error&lt;/code&gt; in the debug log&lt;/a&gt;&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;hr /&gt;
+
+&lt;h4 id=&quot;its-not-installing-anything-to-my-bin-directory&quot;&gt;It’s not installing anything to my bin directory&lt;/h4&gt;
+
+&lt;p&gt;When installing via composer, as outlined in the &lt;a href=&quot;/installation.html&quot;&gt;installation guide&lt;/a&gt;, it is recommended that you define the location of the bin folder for your project. This can be done by adding the following to your &lt;code&gt;composer.json&lt;/code&gt; file:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#composer.json&lt;/span&gt;
+
+    &lt;span class=&quot;p-Indicator&quot;&gt;{&lt;/span&gt;
+        &lt;span class=&quot;s&quot;&gt;&amp;quot;config&amp;quot;&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p-Indicator&quot;&gt;{&lt;/span&gt;
+            &lt;span class=&quot;s&quot;&gt;&amp;quot;bin-dir&amp;quot;&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/path/to/your/projects/bin/dir&amp;quot;&lt;/span&gt;
+        &lt;span class=&quot;p-Indicator&quot;&gt;}&lt;/span&gt;
+    &lt;span class=&quot;p-Indicator&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;You need to make sure that this directory exists and is writable before you install your composer depedencies.&lt;/p&gt;
+
+&lt;p&gt;Once you have defined your bin folder in your &lt;code&gt;composer.json&lt;/code&gt; file, run composer install from the root of your project:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#bash&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;php composer.phar install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;This should install 2 files to your bin folder: &lt;code&gt;phantomjs&lt;/code&gt; and &lt;code&gt;phantomloader&lt;/code&gt;. If you do not have these 2 files in your bin folder then check that the folder is writable and run composer install again.&lt;/p&gt;
+
+&lt;blockquote&gt;
+  &lt;h4 id=&quot;note&quot;&gt;Note&lt;/h4&gt;
+  &lt;p&gt;If you do not define a bin directory in your &lt;code&gt;composer.json&lt;/code&gt; file then the default install location will be &lt;code&gt;vendor/bin/&lt;/code&gt;. If you choose to not set a bin folder path then you will need to make sure that this path is set in the client by calling &lt;code&gt;$client-&amp;gt;setBinDir(&#39;vendor/bin&#39;);&lt;/code&gt; before making a request.&lt;/p&gt;
+&lt;/blockquote&gt;
+
+&lt;h4 id=&quot;i-am-getting-a-invalidexecutableexception-when-making-a-request&quot;&gt;I am getting a &lt;code&gt;InvalidExecutableException&lt;/code&gt; when making a request&lt;/h4&gt;
+
+&lt;p&gt;If you have installed via composer, as outlined in the &lt;a href=&quot;/installation.html&quot;&gt;installation guide&lt;/a&gt;, then you should have 2 files installed in either the &lt;code&gt;bin&lt;/code&gt; or &lt;code&gt;vendor/bin/&lt;/code&gt; directory, in the root of your project. These files are called &lt;code&gt;phantomjs&lt;/code&gt; and &lt;code&gt;phantomloader&lt;/code&gt;. &lt;/p&gt;
+
+&lt;p&gt;Check that these files exist and are executable by your application. If they do not exist, see &lt;a href=&quot;#its-not-installing-anything-to-my-bin-directory&quot;&gt;It’s not installing anything to my bin directory&lt;/a&gt;.&lt;/p&gt;
+
+&lt;p&gt;If the PHP PhantomJS library cannot locate either of these files then it will throw a &lt;code&gt;InvalidExecutableException&lt;/code&gt;. The message in the exception should tell you which one it can’t execute. If both of these files exist and they are executable by your application, you may need to set the path to the directory that these files live in before making a request:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt; 
+    
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setBinDir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/path/to/bin/dir&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h4 id=&quot;i-am-getting-a-notwritableexception-when-making-a-request&quot;&gt;I am getting a &lt;code&gt;NotWritableException&lt;/code&gt; when making a request&lt;/h4&gt;
+
+&lt;p&gt;When making a request, the PHP PhantomJS library compiles a temporary script file to your system’s tmp folder. The location of this folder is determined through the use of the &lt;code&gt;sys_get_temp_dir()&lt;/code&gt; function. If this directory is not writable by your application then you will receive this exception.&lt;/p&gt;
+
+&lt;h4 id=&quot;why-do-i-need-the-phantomloader-file&quot;&gt;Why do I need the &lt;code&gt;phantomloader&lt;/code&gt; file?&lt;/h4&gt;
+
+&lt;p&gt;A proxy loader file is used get around a quirk that PhantomJS has when it encounters a syntax error in a script file. By default, if PhantomJS encounters a syntax error when loading a script file it will not exit execution. This means that PHP PhantomJS will continue to wait for a response from PhantomJS until PHP reaches its script execution timeout period. This also means you won’t get any debug information informing you that the PhantomJS script has a syntax error.&lt;/p&gt;
+
+&lt;p&gt;To get around this, script files are loaded through a loader script. This handles the event of a syntax error and ensures that PhantomJS exits when an error is encountered.&lt;/p&gt;
+
+&lt;p&gt;The &lt;code&gt;phantomloader&lt;/code&gt; file is required in order for the PHP PhantomJS library to run so please make sure that it was installed to your bin folder and is readable by your application.&lt;/p&gt;
+
+&lt;p&gt;Another reason for getting this exception is when you are trying to save screenshots. See &lt;a href=&quot;#its-not-saving-my-screenshots&quot;&gt;It’s not saving my screenshots&lt;/a&gt;.&lt;/p&gt;
+
+&lt;h4 id=&quot;why-am-i-getting-a-status-code-of-0-in-the-response&quot;&gt;Why am I getting a status code of 0 in the response?&lt;/h4&gt;
+
+&lt;p&gt;A status code of 0 in the response object generally means the request did not complete successfully. This could mean that the URL you are requesting did not return a response or that something happened when making the request that did not raise an error in the PHP PhantomJS library.&lt;/p&gt;
+
+&lt;p&gt;Becuase and exception was not thrown, chances are the issue is with PhantomJS itself or at the endpoint you are calling.&lt;/p&gt;
+
+&lt;p&gt;One possible reason for this is that your request has timed out before a response was returned from the endpoint that you are requesting. Depending on what you are requesting, some websites seem to take a while to return a response. An example of this is &lt;a href=&quot;https://myspace.com/&quot;&gt;myspace.com&lt;/a&gt; which, at the time of writing this, takes a considerable amount of time resolve through PhantomJS.&lt;/p&gt;
+
+&lt;p&gt;To work around this you can try increasing the timeout period in the PHP PhantomJS client:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$timeout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;20000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 20 seconds&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$timeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;If you are still having a problem then you should enable debugging, before you make the request, and check the debug log. This contains a dump of information from PhantomJS which could help to track down why you are not getting a response.&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Set debug flag&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+        
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getLog&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Output log&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;You can also try running a test script through your PhantomJS executable, from the command line, to see if you get a valid response back. Save the following script somewhere:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//test-script.js&lt;/span&gt;
+
+    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;webpage&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;YOUR REQUEST URL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Change this to the URL you want to request&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
+
+    &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onResourceReceived&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
+
+    &lt;span class=&quot;nx&quot;&gt;phantom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onError&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;trace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
+  
+        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;trace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;phantom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
+ 
+    &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;GET&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
+        
+        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
+        &lt;span class=&quot;nx&quot;&gt;phantom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;And then, assuming you have saved the script above to &lt;code&gt;test-script.js&lt;/code&gt; in the root of your project and your PhantomJS executable is located at &lt;code&gt;bin/phantomjs&lt;/code&gt;, run the following:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#bash&lt;/span&gt;
+
+    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bin/phantomjs ./test-script.js&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;You should see an output of the response from PhantomJS:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#bash&lt;/span&gt;
+
+    success
+    &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;contentType&amp;quot;&lt;/span&gt;:&lt;span class=&quot;s2&quot;&gt;&amp;quot;text/javascript; charset=UTF-8&amp;quot;&lt;/span&gt;, &lt;span class=&quot;s2&quot;&gt;&amp;quot;headers&amp;quot;&lt;/span&gt;: ...&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;If you don’t see &lt;code&gt;success&lt;/code&gt; followed by a JSON encoded response object then there is something the with the URL you are requesting or your PhantomJS executable. Try reinstalling PhantomJS. If you see &lt;code&gt;fail&lt;/code&gt; instead of &lt;code&gt;success&lt;/code&gt;, chances are the URL you are requesting is invalid or not resolving.&lt;/p&gt;
+
+&lt;h4 id=&quot;its-not-saving-my-screenshots&quot;&gt;It’s not saving my screenshots&lt;/h4&gt;
+
+&lt;p&gt;When making a capture request you need to make sure that you are setting the file location that you want the screenshot saved to, including the filename:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createCaptureRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$file&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/path/to/save/your/screen/capture/file.jpg&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setCaptureFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Set the capture file&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;The file itself does not need to exist but the parent directory must exist and be writable by your application. Check that your application has permissions to write files to the directory you are setting for your screen captures.&lt;/p&gt;
+
+&lt;h4 id=&quot;can-i-set-the-screenshot-size&quot;&gt;Can I set the screenshot size?&lt;/h4&gt;
+
+&lt;p&gt;Yes, you can set the width and height of your capture along with the x and y coordinates of where the capture should start from:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createCaptureRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$file&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/path/to/save/your/screen/capture/file.jpg&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$top&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$left&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setCaptureFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setCaptureDimensions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h4 id=&quot;can-i-set-the-viewport-size&quot;&gt;Can I set the viewport size?&lt;/h4&gt;
+
+&lt;p&gt;Yes, you can set the viewport dimensions on both regular and capture requests:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+        
+    &lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setViewportSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Set viewport size&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h4 id=&quot;how-to-i-debug-a-request&quot;&gt;How to I debug a request?&lt;/h4&gt;
+
+&lt;p&gt;By setting the debug flag to &lt;code&gt;true&lt;/code&gt; on the client, you can get a dump of information output from PhantomJS along with some info events added by the PHP PhantomJS library:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Set debug flag&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+        
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getLog&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Output log&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;You can also get any javacript console errors along with a stack trace from the URL you are calling, in the response object:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
+
+    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createRequest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://google.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessageFactory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createResponse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
+        
+    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;nb&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getConsole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Outputs array of console errors and stack trace&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h4 id=&quot;i-am-getting-syntaxerror-parse-error-in-the-debug-log&quot;&gt;I am getting &lt;code&gt;SyntaxError: Parse error&lt;/code&gt; in the debug log&lt;/h4&gt;
+
+&lt;p&gt;You will only get this error if the script file that is being run by PhantomJS has a syntax error. If you are writing your own &lt;a href=&quot;/advanced.html#custom-phantomjs-scripts&quot;&gt;custom scripts&lt;/a&gt; then try setting the &lt;a href=&quot;#how-to-i-debug-a-request&quot;&gt;debug flag&lt;/a&gt; which &lt;em&gt;should&lt;/em&gt; print some more detailed information in the debug log. Also check that you aren’t setting any parameters to &lt;code&gt;null&lt;/code&gt; in your request object as this could be causing a javascript error due to javascript variables being set to nothing e.g. &lt;code&gt;var width = ,&lt;/code&gt;.&lt;/p&gt;
 </description>
 				<pubDate>Wed, 23 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html</guid>
+				<link>/troubleshooting.html</link>
+				<guid isPermaLink="true">/troubleshooting.html</guid>
 			</item>
 		
 	</channel>

+ 29 - 28
_site/index.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -160,6 +160,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -199,7 +200,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -252,7 +253,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
     
@@ -264,7 +265,7 @@ code etc.</li>
   <ul class="pager"> 
       
       <li class="next">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a>
+        <a href="/installation.html" title="Installation">Installation &rarr;</a>
       </li>
       
   </ul>
@@ -284,9 +285,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 27
_site/installation.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -153,6 +153,8 @@
   <li><a href="#installing-from-tarball">Installing from tarball</a></li>
 </ul>
 
+<hr />
+
 <h2 id="prerequisites">Prerequisites</h2>
 
 <p>PHP PhantomJS requires PHP <strong>5.3.0</strong> or greater to run.</p>
@@ -267,10 +269,10 @@
     <hr>
     <ul class="pager">
         
-        <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/introduction.html" title="Introduction">&larr; Introduction</a></li>
+        <li class="previous"><a href="/introduction.html" title="Introduction">&larr; Introduction</a></li>
         
         
-        <li class="next"><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html" title="Usage">Usage &rarr;</a></li>
+        <li class="next"><a href="/usage.html" title="Usage">Usage &rarr;</a></li>
         
     </ul>
 
@@ -289,9 +291,9 @@
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 28
_site/introduction.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -158,6 +158,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -197,7 +198,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -250,7 +251,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
 	  </div>
@@ -263,7 +264,7 @@ code etc.</li>
     <ul class="pager">
         
         
-        <li class="next"><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a></li>
+        <li class="next"><a href="/installation.html" title="Installation">Installation &rarr;</a></li>
         
     </ul>
 
@@ -282,9 +283,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 28
_site/page2/index.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -160,6 +160,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -199,7 +200,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -252,7 +253,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
     
@@ -264,7 +265,7 @@ code etc.</li>
   <ul class="pager"> 
       
       <li class="next">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a>
+        <a href="/installation.html" title="Installation">Installation &rarr;</a>
       </li>
       
   </ul>
@@ -284,9 +285,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 28
_site/page3/index.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -160,6 +160,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -199,7 +200,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -252,7 +253,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
     
@@ -264,7 +265,7 @@ code etc.</li>
   <ul class="pager"> 
       
       <li class="next">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a>
+        <a href="/installation.html" title="Installation">Installation &rarr;</a>
       </li>
       
   </ul>
@@ -284,9 +285,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 28
_site/page4/index.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -160,6 +160,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -199,7 +200,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -252,7 +253,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
     
@@ -264,7 +265,7 @@ code etc.</li>
   <ul class="pager"> 
       
       <li class="next">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a>
+        <a href="/installation.html" title="Installation">Installation &rarr;</a>
       </li>
       
   </ul>
@@ -284,9 +285,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 29 - 28
_site/page5/index.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -160,6 +160,7 @@ code etc.</li>
   <li>View javascript console errors</li>
   <li>View detailed PhantomJS debuged information</li>
   <li>Save screen captures to local disk</li>
+  <li>Set viewport size</li>
   <li>Define screen capture x, y, width and height parameters</li>
   <li>Delay page rendering for a specified time</li>
   <li>Execute PhantomJS with command line options</li>
@@ -199,7 +200,7 @@ code etc.</li>
     
     <span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
 
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
+<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/installation.html">installation</a> documentation.</p>
 
 <h2 id="basic-usage">Basic Usage</h2>
 
@@ -252,7 +253,7 @@ code etc.</li>
     <span class="c1">// Send the request</span>
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
-<p>For more detailed examples see the <a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more detailed examples see the <a href="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
 
 
     
@@ -264,7 +265,7 @@ code etc.</li>
   <ul class="pager"> 
       
       <li class="next">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">Installation &rarr;</a>
+        <a href="/installation.html" title="Installation">Installation &rarr;</a>
       </li>
       
   </ul>
@@ -284,9 +285,9 @@ code etc.</li>
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 281 - 27
_site/troubleshooting.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -146,7 +146,261 @@
 	<div class="col-sm-10">
 	
 	  <div class="article_body">
-	  <p>This documentation page will be up in the next couple of days.</p>
+	  <ul>
+  <li><a href="#its-not-installing-anything-to-my-bin-directory">It’s not installing anything to my bin directory</a></li>
+  <li><a href="#i-am-getting-a-invalidexecutableexception-when-making-a-request">I am getting a <code>InvalidExecutableException</code> when making a request</a></li>
+  <li><a href="#i-am-getting-a-notwritableexception-when-making-a-request">I am getting a <code>NotWritableException</code> when making a request</a></li>
+  <li><a href="#why-do-i-need-the-phantomloader-file">Why do I need the <code>phantomloader</code> file?</a></li>
+  <li><a href="#why-am-i-getting-a-status-code-of-0-in-the-response">Why am I getting a status code of 0 in the response?</a></li>
+  <li><a href="#its-not-saving-my-screenshots">It’s not saving my screenshots</a></li>
+  <li><a href="#can-i-set-the-screenshot-size">Can I set the screenshot size?</a></li>
+  <li><a href="#can-i-set-the-viewport-size">Can I set the viewport size?</a></li>
+  <li><a href="#how-to-i-debug-a-request">How to I debug a request?</a></li>
+  <li><a href="#i-am-getting-syntaxerror-parse-error-in-the-debug-log">I am getting <code>SyntaxError: Parse error</code> in the debug log</a></li>
+</ul>
+
+<hr />
+
+<h4 id="its-not-installing-anything-to-my-bin-directory">It’s not installing anything to my bin directory</h4>
+
+<p>When installing via composer, as outlined in the <a href="/installation.html">installation guide</a>, it is recommended that you define the location of the bin folder for your project. This can be done by adding the following to your <code>composer.json</code> file:</p>
+
+<div class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="c1">#composer.json</span>
+
+    <span class="p-Indicator">{</span>
+        <span class="s">&quot;config&quot;</span><span class="p-Indicator">:</span> <span class="p-Indicator">{</span>
+            <span class="s">&quot;bin-dir&quot;</span><span class="p-Indicator">:</span> <span class="s">&quot;/path/to/your/projects/bin/dir&quot;</span>
+        <span class="p-Indicator">}</span>
+    <span class="p-Indicator">}</span></code></pre></div>
+
+<p>You need to make sure that this directory exists and is writable before you install your composer depedencies.</p>
+
+<p>Once you have defined your bin folder in your <code>composer.json</code> file, run composer install from the root of your project:</p>
+
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+    
+    <span class="nv">$ </span>php composer.phar install</code></pre></div>
+
+<p>This should install 2 files to your bin folder: <code>phantomjs</code> and <code>phantomloader</code>. If you do not have these 2 files in your bin folder then check that the folder is writable and run composer install again.</p>
+
+<blockquote>
+  <h4 id="note">Note</h4>
+  <p>If you do not define a bin directory in your <code>composer.json</code> file then the default install location will be <code>vendor/bin/</code>. If you choose to not set a bin folder path then you will need to make sure that this path is set in the client by calling <code>$client-&gt;setBinDir('vendor/bin');</code> before making a request.</p>
+</blockquote>
+
+<h4 id="i-am-getting-a-invalidexecutableexception-when-making-a-request">I am getting a <code>InvalidExecutableException</code> when making a request</h4>
+
+<p>If you have installed via composer, as outlined in the <a href="/installation.html">installation guide</a>, then you should have 2 files installed in either the <code>bin</code> or <code>vendor/bin/</code> directory, in the root of your project. These files are called <code>phantomjs</code> and <code>phantomloader</code>. </p>
+
+<p>Check that these files exist and are executable by your application. If they do not exist, see <a href="#its-not-installing-anything-to-my-bin-directory">It’s not installing anything to my bin directory</a>.</p>
+
+<p>If the PHP PhantomJS library cannot locate either of these files then it will throw a <code>InvalidExecutableException</code>. The message in the exception should tell you which one it can’t execute. If both of these files exist and they are executable by your application, you may need to set the path to the directory that these files live in before making a request:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span> 
+    
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">setBinDir</span><span class="p">(</span><span class="s1">&#39;/path/to/bin/dir&#39;</span><span class="p">);</span></code></pre></div>
+
+<h4 id="i-am-getting-a-notwritableexception-when-making-a-request">I am getting a <code>NotWritableException</code> when making a request</h4>
+
+<p>When making a request, the PHP PhantomJS library compiles a temporary script file to your system’s tmp folder. The location of this folder is determined through the use of the <code>sys_get_temp_dir()</code> function. If this directory is not writable by your application then you will receive this exception.</p>
+
+<h4 id="why-do-i-need-the-phantomloader-file">Why do I need the <code>phantomloader</code> file?</h4>
+
+<p>A proxy loader file is used get around a quirk that PhantomJS has when it encounters a syntax error in a script file. By default, if PhantomJS encounters a syntax error when loading a script file it will not exit execution. This means that PHP PhantomJS will continue to wait for a response from PhantomJS until PHP reaches its script execution timeout period. This also means you won’t get any debug information informing you that the PhantomJS script has a syntax error.</p>
+
+<p>To get around this, script files are loaded through a loader script. This handles the event of a syntax error and ensures that PhantomJS exits when an error is encountered.</p>
+
+<p>The <code>phantomloader</code> file is required in order for the PHP PhantomJS library to run so please make sure that it was installed to your bin folder and is readable by your application.</p>
+
+<p>Another reason for getting this exception is when you are trying to save screenshots. See <a href="#its-not-saving-my-screenshots">It’s not saving my screenshots</a>.</p>
+
+<h4 id="why-am-i-getting-a-status-code-of-0-in-the-response">Why am I getting a status code of 0 in the response?</h4>
+
+<p>A status code of 0 in the response object generally means the request did not complete successfully. This could mean that the URL you are requesting did not return a response or that something happened when making the request that did not raise an error in the PHP PhantomJS library.</p>
+
+<p>Becuase and exception was not thrown, chances are the issue is with PhantomJS itself or at the endpoint you are calling.</p>
+
+<p>One possible reason for this is that your request has timed out before a response was returned from the endpoint that you are requesting. Depending on what you are requesting, some websites seem to take a while to return a response. An example of this is <a href="https://myspace.com/">myspace.com</a> which, at the time of writing this, takes a considerable amount of time resolve through PhantomJS.</p>
+
+<p>To work around this you can try increasing the timeout period in the PHP PhantomJS client:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+    
+    <span class="nv">$timeout</span> <span class="o">=</span> <span class="mi">20000</span><span class="p">;</span> <span class="c1">// 20 seconds</span>
+    
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setTimeout</span><span class="p">(</span><span class="nv">$timeout</span><span class="p">);</span>
+    
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
+
+<p>If you are still having a problem then you should enable debugging, before you make the request, and check the debug log. This contains a dump of information from PhantomJS which could help to track down why you are not getting a response.</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">debug</span><span class="p">(</span><span class="k">true</span><span class="p">);</span> <span class="c1">// Set debug flag</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+        
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span>
+    
+    <span class="k">echo</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getLog</span><span class="p">();</span> <span class="c1">// Output log</span></code></pre></div>
+
+<p>You can also try running a test script through your PhantomJS executable, from the command line, to see if you get a valid response back. Save the following script somewhere:</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">//test-script.js</span>
+
+    <span class="kd">var</span> <span class="nx">page</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;webpage&#39;</span><span class="p">).</span><span class="nx">create</span><span class="p">(),</span>
+        <span class="nx">url</span> <span class="o">=</span> <span class="s1">&#39;YOUR REQUEST URL&#39;</span><span class="p">,</span> <span class="c1">// Change this to the URL you want to request</span>
+        <span class="nx">response</span><span class="p">;</span> 
+
+    <span class="nx">page</span><span class="p">.</span><span class="nx">onResourceReceived</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
+        <span class="nx">response</span> <span class="o">=</span> <span class="nx">r</span><span class="p">;</span>
+    <span class="p">};</span>
+
+    <span class="nx">phantom</span><span class="p">.</span><span class="nx">onError</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="nx">trace</span><span class="p">)</span> <span class="p">{</span>
+  
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">msg</span><span class="p">);</span>
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">trace</span><span class="p">);</span>
+        <span class="nx">phantom</span><span class="p">.</span><span class="nx">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+    <span class="p">};</span>
+ 
+    <span class="nx">page</span><span class="p">.</span><span class="nx">open</span> <span class="p">(</span><span class="nx">url</span><span class="p">,</span> <span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">status</span><span class="p">)</span> <span class="p">{</span>
+        
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">status</span><span class="p">);</span>
+        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">response</span><span class="p">));</span>
+        <span class="nx">phantom</span><span class="p">.</span><span class="nx">exit</span><span class="p">();</span>
+    <span class="p">});</span></code></pre></div>
+
+<p>And then, assuming you have saved the script above to <code>test-script.js</code> in the root of your project and your PhantomJS executable is located at <code>bin/phantomjs</code>, run the following:</p>
+
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+
+    <span class="nv">$ </span>bin/phantomjs ./test-script.js</code></pre></div>
+
+<p>You should see an output of the response from PhantomJS:</p>
+
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+
+    success
+    <span class="o">{</span><span class="s2">&quot;contentType&quot;</span>:<span class="s2">&quot;text/javascript; charset=UTF-8&quot;</span>, <span class="s2">&quot;headers&quot;</span>: ...</code></pre></div>
+
+<p>If you don’t see <code>success</code> followed by a JSON encoded response object then there is something the with the URL you are requesting or your PhantomJS executable. Try reinstalling PhantomJS. If you see <code>fail</code> instead of <code>success</code>, chances are the URL you are requesting is invalid or not resolving.</p>
+
+<h4 id="its-not-saving-my-screenshots">It’s not saving my screenshots</h4>
+
+<p>When making a capture request you need to make sure that you are setting the file location that you want the screenshot saved to, including the filename:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createCaptureRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+    
+    <span class="nv">$file</span> <span class="o">=</span> <span class="s1">&#39;/path/to/save/your/screen/capture/file.jpg&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setCaptureFile</span><span class="p">(</span><span class="nv">$file</span><span class="p">);</span> <span class="c1">// Set the capture file</span>
+    
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
+
+<p>The file itself does not need to exist but the parent directory must exist and be writable by your application. Check that your application has permissions to write files to the directory you are setting for your screen captures.</p>
+
+<h4 id="can-i-set-the-screenshot-size">Can I set the screenshot size?</h4>
+
+<p>Yes, you can set the width and height of your capture along with the x and y coordinates of where the capture should start from:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createCaptureRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+    
+    <span class="nv">$file</span> <span class="o">=</span> <span class="s1">&#39;/path/to/save/your/screen/capture/file.jpg&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$top</span>    <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+    <span class="nv">$left</span>   <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+    <span class="nv">$width</span>  <span class="o">=</span> <span class="mi">200</span><span class="p">;</span>
+    <span class="nv">$height</span> <span class="o">=</span> <span class="mi">400</span><span class="p">;</span>
+    
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setCaptureFile</span><span class="p">(</span><span class="nv">$file</span><span class="p">);</span>
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setCaptureDimensions</span><span class="p">(</span><span class="nv">$width</span><span class="p">,</span> <span class="nv">$height</span><span class="p">,</span> <span class="nv">$top</span><span class="p">,</span> <span class="nv">$left</span><span class="p">);</span>
+    
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
+
+<h4 id="can-i-set-the-viewport-size">Can I set the viewport size?</h4>
+
+<p>Yes, you can set the viewport dimensions on both regular and capture requests:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+        
+    <span class="nv">$width</span>  <span class="o">=</span> <span class="mi">200</span><span class="p">;</span>
+    <span class="nv">$height</span> <span class="o">=</span> <span class="mi">400</span><span class="p">;</span>
+    
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setViewportSize</span><span class="p">(</span><span class="nv">$width</span><span class="p">,</span> <span class="nv">$height</span><span class="p">);</span> <span class="c1">// Set viewport size</span>
+    
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
+
+<h4 id="how-to-i-debug-a-request">How to I debug a request?</h4>
+
+<p>By setting the debug flag to <code>true</code> on the client, you can get a dump of information output from PhantomJS along with some info events added by the PHP PhantomJS library:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">debug</span><span class="p">(</span><span class="k">true</span><span class="p">);</span> <span class="c1">// Set debug flag</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+        
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span>
+    
+    <span class="k">echo</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getLog</span><span class="p">();</span> <span class="c1">// Output log</span></code></pre></div>
+
+<p>You can also get any javacript console errors along with a stack trace from the URL you are calling, in the response object:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+        
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span>
+    
+    <span class="nb">var_dump</span><span class="p">(</span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getConsole</span><span class="p">());</span> <span class="c1">// Outputs array of console errors and stack trace</span></code></pre></div>
+
+<h4 id="i-am-getting-syntaxerror-parse-error-in-the-debug-log">I am getting <code>SyntaxError: Parse error</code> in the debug log</h4>
+
+<p>You will only get this error if the script file that is being run by PhantomJS has a syntax error. If you are writing your own <a href="/advanced.html#custom-phantomjs-scripts">custom scripts</a> then try setting the <a href="#how-to-i-debug-a-request">debug flag</a> which <em>should</em> print some more detailed information in the debug log. Also check that you aren’t setting any parameters to <code>null</code> in your request object as this could be causing a javascript error due to javascript variables being set to nothing e.g. <code>var width = ,</code>.</p>
 
 	  </div>
 
@@ -157,7 +411,7 @@
     <hr>
     <ul class="pager">
         
-        <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html" title="Advanced Usage">&larr; Advanced Usage</a></li>
+        <li class="previous"><a href="/advanced.html" title="Advanced Usage">&larr; Advanced Usage</a></li>
         
         
     </ul>
@@ -177,9 +431,9 @@
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 52 - 29
_site/usage.html

@@ -15,10 +15,10 @@
 	<![endif]-->
 
 	<!-- Le styles -->
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/resources/syntax/syntax.css" rel="stylesheet">
-	<link href="http://jonnnnyw.github.io/php-phantomjs/assets/css/style.css" rel="stylesheet">
+	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
+	<link href="/assets/css/style.css" rel="stylesheet">
 
 	<!-- Le fav and touch icons -->
 	<!-- Update these with your own images
@@ -28,9 +28,9 @@
 	<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
 	-->
 
-	<link rel="alternate" type="application/rss+xml" title="" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">
 
-    <script>
+    <!--<script>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
         (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
         m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -38,7 +38,7 @@
         
         ga('create', 'UA-53289013-1', 'auto');
         ga('send', 'pageview');
-    </script>
+    </script>-->
 
 </head>
 
@@ -63,8 +63,8 @@
                 allowtransparency="true" frameborder="0" scrolling="0" width="85" height="20" class="nav-link"></iframe>
     		
     		
-			<a class="navbar-brand" href="http://jonnnnyw.github.io/php-phantomjs/">
-				<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs-small.png" class="img-circle" />
+			<a class="navbar-brand" href="/">
+				<img src="/assets/media/phantomjs-small.png" class="img-circle" />
 				PHP PhantomJs
 			</a>
 		</div>
@@ -72,11 +72,11 @@
 		<!-- Collect the nav links, forms, and other content for toggling -->
 		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 			<ul class="nav navbar-nav">
-				<li class="active"><a href="http://jonnnnyw.github.io/php-phantomjs/">Home</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html">Installation</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html">Usage</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">Advanced</a></li>
-				<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">Troubleshooting</a></li>
+				<li class="active"><a href="/">Home</a></li>
+				<li><a href="/installation.html">Installation</a></li>
+				<li><a href="/usage.html">Usage</a></li>
+				<li><a href="/advanced.html">Advanced</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -87,11 +87,11 @@
 			<i class="fa fa-bars"></i>
 		</button>
 		<ul class="dropdown-menu" role="menu">
-		    <li><a href="http://jonnnnyw.github.io/php-phantomjs/"><i class="fa fa-home"></i>Home</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
-			<li><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
+		    <li><a href="/"><i class="fa fa-home"></i>Home</a></li>
+			<li><a href="/installation.html"><i class="fa fa-folder"></i>Installation</a></li>
+			<li><a href="/usage.html"><i class="fa fa-folder"></i>Usage</a></li>
+			<li><a href="/advanced.html"><i class="fa fa-folder"></i>Advanced</a></li>
+			<li><a href="/troubleshooting.html"><i class="fa fa-folder"></i>Troubleshooting</a></li>
 			<li class="divider"></li>
 			<li><a href="#"><i class="fa fa-arrow-up"></i>Top of Page</a></li>
 		</ul>
@@ -100,11 +100,11 @@
 	<div class="col-sm-3 sidebar hidden-xs">
 		<! -- sidebar.html -->
 <header class="sidebar-header" role="banner">
-	<a href="http://jonnnnyw.github.io/php-phantomjs/">
-		<img src="http://jonnnnyw.github.io/php-phantomjs/assets/media/phantomjs.png" class="img-circle" />
+	<a href="/">
+		<img src="/assets/media/phantomjs.png" class="img-circle" />
 	</a>
 	<h3 class="title">
-        <a href="http://jonnnnyw.github.io/php-phantomjs/">PHP PhantomJs</a>
+        <a href="/">PHP PhantomJs</a>
     </h3>
 </header>
 
@@ -154,12 +154,15 @@
   <li><a href="#other-request-methods">Other Request Methods</a></li>
   <li><a href="#response-data">Response Data</a></li>
   <li><a href="#screen-captures">Screen Captures</a></li>
+  <li><a href="#set-viewport-size">Set Viewport Size</a></li>
   <li><a href="#custom-timeout">Custom Timeout</a></li>
   <li><a href="#delay-page-render">Delay Page Render</a></li>
   <li><a href="#custom-run-options">Custom Run Options</a></li>
 </ul>
 
-<p>For more advanced customization or to load your own PhantomJS scripts, see the <a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html">advanced</a> documentation.</p>
+<p>For more advanced customization or to load your own PhantomJS scripts, see the <a href="/advanced.html">advanced</a> documentation.</p>
+
+<hr />
 
 <h2 id="basic-request">Basic Request</h2>
 
@@ -320,7 +323,7 @@
   </tbody>
 </table>
 
-<p>If the response contains a status code of 0, chances are the request failed. Check the request <a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html#debugging">debug log</a> for more detailed information about what may have gone wrong.</p>
+<p>If the response contains a status code of 0, chances are the request failed. Check the request <a href="/troubleshooting.html#how-to-i-debug-a-request">debug log</a> for more detailed information about what may have gone wrong.</p>
 
 <h2 id="screen-captures">Screen Captures</h2>
 
@@ -366,6 +369,26 @@
     
     <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
 
+<h2 id="set-viewport-size">Set Viewport Size</h2>
+
+<p>You can easily set the viewport size for a request:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="k">use</span> <span class="nx">JonnyW\PhantomJs\Client</span><span class="p">;</span>
+    
+    <span class="nv">$client</span> <span class="o">=</span> <span class="nx">Client</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$request</span>  <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createRequest</span><span class="p">(</span><span class="s1">&#39;http://google.com&#39;</span><span class="p">);</span>
+    <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">getMessageFactory</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">createResponse</span><span class="p">();</span>
+        
+    <span class="nv">$width</span>  <span class="o">=</span> <span class="mi">200</span><span class="p">;</span>
+    <span class="nv">$height</span> <span class="o">=</span> <span class="mi">400</span><span class="p">;</span>
+    
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setViewportSize</span><span class="p">(</span><span class="nv">$width</span><span class="p">,</span> <span class="nv">$height</span><span class="p">);</span>
+    
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="nv">$request</span><span class="p">,</span> <span class="nv">$response</span><span class="p">);</span></code></pre></div>
+
 <h2 id="custom-timeout">Custom Timeout</h2>
 
 <p>By default, each request will timeout after 5 seconds. You can set a custom timeout period (in milliseconds) for each request:</p>
@@ -448,10 +471,10 @@
     <hr>
     <ul class="pager">
         
-        <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/installation.html" title="Installation">&larr; Installation</a></li>
+        <li class="previous"><a href="/installation.html" title="Installation">&larr; Installation</a></li>
         
         
-        <li class="next"><a href="http://jonnnnyw.github.io/php-phantomjs/advanced.html" title="Advanced Usage">Advanced Usage &rarr;</a></li>
+        <li class="next"><a href="/advanced.html" title="Advanced Usage">Advanced Usage &rarr;</a></li>
         
     </ul>
 
@@ -470,9 +493,9 @@
 		</footer>
 	</div>
 
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/jquery/jquery.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/resources/bootstrap/js/bootstrap.min.js"></script>
-	<script type="text/javascript" src="http://jonnnnyw.github.io/php-phantomjs/assets/js/app.js"></script>
+	<script type="text/javascript" src="/assets/resources/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/assets/resources/bootstrap/js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="/assets/js/app.js"></script>
 	
 </body>
 </html>

+ 4 - 0
assets/css/style.css

@@ -97,6 +97,10 @@ article{
 	margin-bottom: 20px;
 }
 
+.article_body ul {
+    margin-bottom: 30px;
+}
+
 .post-date {
 	text-transform: uppercase;
 	font-size: 14px;