فهرست منبع

Adding advanced documentation page

Jonny Wenmoth 11 سال پیش
والد
کامیت
2972754901

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

@@ -6,6 +6,321 @@ tags: []
 fullview: true
 ---
 
-This documentation page will be up in the next couple of days.
+* [PhantomJS command line options](#phantomjs-command-line-options)
+* [Custom PhantomJS scripts](#custom-phantom-js-scripts)
+  * [Writing a custom script](#writing-a-custom-script)
+  * [Using custom request parameters in your script](#using-custom-request-parameters-in-your-script)
+  * [Loading your script](#loading-your-script)
 
-In the meantime, check out the [examples](https://github.com/jonnnnyw/php-phantomjs/tree/master/examples) in the Github repo.
+PhantomJS command line options
+------------------------------
+
+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:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    $client->addOption('--load-images=true');
+    $client->addOption('--ignore-ssl-errors=true');
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+
+    $client->send($request, $response);
+{% endhighlight %}
+
+You can also set a path to a JSON configuration file that contains multiple PhantomJS options:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    $client->addOption('--config=/path/to/config.json');
+    
+    $request  = $client->getMessageFactory()->createRequest('http://google.com');
+    $response = $client->getMessageFactory()->createResponse();
+
+    $client->send($request, $response);
+{% endhighlight %}
+
+See the [PhantomJS Documentation](http://phantomjs.org/api/command-line.html) for a full list of command line options.
+
+Custom PhantomJS scripts
+------------------------
+
+In most instances you shouldn't need to worry about the javascript files that run the PHP PhantomJS library but there may be times when you want to execute your own custom PhantomJS scripts through the client. This can be easily achieved by using the built in script loader.
+
+Script files or 'procedures' as they are referred to in the application are closely mapped to requests. When you create a default request instance, you are essentially running the default javascript procedure that comes bundled with the application. When you create a capture request you are running the capture procedure.
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client->getMessageFactory()->createRequest(); // ~/Resources/procedures/default.proc
+    $client->getMessageFactory()->createCaptureRequest(); // ~/Resources/procedures/capture.proc
+{% endhighlight %}
+
+### Writing a custom script
+
+The first step in creating your script is to create a procedure file somewhere. For the purpose of this guide we will refer to it as `my_procedure.proc` but in reality it can be called anything you like. The only requirement is that the file extension must be `.proc`.
+
+Create the file somewhere and make sure it can be read by your application. Make a note of the path to the directory where your file is created as you will need this when loading your script which is explained later in this guide.
+
+{% highlight bash %}
+    
+    #bash
+    
+    $ touch my_procedure.proc
+    $ chmod 755 my_procedure.proc
+    
+{% endhighlight %}
+
+Next open your procedure file in your text editor and write your PhantomJS script. The [PhantomJS documentation](http://phantomjs.org/quick-start.html) has more detailed information on writing custom scripts.
+
+{% highlight javascript %}
+    
+    {% raw %}
+    
+    // my_procedure.proc
+
+    var page  = require('webpage').create();
+    
+    page.open ('{{ request.getUrl() }}', '{{ request.getMethod() }}', '{{ request.getBody() }}', function (status) {
+         
+        // It is important that you exit PhantomJS
+        // when your script has run or when you
+        // encounter an error
+        phantom.exit(1);
+    });
+    
+    ...
+    
+    {% endraw %}
+    
+{% endhighlight %}
+
+> #### Important
+> Make sure that `phantom.exit(1);` is always called after your script has run or if you encounter an error. This requires you to take care when handling PhantomJS errors to ensure that you exit the PhantomJS script, whether the script was successfully executed or not. If you do not call `phantom.exit(1);` then PhantomJS will continue to run until your PHP script times out. If you find that your custom script is hanging then this is most likely the cause.
+
+It is a good practice to create a global error handler in your script that exits PhantomJS:
+
+{% highlight javascript %}
+    
+    {% raw %}
+    
+    // my_procedure.proc
+
+    phantom.onError = function(msg, trace) {
+  
+        phantom.exit(1);
+    };
+    
+    ...
+    
+    {% endraw %}
+    
+{% endhighlight %}
+
+
+### Using custom request parameters in your script
+
+Before a procedure is executed by the application it is parsed through a template parser. The PHP PhantomJS library uses the popular [Twig templating engine](https://github.com/fabpot/Twig). This gives you access to all the [Twig niceness](http://twig.sensiolabs.org/doc/templates.html) which you can use in your custom scripts.
+
+You may have noticed in the example above that we have used some Twig template tags referencing a request object e.g. {% raw %}`{{ request.getUrl() }}`{% endraw %}. This is in fact the PHP request instance that you created and passed to the client when sending your request, which is injected into the Twig template parser. As a result you gain full access to all the data contained within the request instance, via the data accessor methods.
+
+A default request instance contains the following accessors:
+
+{% raw %}
+
+| Accessor             | Description                                 |  Twig example                    |
+| :------------------: | ------------------------------------------- | :------------------------------: |
+| getMethod()          | The request method e.g. GET.                | {{ request.getMethod() }}        |
+| getTimeout()         | The request timeout period in milliseconds. | {{ request.getTimeout() }}       |
+| getDelay()           | The page render delay in seconds.           | {{ request.getDelay() }}         |
+| getUrl()             | The request URL.                            | {{ request.getUrl() }}           |
+| getBody()            | The request body (POST, PUT).               | {{ request.getBody() }}          |
+| getHeaders(*format*) | The request headers.                        | {{ request.getHeaders('json') }} |
+
+{% endraw %}
+
+A capture request contains a few additional ones:
+
+{% raw %}
+
+| Accessor         | Description                             |  Twig example                  |
+| :--------------: | ----------------------------------------| :----------------------------: |
+| getRectTop()     | The x coordinate of the capture region. | {{ request.getRectTop() }}     |
+| getRectLeft()    | The y coordinate of the capture region. | {{ request.getRectLeft() }}    |
+| getRectWidth()   | The width of the capture region.        | {{ request.getRectWidth() }}   |
+| getRectHeight()  | The height of the capture region.       | {{ request.getRectHeight() }}  |
+| getCaptureFile() | The file to save the capture to.        | {{ request.getCaptureFile() }} |
+
+{% endraw %}
+
+If you would like to inject additional data into your script through custom accessors, simply extend the request class with your own:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Message\Request;
+    
+    class CustomRequest extends Request
+    {
+    
+        public function getSomething()
+        {
+            return 'Something!';
+        }
+    }
+{% endhighlight %}
+
+Now you will be able to access the data in your custom script when using your custom request:
+
+{% highlight javascript %}
+    
+    {% raw %}
+    
+    // my_procedure.proc
+
+    var something = '{{ request.getSomething() }}'; // Get something
+    
+    ...
+    
+    {% endraw %}
+    
+{% endhighlight %}
+
+And to use your custom request simply create a new instance of it and pass it to the client:
+
+{% highlight php %}
+
+    <?php
+
+    use JonnyW\PhantomJs\Client;
+    
+    $client = Client::getInstance();
+    
+    $response = $client->getMessageFactory()->createResponse();
+    
+    $request  = new CustomRequest();
+    $request->setMethod('GET');
+    $request->setUrl('http://www.google.com');
+    
+    $client->send($request, $response);
+{% endhighlight %}
+
+
+### Loading your script
+
+Now that you have your custom script and you've added your custom request parameters, you may be wondering how to tell the client to actually load your script. This is done by creating a procedure loader and telling it where to find your script files.
+
+The service container has a factory that makes creating a new procedure loader easy:
+
+{% highlight php %}
+
+    <?php
+    
+    use JonnyW\PhantomJs\Client;
+    use JonnyW\PhantomJs\DependencyInjection\ServiceContainer;
+    
+    $location = '/path/to/your/procedure/directory';
+    
+    $serviceContainer = ServiceContainer::getInstance();
+    
+    $procedureLoader = $serviceContainer->get('procedure_loader_factory')
+        ->createProcedureLoader($location);
+        
+    ...
+{% endhighlight %}
+
+
+The client contains a chain procedure loader which lets you set multiple loaders at the same time. Ultimately this means that you can load your custom scripts while still maintaining the ability to load the default scripts if you choose. 
+
+Now add your procedure loader to the chain loader:
+
+{% highlight php %}
+
+    <?php
+
+    ...
+    
+    $client = Client::getInstance();
+    $client->getProcedureLoader()->addLoader($procedureLoader);
+    
+    ...
+{% endhighlight %}
+
+The last thing you need to do is to tell the request which script you want to load for that request. This is done by setting the request type to the name of your procedure file, minus the extension:
+
+{% highlight php %}
+
+    <?php
+
+    ...
+    
+   $request = $client->getMessageFactory()->createRequest();
+   $request->setType('my_procedure');
+    
+    ...
+{% endhighlight %}
+
+Or if you are using a custom request as outlined in the [custom request parameters](#using-custom-request-parameters-in-your-script) section, you can implement a getType method which returns the name of your procedure, eliminating the need to set the request type for each request:
+
+{% highlight php %}
+
+<?php
+
+    use JonnyW\PhantomJs\Message\Request;
+    
+    class CustomRequest extends Request
+    {
+    
+        public function getType()
+        {
+            return 'my_procedure';
+        }
+    }
+{% endhighlight %}
+
+Below is a full example for clarity:
+
+{% highlight php %}
+
+    <?php
+    
+    use JonnyW\PhantomJs\Client;
+    use JonnyW\PhantomJs\DependencyInjection\ServiceContainer;
+    
+    $location = '/path/to/your/procedure/directory';
+    
+    $serviceContainer = ServiceContainer::getInstance();
+    
+    $procedureLoader = $serviceContainer->get('procedure_loader_factory')
+        ->createProcedureLoader($location);
+        
+    $client = Client::getInstance();
+    $client->getProcedureLoader()->addLoader($procedureLoader);
+    
+    $request = $client->getMessageFactory()->createRequest();
+    $request->setType('my_procedure');
+    
+    $response = $client->getMessageFactory()->createResponse();
+    
+    $client->send($request, $response);
+
+{% endhighlight %}
+
+> #### Troubleshooting
+> 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 `$client->debug(true)` which will then give you access to some log information through `$client->getLog()`.
+
+See more detailed information about [debugging]({{ site.BASE_PATH }}/debugging.html).

+ 16 - 5
_posts/2014-07-27-installation.md

@@ -6,6 +6,11 @@ tags: []
 fullview: true
 ---
 
+* [Prerequisites](#prerequisites)
+* [Installing via Composer](#installing-via-composer)
+* [Custom Installation](#custom-installation)
+* [Installing from tarball](#installing-from-tarball)
+
 Prerequisites
 -------------
 
@@ -18,7 +23,9 @@ Install [Composer](https://getcomposer.org/) for your project:
 
 {% highlight bash %}
 
-    curl -s http://getcomposer.org/installer | php
+    #bash
+
+    $ curl -s http://getcomposer.org/installer | php
 {% endhighlight %}
 
 Create a `composer.json` file in the root of your project:
@@ -48,8 +55,10 @@ It is important that you have the 'scripts' section shown above in your `compose
 Finally, install the composer depedencies for your project:
 
 {% highlight bash %}
-
-    php composer.phar install
+    
+    #bash
+    
+    $ php composer.phar install
 {% endhighlight %}
 
 Custom Installation
@@ -83,8 +92,10 @@ You will need to make sure that this directory exists and is writable by Compose
 Once you have updated your bin location run composer install to install PhantomJS:
 
 {% highlight bash %}
-
-    php composer.phar install
+    
+    #bash
+    
+    $ php composer.phar install
 {% endhighlight %}
 
 This should install the correct PhantomJS executable for your system to the bin locaiton you defined in your `composer.json` file. As mentioned above, you will need to tell the client where to find your PhantomJS executable as it is not installed in the default location:

+ 4 - 2
_posts/2014-07-28-introduction.md

@@ -58,8 +58,10 @@ This will ensure the latest version of PhantomJS is installed for your system, i
 Finally, install PHP PhantomJS from the root of your project:
 
 {% highlight bash %}
-
-    composer require "jonnyw/php-phantomjs:3.*"
+    
+    #bash
+    
+    $ composer require "jonnyw/php-phantomjs:3.*"
 {% endhighlight %}
 
 If you would like to use another installation method or would like to see more detailed installation instructions, see the [installation]({{ site.BASE_PATH }}/installation.html) documentation.

+ 26 - 26
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -197,9 +197,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>

+ 344 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -145,9 +145,323 @@
 	<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="#phantomjs-command-line-options">PhantomJS command line options</a></li>
+  <li><a href="#custom-phantom-js-scripts">Custom PhantomJS scripts</a>
+    <ul>
+      <li><a href="#writing-a-custom-script">Writing a custom script</a></li>
+      <li><a href="#using-custom-request-parameters-in-your-script">Using custom request parameters in your script</a></li>
+      <li><a href="#loading-your-script">Loading your script</a></li>
+    </ul>
+  </li>
+</ul>
 
-<p>In the meantime, check out the <a href="https://github.com/jonnnnyw/php-phantomjs/tree/master/examples">examples</a> in the Github repo.</p>
+<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>
+
+<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">addOption</span><span class="p">(</span><span class="s1">&#39;--load-images=true&#39;</span><span class="p">);</span>
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">addOption</span><span class="p">(</span><span class="s1">&#39;--ignore-ssl-errors=true&#39;</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></code></pre></div>
+
+<p>You can also set a path to a JSON configuration file that contains multiple PhantomJS options:</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">addOption</span><span class="p">(</span><span class="s1">&#39;--config=/path/to/config.json&#39;</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></code></pre></div>
+
+<p>See the <a href="http://phantomjs.org/api/command-line.html">PhantomJS Documentation</a> for a full list of command line options.</p>
+
+<h2 id="custom-phantomjs-scripts">Custom PhantomJS scripts</h2>
+
+<p>In most instances you shouldn’t need to worry about the javascript files that run the PHP PhantomJS library but there may be times when you want to execute your own custom PhantomJS scripts through the client. This can be easily achieved by using the built in script loader.</p>
+
+<p>Script files or ‘procedures’ as they are referred to in the application are closely mapped to requests. When you create a default request instance, you are essentially running the default javascript procedure that comes bundled with the application. When you create a capture request you are running the capture procedure.</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">-&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="c1">// ~/Resources/procedures/default.proc</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="c1">// ~/Resources/procedures/capture.proc</span></code></pre></div>
+
+<h3 id="writing-a-custom-script">Writing a custom script</h3>
+
+<p>The first step in creating your script is to create a procedure file somewhere. For the purpose of this guide we will refer to it as <code>my_procedure.proc</code> but in reality it can be called anything you like. The only requirement is that the file extension must be <code>.proc</code>.</p>
+
+<p>Create the file somewhere and make sure it can be read by your application. Make a note of the path to the directory where your file is created as you will need this when loading your script which is explained later in this guide.</p>
+
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+    
+    <span class="nv">$ </span>touch my_procedure.proc
+    <span class="nv">$ </span>chmod <span class="m">755</span> my_procedure.proc</code></pre></div>
+
+<p>Next open your procedure file in your text editor and write your PhantomJS script. The <a href="http://phantomjs.org/quick-start.html">PhantomJS documentation</a> has more detailed information on writing custom scripts.</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</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">page</span><span class="p">.</span><span class="nx">open</span> <span class="p">(</span><span class="s1">&#39;{{ request.getUrl() }}&#39;</span><span class="p">,</span> <span class="s1">&#39;{{ request.getMethod() }}&#39;</span><span class="p">,</span> <span class="s1">&#39;{{ request.getBody() }}&#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="c1">// It is important that you exit PhantomJS</span>
+        <span class="c1">// when your script has run or when you</span>
+        <span class="c1">// encounter an error</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="p">...</span></code></pre></div>
+
+<blockquote>
+  <h4 id="important">Important</h4>
+  <p>Make sure that <code>phantom.exit(1);</code> is always called after your script has run or if you encounter an error. This requires you to take care when handling PhantomJS errors to ensure that you exit the PhantomJS script, whether the script was successfully executed or not. If you do not call <code>phantom.exit(1);</code> then PhantomJS will continue to run until your PHP script times out. If you find that your custom script is hanging then this is most likely the cause.</p>
+</blockquote>
+
+<p>It is a good practice to create a global error handler in your script that exits PhantomJS:</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</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">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="p">...</span></code></pre></div>
+
+<h3 id="using-custom-request-parameters-in-your-script">Using custom request parameters in your script</h3>
+
+<p>Before a procedure is executed by the application it is parsed through a template parser. The PHP PhantomJS library uses the popular <a href="https://github.com/fabpot/Twig">Twig templating engine</a>. This gives you access to all the <a href="http://twig.sensiolabs.org/doc/templates.html">Twig niceness</a> which you can use in your custom scripts.</p>
+
+<p>You may have noticed in the example above that we have used some Twig template tags referencing a request object e.g. <code>{{ request.getUrl() }}</code>. This is in fact the PHP request instance that you created and passed to the client when sending your request, which is injected into the Twig template parser. As a result you gain full access to all the data contained within the request instance, via the data accessor methods.</p>
+
+<p>A default request instance contains the following accessors:</p>
+
+<table>
+  <thead>
+    <tr>
+      <th style="text-align: center">Accessor</th>
+      <th>Description</th>
+      <th style="text-align: center">Twig example</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td style="text-align: center">getMethod()</td>
+      <td>The request method e.g. GET.</td>
+      <td style="text-align: center">{{ request.getMethod() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getTimeout()</td>
+      <td>The request timeout period in milliseconds.</td>
+      <td style="text-align: center">{{ request.getTimeout() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getDelay()</td>
+      <td>The page render delay in seconds.</td>
+      <td style="text-align: center">{{ request.getDelay() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getUrl()</td>
+      <td>The request URL.</td>
+      <td style="text-align: center">{{ request.getUrl() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getBody()</td>
+      <td>The request body (POST, PUT).</td>
+      <td style="text-align: center">{{ request.getBody() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getHeaders(<em>format</em>)</td>
+      <td>The request headers.</td>
+      <td style="text-align: center">{{ request.getHeaders(‘json’) }}</td>
+    </tr>
+  </tbody>
+</table>
+
+<p>A capture request contains a few additional ones:</p>
+
+<table>
+  <thead>
+    <tr>
+      <th style="text-align: center">Accessor</th>
+      <th>Description</th>
+      <th style="text-align: center">Twig example</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td style="text-align: center">getRectTop()</td>
+      <td>The x coordinate of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectTop() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectLeft()</td>
+      <td>The y coordinate of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectLeft() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectWidth()</td>
+      <td>The width of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectWidth() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectHeight()</td>
+      <td>The height of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectHeight() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getCaptureFile()</td>
+      <td>The file to save the capture to.</td>
+      <td style="text-align: center">{{ request.getCaptureFile() }}</td>
+    </tr>
+  </tbody>
+</table>
+
+<p>If you would like to inject additional data into your script through custom accessors, simply extend the request class with your own:</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\Message\Request</span><span class="p">;</span>
+    
+    <span class="k">class</span> <span class="nc">CustomRequest</span> <span class="k">extends</span> <span class="nx">Request</span>
+    <span class="p">{</span>
+    
+        <span class="k">public</span> <span class="k">function</span> <span class="nf">getSomething</span><span class="p">()</span>
+        <span class="p">{</span>
+            <span class="k">return</span> <span class="s1">&#39;Something!&#39;</span><span class="p">;</span>
+        <span class="p">}</span>
+    <span class="p">}</span></code></pre></div>
+
+<p>Now you will be able to access the data in your custom script when using your custom request:</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</span>
+
+    <span class="kd">var</span> <span class="nx">something</span> <span class="o">=</span> <span class="s1">&#39;{{ request.getSomething() }}&#39;</span><span class="p">;</span> <span class="c1">// Get something</span>
+    
+    <span class="p">...</span></code></pre></div>
+
+<p>And to use your custom request simply create a new instance of it and pass it to the 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">$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">$request</span>  <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomRequest</span><span class="p">();</span>
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setMethod</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">);</span>
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setUrl</span><span class="p">(</span><span class="s1">&#39;http://www.google.com&#39;</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>
+
+<h3 id="loading-your-script">Loading your script</h3>
+
+<p>Now that you have your custom script and you’ve added your custom request parameters, you may be wondering how to tell the client to actually load your script. This is done by creating a procedure loader and telling it where to find your script files.</p>
+
+<p>The service container has a factory that makes creating a new procedure loader easy:</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="k">use</span> <span class="nx">JonnyW\PhantomJs\DependencyInjection\ServiceContainer</span><span class="p">;</span>
+    
+    <span class="nv">$location</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/procedure/directory&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$serviceContainer</span> <span class="o">=</span> <span class="nx">ServiceContainer</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$procedureLoader</span> <span class="o">=</span> <span class="nv">$serviceContainer</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;procedure_loader_factory&#39;</span><span class="p">)</span>
+        <span class="o">-&gt;</span><span class="na">createProcedureLoader</span><span class="p">(</span><span class="nv">$location</span><span class="p">);</span>
+        
+    <span class="o">...</span></code></pre></div>
+
+<p>The client contains a chain procedure loader which lets you set multiple loaders at the same time. Ultimately this means that you can load your custom scripts while still maintaining the ability to load the default scripts if you choose. </p>
+
+<p>Now add your procedure loader to the chain loader:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="o">...</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">getProcedureLoader</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">addLoader</span><span class="p">(</span><span class="nv">$procedureLoader</span><span class="p">);</span>
+    
+    <span class="o">...</span></code></pre></div>
+
+<p>The last thing you need to do is to tell the request which script you want to load for that request. This is done by setting the request type to the name of your procedure file, minus the extension:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="o">...</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="nv">$request</span><span class="o">-&gt;</span><span class="na">setType</span><span class="p">(</span><span class="s1">&#39;my_procedure&#39;</span><span class="p">);</span>
+    
+    <span class="o">...</span></code></pre></div>
+
+<p>Or if you are using a custom request as outlined in the <a href="#using-custom-request-parameters-in-your-script">custom request parameters</a> section, you can implement a getType method which returns the name of your procedure, eliminating the need to set the request type for each 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\Message\Request</span><span class="p">;</span>
+    
+    <span class="k">class</span> <span class="nc">CustomRequest</span> <span class="k">extends</span> <span class="nx">Request</span>
+    <span class="p">{</span>
+    
+        <span class="k">public</span> <span class="k">function</span> <span class="nf">getType</span><span class="p">()</span>
+        <span class="p">{</span>
+            <span class="k">return</span> <span class="s1">&#39;my_procedure&#39;</span><span class="p">;</span>
+        <span class="p">}</span>
+    <span class="p">}</span></code></pre></div>
+
+<p>Below is a full example for clarity:</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="k">use</span> <span class="nx">JonnyW\PhantomJs\DependencyInjection\ServiceContainer</span><span class="p">;</span>
+    
+    <span class="nv">$location</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/procedure/directory&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$serviceContainer</span> <span class="o">=</span> <span class="nx">ServiceContainer</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$procedureLoader</span> <span class="o">=</span> <span class="nv">$serviceContainer</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;procedure_loader_factory&#39;</span><span class="p">)</span>
+        <span class="o">-&gt;</span><span class="na">createProcedureLoader</span><span class="p">(</span><span class="nv">$location</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">getProcedureLoader</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">addLoader</span><span class="p">(</span><span class="nv">$procedureLoader</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="nv">$request</span><span class="o">-&gt;</span><span class="na">setType</span><span class="p">(</span><span class="s1">&#39;my_procedure&#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></code></pre></div>
+
+<blockquote>
+  <h4 id="troubleshooting">Troubleshooting</h4>
+  <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="/debugging.html">debugging</a>.</p>
 
 	  </div>
 
@@ -157,10 +471,10 @@
 
 		<ul class="pager">
 		  
-		  <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/debugging.html" title="Debugging">&larr; Debugging</a></li>
+		  <li class="previous"><a href="/debugging.html" title="Debugging">&larr; Debugging</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>
 
@@ -183,9 +497,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>

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

@@ -82,6 +82,7 @@ article .share .gplus:hover {
 }
 
 .page-header {
+    padding: 0 5% 0;
 	color: #e74c3c;
 	text-shadow: 1px 1px 1px rgba(150, 150, 150, 1);
 }

+ 28 - 28
_site/debugging.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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -157,10 +157,10 @@
 
 		<ul class="pager">
 		  
-		  <li class="previous"><a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html" title="Troubleshooting">&larr; Troubleshooting</a></li>
+		  <li class="previous"><a href="/troubleshooting.html" title="Troubleshooting">&larr; Troubleshooting</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>
 
@@ -183,9 +183,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>

+ 354 - 25
_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>
@@ -51,9 +51,11 @@ code etc.&lt;/li&gt;
 
 &lt;p&gt;Finally, install PHP PhantomJS 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;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;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;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;
 
@@ -106,17 +108,24 @@ 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>
 				<title>Installation</title>
-				<description>&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
+				<description>&lt;ul&gt;
+  &lt;li&gt;&lt;a href=&quot;#prerequisites&quot;&gt;Prerequisites&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#installing-via-composer&quot;&gt;Installing via Composer&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#custom-installation&quot;&gt;Custom Installation&lt;/a&gt;&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;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;
 
@@ -124,7 +133,9 @@ code etc.&lt;/li&gt;
 
 &lt;p&gt;Install &lt;a href=&quot;https://getcomposer.org/&quot;&gt;Composer&lt;/a&gt; for 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;curl -s http://getcomposer.org/installer &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; php&lt;/code&gt;&lt;/pre&gt;&lt;/div&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;curl -s http://getcomposer.org/installer &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; php&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 
 &lt;p&gt;Create a &lt;code&gt;composer.json&lt;/code&gt; file in the root of your project:&lt;/p&gt;
 
@@ -149,7 +160,9 @@ code etc.&lt;/li&gt;
 
 &lt;p&gt;Finally, install the composer depedencies for 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;php composer.phar install&lt;/code&gt;&lt;/pre&gt;&lt;/div&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;h2 id=&quot;custom-installation&quot;&gt;Custom Installation&lt;/h2&gt;
 
@@ -174,7 +187,9 @@ code etc.&lt;/li&gt;
 
 &lt;p&gt;Once you have updated your bin location run composer install to install 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;php composer.phar install&lt;/code&gt;&lt;/pre&gt;&lt;/div&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 the correct PhantomJS executable for your system to the bin locaiton you defined in your &lt;code&gt;composer.json&lt;/code&gt; file. As mentioned above, you will need to tell the client where to find your PhantomJS executable as it is not installed in the default location:&lt;/p&gt;
 
@@ -203,8 +218,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>
@@ -222,7 +237,7 @@ code etc.&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;h2 id=&quot;basic-request&quot;&gt;Basic Request&lt;/h2&gt;
 
@@ -383,7 +398,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/debugging.html&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;/debugging.html&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;
 
@@ -503,19 +518,333 @@ 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>
 				<title>Advanced Usage</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;#phantomjs-command-line-options&quot;&gt;PhantomJS command line options&lt;/a&gt;&lt;/li&gt;
+  &lt;li&gt;&lt;a href=&quot;#custom-phantom-js-scripts&quot;&gt;Custom PhantomJS scripts&lt;/a&gt;
+    &lt;ul&gt;
+      &lt;li&gt;&lt;a href=&quot;#writing-a-custom-script&quot;&gt;Writing a custom script&lt;/a&gt;&lt;/li&gt;
+      &lt;li&gt;&lt;a href=&quot;#using-custom-request-parameters-in-your-script&quot;&gt;Using custom request parameters in your script&lt;/a&gt;&lt;/li&gt;
+      &lt;li&gt;&lt;a href=&quot;#loading-your-script&quot;&gt;Loading your script&lt;/a&gt;&lt;/li&gt;
+    &lt;/ul&gt;
+  &lt;/li&gt;
+&lt;/ul&gt;
 
-&lt;p&gt;In the meantime, check out the &lt;a href=&quot;https://github.com/jonnnnyw/php-phantomjs/tree/master/examples&quot;&gt;examples&lt;/a&gt; in the Github repo.&lt;/p&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;
+
+&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;addOption&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;--load-images=true&amp;#39;&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;addOption&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;--ignore-ssl-errors=true&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;=&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;You can also set a path to a JSON configuration file that contains multiple PhantomJS options:&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;addOption&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;--config=/path/to/config.json&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;=&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;/code&gt;&lt;/pre&gt;&lt;/div&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;
+
+&lt;h2 id=&quot;custom-phantomjs-scripts&quot;&gt;Custom PhantomJS scripts&lt;/h2&gt;
+
+&lt;p&gt;In most instances you shouldn’t need to worry about the javascript files that run the PHP PhantomJS library but there may be times when you want to execute your own custom PhantomJS scripts through the client. This can be easily achieved by using the built in script loader.&lt;/p&gt;
+
+&lt;p&gt;Script files or ‘procedures’ as they are referred to in the application are closely mapped to requests. When you create a default request instance, you are essentially running the default javascript procedure that comes bundled with the application. When you create a capture request you are running the capture procedure.&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;-&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;c1&quot;&gt;// ~/Resources/procedures/default.proc&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;c1&quot;&gt;// ~/Resources/procedures/capture.proc&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h3 id=&quot;writing-a-custom-script&quot;&gt;Writing a custom script&lt;/h3&gt;
+
+&lt;p&gt;The first step in creating your script is to create a procedure file somewhere. For the purpose of this guide we will refer to it as &lt;code&gt;my_procedure.proc&lt;/code&gt; but in reality it can be called anything you like. The only requirement is that the file extension must be &lt;code&gt;.proc&lt;/code&gt;.&lt;/p&gt;
+
+&lt;p&gt;Create the file somewhere and make sure it can be read by your application. Make a note of the path to the directory where your file is created as you will need this when loading your script which is explained later in this guide.&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;touch my_procedure.proc
+    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;chmod &lt;span class=&quot;m&quot;&gt;755&lt;/span&gt; my_procedure.proc&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;Next open your procedure file in your text editor and write your PhantomJS script. The &lt;a href=&quot;http://phantomjs.org/quick-start.html&quot;&gt;PhantomJS documentation&lt;/a&gt; has more detailed information on writing custom scripts.&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;// my_procedure.proc&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;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;s1&quot;&gt;&amp;#39;{{ request.getUrl() }}&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{{ request.getMethod() }}&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{{ request.getBody() }}&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;c1&quot;&gt;// It is important that you exit PhantomJS&lt;/span&gt;
+        &lt;span class=&quot;c1&quot;&gt;// when your script has run or when you&lt;/span&gt;
+        &lt;span class=&quot;c1&quot;&gt;// encounter an error&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;p&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;blockquote&gt;
+  &lt;h4 id=&quot;important&quot;&gt;Important&lt;/h4&gt;
+  &lt;p&gt;Make sure that &lt;code&gt;phantom.exit(1);&lt;/code&gt; is always called after your script has run or if you encounter an error. This requires you to take care when handling PhantomJS errors to ensure that you exit the PhantomJS script, whether the script was successfully executed or not. If you do not call &lt;code&gt;phantom.exit(1);&lt;/code&gt; then PhantomJS will continue to run until your PHP script times out. If you find that your custom script is hanging then this is most likely the cause.&lt;/p&gt;
+&lt;/blockquote&gt;
+
+&lt;p&gt;It is a good practice to create a global error handler in your script that exits PhantomJS:&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;// my_procedure.proc&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;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;p&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;h3 id=&quot;using-custom-request-parameters-in-your-script&quot;&gt;Using custom request parameters in your script&lt;/h3&gt;
+
+&lt;p&gt;Before a procedure is executed by the application it is parsed through a template parser. The PHP PhantomJS library uses the popular &lt;a href=&quot;https://github.com/fabpot/Twig&quot;&gt;Twig templating engine&lt;/a&gt;. This gives you access to all the &lt;a href=&quot;http://twig.sensiolabs.org/doc/templates.html&quot;&gt;Twig niceness&lt;/a&gt; which you can use in your custom scripts.&lt;/p&gt;
+
+&lt;p&gt;You may have noticed in the example above that we have used some Twig template tags referencing a request object e.g. &lt;code&gt;{{ request.getUrl() }}&lt;/code&gt;. This is in fact the PHP request instance that you created and passed to the client when sending your request, which is injected into the Twig template parser. As a result you gain full access to all the data contained within the request instance, via the data accessor methods.&lt;/p&gt;
+
+&lt;p&gt;A default request instance contains the following accessors:&lt;/p&gt;
+
+&lt;table&gt;
+  &lt;thead&gt;
+    &lt;tr&gt;
+      &lt;th style=&quot;text-align: center&quot;&gt;Accessor&lt;/th&gt;
+      &lt;th&gt;Description&lt;/th&gt;
+      &lt;th style=&quot;text-align: center&quot;&gt;Twig example&lt;/th&gt;
+    &lt;/tr&gt;
+  &lt;/thead&gt;
+  &lt;tbody&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getMethod()&lt;/td&gt;
+      &lt;td&gt;The request method e.g. GET.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getMethod() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getTimeout()&lt;/td&gt;
+      &lt;td&gt;The request timeout period in milliseconds.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getTimeout() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getDelay()&lt;/td&gt;
+      &lt;td&gt;The page render delay in seconds.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getDelay() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getUrl()&lt;/td&gt;
+      &lt;td&gt;The request URL.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getUrl() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getBody()&lt;/td&gt;
+      &lt;td&gt;The request body (POST, PUT).&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getBody() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getHeaders(&lt;em&gt;format&lt;/em&gt;)&lt;/td&gt;
+      &lt;td&gt;The request headers.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getHeaders(‘json’) }}&lt;/td&gt;
+    &lt;/tr&gt;
+  &lt;/tbody&gt;
+&lt;/table&gt;
+
+&lt;p&gt;A capture request contains a few additional ones:&lt;/p&gt;
+
+&lt;table&gt;
+  &lt;thead&gt;
+    &lt;tr&gt;
+      &lt;th style=&quot;text-align: center&quot;&gt;Accessor&lt;/th&gt;
+      &lt;th&gt;Description&lt;/th&gt;
+      &lt;th style=&quot;text-align: center&quot;&gt;Twig example&lt;/th&gt;
+    &lt;/tr&gt;
+  &lt;/thead&gt;
+  &lt;tbody&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getRectTop()&lt;/td&gt;
+      &lt;td&gt;The x coordinate of the capture region.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getRectTop() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getRectLeft()&lt;/td&gt;
+      &lt;td&gt;The y coordinate of the capture region.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getRectLeft() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getRectWidth()&lt;/td&gt;
+      &lt;td&gt;The width of the capture region.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getRectWidth() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getRectHeight()&lt;/td&gt;
+      &lt;td&gt;The height of the capture region.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getRectHeight() }}&lt;/td&gt;
+    &lt;/tr&gt;
+    &lt;tr&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;getCaptureFile()&lt;/td&gt;
+      &lt;td&gt;The file to save the capture to.&lt;/td&gt;
+      &lt;td style=&quot;text-align: center&quot;&gt;{{ request.getCaptureFile() }}&lt;/td&gt;
+    &lt;/tr&gt;
+  &lt;/tbody&gt;
+&lt;/table&gt;
+
+&lt;p&gt;If you would like to inject additional data into your script through custom accessors, simply extend the request class with your own:&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\Message\Request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CustomRequest&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Request&lt;/span&gt;
+    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
+    
+        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getSomething&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;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Something!&amp;#39;&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;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;Now you will be able to access the data in your custom script when using your custom request:&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;// my_procedure.proc&lt;/span&gt;
+
+    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;something&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{{ request.getSomething() }}&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Get something&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 to use your custom request simply create a new instance of it and pass it to the 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;$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;$request&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;CustomRequest&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;setMethod&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;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;setUrl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://www.google.com&amp;#39;&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;h3 id=&quot;loading-your-script&quot;&gt;Loading your script&lt;/h3&gt;
+
+&lt;p&gt;Now that you have your custom script and you’ve added your custom request parameters, you may be wondering how to tell the client to actually load your script. This is done by creating a procedure loader and telling it where to find your script files.&lt;/p&gt;
+
+&lt;p&gt;The service container has a factory that makes creating a new procedure loader easy:&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;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\DependencyInjection\ServiceContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/path/to/your/procedure/directory&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$serviceContainer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ServiceContainer&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;$procedureLoader&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$serviceContainer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;procedure_loader_factory&amp;#39;&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;createProcedureLoader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+        
+    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;The client contains a chain procedure loader which lets you set multiple loaders at the same time. Ultimately this means that you can load your custom scripts while still maintaining the ability to load the default scripts if you choose. &lt;/p&gt;
+
+&lt;p&gt;Now add your procedure loader to the chain loader:&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;o&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;getProcedureLoader&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;addLoader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$procedureLoader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;The last thing you need to do is to tell the request which script you want to load for that request. This is done by setting the request type to the name of your procedure file, minus the extension:&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;o&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;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;setType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;my_procedure&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
+    
+    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;Or if you are using a custom request as outlined in the &lt;a href=&quot;#using-custom-request-parameters-in-your-script&quot;&gt;custom request parameters&lt;/a&gt; section, you can implement a getType method which returns the name of your procedure, eliminating the need to set the request type for each 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\Message\Request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CustomRequest&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Request&lt;/span&gt;
+    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
+    
+        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getType&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;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;my_procedure&amp;#39;&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;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;p&gt;Below is a full example for clarity:&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;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JonnyW\PhantomJs\DependencyInjection\ServiceContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/path/to/your/procedure/directory&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
+    
+    &lt;span class=&quot;nv&quot;&gt;$serviceContainer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ServiceContainer&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;$procedureLoader&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$serviceContainer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;procedure_loader_factory&amp;#39;&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;createProcedureLoader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$location&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;getProcedureLoader&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;addLoader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$procedureLoader&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;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;setType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;my_procedure&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;
+
+&lt;blockquote&gt;
+  &lt;h4 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h4&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;/debugging.html&quot;&gt;debugging&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>
@@ -525,8 +854,8 @@ code etc.&lt;/li&gt;
 &lt;p&gt;In the meantime, check out the &lt;a href=&quot;https://github.com/jonnnnyw/php-phantomjs/tree/master/examples&quot;&gt;examples&lt;/a&gt; in the Github repo.&lt;/p&gt;
 </description>
 				<pubDate>Thu, 24 Jul 2014 00:00:00 +0100</pubDate>
-				<link>http://jonnnnyw.github.io/php-phantomjs/debugging.html</link>
-				<guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/debugging.html</guid>
+				<link>/debugging.html</link>
+				<guid isPermaLink="true">/debugging.html</guid>
 			</item>
 		
 			<item>
@@ -534,8 +863,8 @@ code etc.&lt;/li&gt;
 				<description>&lt;p&gt;This documentation page will be up in the next couple of days.&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>

+ 32 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -190,9 +190,11 @@ code etc.</li>
 
 <p>Finally, install PHP PhantomJS from the root of your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+    
+    <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>
 
@@ -245,7 +247,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>
 
 
     
@@ -261,7 +263,7 @@ code etc.</li>
 
   
   <li class="next">
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page2">Next &rarr;</a>
+    <a href="/page2">Next &rarr;</a>
   </li>
   
 
@@ -277,9 +279,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>

+ 45 - 32
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -145,7 +145,14 @@
 	<div class="col-sm-10">
 	
 	  <div class="article_body">
-	  <h2 id="prerequisites">Prerequisites</h2>
+	  <ul>
+  <li><a href="#prerequisites">Prerequisites</a></li>
+  <li><a href="#installing-via-composer">Installing via Composer</a></li>
+  <li><a href="#custom-installation">Custom Installation</a></li>
+  <li><a href="#installing-from-tarball">Installing from tarball</a></li>
+</ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
 
 <p>PHP PhantomJS requires PHP <strong>5.3.0</strong> or greater to run.</p>
 
@@ -153,7 +160,9 @@
 
 <p>Install <a href="https://getcomposer.org/">Composer</a> for your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">curl -s http://getcomposer.org/installer <span class="p">|</span> php</code></pre></div>
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+
+    <span class="nv">$ </span>curl -s http://getcomposer.org/installer <span class="p">|</span> php</code></pre></div>
 
 <p>Create a <code>composer.json</code> file in the root of your project:</p>
 
@@ -178,7 +187,9 @@
 
 <p>Finally, install the composer depedencies for your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">php composer.phar install</code></pre></div>
+<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>
 
 <h2 id="custom-installation">Custom Installation</h2>
 
@@ -203,7 +214,9 @@
 
 <p>Once you have updated your bin location run composer install to install PhantomJS:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">php composer.phar install</code></pre></div>
+<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 the correct PhantomJS executable for your system to the bin locaiton you defined in your <code>composer.json</code> file. As mentioned above, you will need to tell the client where to find your PhantomJS executable as it is not installed in the default location:</p>
 
@@ -239,10 +252,10 @@
 
 		<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/introduction.html" title="Introduction">Introduction &rarr;</a></li>
+		  <li class="next"><a href="/introduction.html" title="Introduction">Introduction &rarr;</a></li>
 		  
 		</ul>
 
@@ -265,9 +278,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>

+ 32 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -188,9 +188,11 @@ code etc.</li>
 
 <p>Finally, install PHP PhantomJS from the root of your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+    
+    <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>
 
@@ -243,7 +245,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>
@@ -254,7 +256,7 @@ code etc.</li>
 
 		<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>
 		  
 		  
 		</ul>
@@ -278,9 +280,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>

+ 45 - 32
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -147,7 +147,14 @@
 
   <div>
     
-    <h2 id="prerequisites">Prerequisites</h2>
+    <ul>
+  <li><a href="#prerequisites">Prerequisites</a></li>
+  <li><a href="#installing-via-composer">Installing via Composer</a></li>
+  <li><a href="#custom-installation">Custom Installation</a></li>
+  <li><a href="#installing-from-tarball">Installing from tarball</a></li>
+</ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
 
 <p>PHP PhantomJS requires PHP <strong>5.3.0</strong> or greater to run.</p>
 
@@ -155,7 +162,9 @@
 
 <p>Install <a href="https://getcomposer.org/">Composer</a> for your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">curl -s http://getcomposer.org/installer <span class="p">|</span> php</code></pre></div>
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+
+    <span class="nv">$ </span>curl -s http://getcomposer.org/installer <span class="p">|</span> php</code></pre></div>
 
 <p>Create a <code>composer.json</code> file in the root of your project:</p>
 
@@ -180,7 +189,9 @@
 
 <p>Finally, install the composer depedencies for your project:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">php composer.phar install</code></pre></div>
+<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>
 
 <h2 id="custom-installation">Custom Installation</h2>
 
@@ -205,7 +216,9 @@
 
 <p>Once you have updated your bin location run composer install to install PhantomJS:</p>
 
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">php composer.phar install</code></pre></div>
+<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 the correct PhantomJS executable for your system to the bin locaiton you defined in your <code>composer.json</code> file. As mentioned above, you will need to tell the client where to find your PhantomJS executable as it is not installed in the default location:</p>
 
@@ -245,14 +258,14 @@
   
   <li class="previous">
     
-    <a href="http://jonnnnyw.github.io/php-phantomjs/">&larr; Previous</a>
+    <a href="/">&larr; Previous</a>
     
   </li>
   
 
   
   <li class="next">
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page3">Next &rarr;</a>
+    <a href="/page3">Next &rarr;</a>
   </li>
   
 
@@ -268,9 +281,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 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -160,7 +160,7 @@
   <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>
 
 <h2 id="basic-request">Basic Request</h2>
 
@@ -321,7 +321,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/debugging.html">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="/debugging.html">debug log</a> for more detailed information about what may have gone wrong.</p>
 
 <h2 id="screen-captures">Screen Captures</h2>
 
@@ -452,14 +452,14 @@
   
   <li class="previous">
     
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page2">&larr; Previous</a>
+    <a href="/page2">&larr; Previous</a>
     
   </li>
   
 
   
   <li class="next">
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page4">Next &rarr;</a>
+    <a href="/page4">Next &rarr;</a>
   </li>
   
 
@@ -475,9 +475,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>

+ 344 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -147,9 +147,323 @@
 
   <div>
     
-    <p>This documentation page will be up in the next couple of days.</p>
+    <ul>
+  <li><a href="#phantomjs-command-line-options">PhantomJS command line options</a></li>
+  <li><a href="#custom-phantom-js-scripts">Custom PhantomJS scripts</a>
+    <ul>
+      <li><a href="#writing-a-custom-script">Writing a custom script</a></li>
+      <li><a href="#using-custom-request-parameters-in-your-script">Using custom request parameters in your script</a></li>
+      <li><a href="#loading-your-script">Loading your script</a></li>
+    </ul>
+  </li>
+</ul>
+
+<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>
+
+<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">addOption</span><span class="p">(</span><span class="s1">&#39;--load-images=true&#39;</span><span class="p">);</span>
+    <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">addOption</span><span class="p">(</span><span class="s1">&#39;--ignore-ssl-errors=true&#39;</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></code></pre></div>
+
+<p>You can also set a path to a JSON configuration file that contains multiple PhantomJS options:</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">addOption</span><span class="p">(</span><span class="s1">&#39;--config=/path/to/config.json&#39;</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></code></pre></div>
+
+<p>See the <a href="http://phantomjs.org/api/command-line.html">PhantomJS Documentation</a> for a full list of command line options.</p>
+
+<h2 id="custom-phantomjs-scripts">Custom PhantomJS scripts</h2>
+
+<p>In most instances you shouldn’t need to worry about the javascript files that run the PHP PhantomJS library but there may be times when you want to execute your own custom PhantomJS scripts through the client. This can be easily achieved by using the built in script loader.</p>
+
+<p>Script files or ‘procedures’ as they are referred to in the application are closely mapped to requests. When you create a default request instance, you are essentially running the default javascript procedure that comes bundled with the application. When you create a capture request you are running the capture procedure.</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">-&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="c1">// ~/Resources/procedures/default.proc</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="c1">// ~/Resources/procedures/capture.proc</span></code></pre></div>
+
+<h3 id="writing-a-custom-script">Writing a custom script</h3>
+
+<p>The first step in creating your script is to create a procedure file somewhere. For the purpose of this guide we will refer to it as <code>my_procedure.proc</code> but in reality it can be called anything you like. The only requirement is that the file extension must be <code>.proc</code>.</p>
+
+<p>Create the file somewhere and make sure it can be read by your application. Make a note of the path to the directory where your file is created as you will need this when loading your script which is explained later in this guide.</p>
+
+<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#bash</span>
+    
+    <span class="nv">$ </span>touch my_procedure.proc
+    <span class="nv">$ </span>chmod <span class="m">755</span> my_procedure.proc</code></pre></div>
+
+<p>Next open your procedure file in your text editor and write your PhantomJS script. The <a href="http://phantomjs.org/quick-start.html">PhantomJS documentation</a> has more detailed information on writing custom scripts.</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</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">page</span><span class="p">.</span><span class="nx">open</span> <span class="p">(</span><span class="s1">&#39;{{ request.getUrl() }}&#39;</span><span class="p">,</span> <span class="s1">&#39;{{ request.getMethod() }}&#39;</span><span class="p">,</span> <span class="s1">&#39;{{ request.getBody() }}&#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="c1">// It is important that you exit PhantomJS</span>
+        <span class="c1">// when your script has run or when you</span>
+        <span class="c1">// encounter an error</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="p">...</span></code></pre></div>
+
+<blockquote>
+  <h4 id="important">Important</h4>
+  <p>Make sure that <code>phantom.exit(1);</code> is always called after your script has run or if you encounter an error. This requires you to take care when handling PhantomJS errors to ensure that you exit the PhantomJS script, whether the script was successfully executed or not. If you do not call <code>phantom.exit(1);</code> then PhantomJS will continue to run until your PHP script times out. If you find that your custom script is hanging then this is most likely the cause.</p>
+</blockquote>
+
+<p>It is a good practice to create a global error handler in your script that exits PhantomJS:</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</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">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="p">...</span></code></pre></div>
+
+<h3 id="using-custom-request-parameters-in-your-script">Using custom request parameters in your script</h3>
+
+<p>Before a procedure is executed by the application it is parsed through a template parser. The PHP PhantomJS library uses the popular <a href="https://github.com/fabpot/Twig">Twig templating engine</a>. This gives you access to all the <a href="http://twig.sensiolabs.org/doc/templates.html">Twig niceness</a> which you can use in your custom scripts.</p>
+
+<p>You may have noticed in the example above that we have used some Twig template tags referencing a request object e.g. <code>{{ request.getUrl() }}</code>. This is in fact the PHP request instance that you created and passed to the client when sending your request, which is injected into the Twig template parser. As a result you gain full access to all the data contained within the request instance, via the data accessor methods.</p>
+
+<p>A default request instance contains the following accessors:</p>
+
+<table>
+  <thead>
+    <tr>
+      <th style="text-align: center">Accessor</th>
+      <th>Description</th>
+      <th style="text-align: center">Twig example</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td style="text-align: center">getMethod()</td>
+      <td>The request method e.g. GET.</td>
+      <td style="text-align: center">{{ request.getMethod() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getTimeout()</td>
+      <td>The request timeout period in milliseconds.</td>
+      <td style="text-align: center">{{ request.getTimeout() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getDelay()</td>
+      <td>The page render delay in seconds.</td>
+      <td style="text-align: center">{{ request.getDelay() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getUrl()</td>
+      <td>The request URL.</td>
+      <td style="text-align: center">{{ request.getUrl() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getBody()</td>
+      <td>The request body (POST, PUT).</td>
+      <td style="text-align: center">{{ request.getBody() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getHeaders(<em>format</em>)</td>
+      <td>The request headers.</td>
+      <td style="text-align: center">{{ request.getHeaders(‘json’) }}</td>
+    </tr>
+  </tbody>
+</table>
+
+<p>A capture request contains a few additional ones:</p>
+
+<table>
+  <thead>
+    <tr>
+      <th style="text-align: center">Accessor</th>
+      <th>Description</th>
+      <th style="text-align: center">Twig example</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td style="text-align: center">getRectTop()</td>
+      <td>The x coordinate of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectTop() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectLeft()</td>
+      <td>The y coordinate of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectLeft() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectWidth()</td>
+      <td>The width of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectWidth() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getRectHeight()</td>
+      <td>The height of the capture region.</td>
+      <td style="text-align: center">{{ request.getRectHeight() }}</td>
+    </tr>
+    <tr>
+      <td style="text-align: center">getCaptureFile()</td>
+      <td>The file to save the capture to.</td>
+      <td style="text-align: center">{{ request.getCaptureFile() }}</td>
+    </tr>
+  </tbody>
+</table>
+
+<p>If you would like to inject additional data into your script through custom accessors, simply extend the request class with your own:</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\Message\Request</span><span class="p">;</span>
+    
+    <span class="k">class</span> <span class="nc">CustomRequest</span> <span class="k">extends</span> <span class="nx">Request</span>
+    <span class="p">{</span>
+    
+        <span class="k">public</span> <span class="k">function</span> <span class="nf">getSomething</span><span class="p">()</span>
+        <span class="p">{</span>
+            <span class="k">return</span> <span class="s1">&#39;Something!&#39;</span><span class="p">;</span>
+        <span class="p">}</span>
+    <span class="p">}</span></code></pre></div>
+
+<p>Now you will be able to access the data in your custom script when using your custom request:</p>
+
+<div class="highlight"><pre><code class="language-javascript" data-lang="javascript"><span class="c1">// my_procedure.proc</span>
+
+    <span class="kd">var</span> <span class="nx">something</span> <span class="o">=</span> <span class="s1">&#39;{{ request.getSomething() }}&#39;</span><span class="p">;</span> <span class="c1">// Get something</span>
+    
+    <span class="p">...</span></code></pre></div>
+
+<p>And to use your custom request simply create a new instance of it and pass it to the 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">$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">$request</span>  <span class="o">=</span> <span class="k">new</span> <span class="nx">CustomRequest</span><span class="p">();</span>
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setMethod</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">);</span>
+    <span class="nv">$request</span><span class="o">-&gt;</span><span class="na">setUrl</span><span class="p">(</span><span class="s1">&#39;http://www.google.com&#39;</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>
+
+<h3 id="loading-your-script">Loading your script</h3>
+
+<p>Now that you have your custom script and you’ve added your custom request parameters, you may be wondering how to tell the client to actually load your script. This is done by creating a procedure loader and telling it where to find your script files.</p>
+
+<p>The service container has a factory that makes creating a new procedure loader easy:</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="k">use</span> <span class="nx">JonnyW\PhantomJs\DependencyInjection\ServiceContainer</span><span class="p">;</span>
+    
+    <span class="nv">$location</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/procedure/directory&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$serviceContainer</span> <span class="o">=</span> <span class="nx">ServiceContainer</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$procedureLoader</span> <span class="o">=</span> <span class="nv">$serviceContainer</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;procedure_loader_factory&#39;</span><span class="p">)</span>
+        <span class="o">-&gt;</span><span class="na">createProcedureLoader</span><span class="p">(</span><span class="nv">$location</span><span class="p">);</span>
+        
+    <span class="o">...</span></code></pre></div>
+
+<p>The client contains a chain procedure loader which lets you set multiple loaders at the same time. Ultimately this means that you can load your custom scripts while still maintaining the ability to load the default scripts if you choose. </p>
+
+<p>Now add your procedure loader to the chain loader:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="o">...</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">getProcedureLoader</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">addLoader</span><span class="p">(</span><span class="nv">$procedureLoader</span><span class="p">);</span>
+    
+    <span class="o">...</span></code></pre></div>
+
+<p>The last thing you need to do is to tell the request which script you want to load for that request. This is done by setting the request type to the name of your procedure file, minus the extension:</p>
+
+<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp">&lt;?php</span>
+
+    <span class="o">...</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="nv">$request</span><span class="o">-&gt;</span><span class="na">setType</span><span class="p">(</span><span class="s1">&#39;my_procedure&#39;</span><span class="p">);</span>
+    
+    <span class="o">...</span></code></pre></div>
+
+<p>Or if you are using a custom request as outlined in the <a href="#using-custom-request-parameters-in-your-script">custom request parameters</a> section, you can implement a getType method which returns the name of your procedure, eliminating the need to set the request type for each 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\Message\Request</span><span class="p">;</span>
+    
+    <span class="k">class</span> <span class="nc">CustomRequest</span> <span class="k">extends</span> <span class="nx">Request</span>
+    <span class="p">{</span>
+    
+        <span class="k">public</span> <span class="k">function</span> <span class="nf">getType</span><span class="p">()</span>
+        <span class="p">{</span>
+            <span class="k">return</span> <span class="s1">&#39;my_procedure&#39;</span><span class="p">;</span>
+        <span class="p">}</span>
+    <span class="p">}</span></code></pre></div>
+
+<p>Below is a full example for clarity:</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="k">use</span> <span class="nx">JonnyW\PhantomJs\DependencyInjection\ServiceContainer</span><span class="p">;</span>
+    
+    <span class="nv">$location</span> <span class="o">=</span> <span class="s1">&#39;/path/to/your/procedure/directory&#39;</span><span class="p">;</span>
+    
+    <span class="nv">$serviceContainer</span> <span class="o">=</span> <span class="nx">ServiceContainer</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
+    
+    <span class="nv">$procedureLoader</span> <span class="o">=</span> <span class="nv">$serviceContainer</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;procedure_loader_factory&#39;</span><span class="p">)</span>
+        <span class="o">-&gt;</span><span class="na">createProcedureLoader</span><span class="p">(</span><span class="nv">$location</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">getProcedureLoader</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">addLoader</span><span class="p">(</span><span class="nv">$procedureLoader</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="nv">$request</span><span class="o">-&gt;</span><span class="na">setType</span><span class="p">(</span><span class="s1">&#39;my_procedure&#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></code></pre></div>
+
+<blockquote>
+  <h4 id="troubleshooting">Troubleshooting</h4>
+  <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>In the meantime, check out the <a href="https://github.com/jonnnnyw/php-phantomjs/tree/master/examples">examples</a> in the Github repo.</p>
+<p>See more detailed information about <a href="/debugging.html">debugging</a>.</p>
 
     
   </div>
@@ -163,14 +477,14 @@
   
   <li class="previous">
     
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page3">&larr; Previous</a>
+    <a href="/page3">&larr; Previous</a>
     
   </li>
   
 
   
   <li class="next">
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page5">Next &rarr;</a>
+    <a href="/page5">Next &rarr;</a>
   </li>
   
 
@@ -186,9 +500,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>

+ 28 - 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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -163,14 +163,14 @@
   
   <li class="previous">
     
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page4">&larr; Previous</a>
+    <a href="/page4">&larr; Previous</a>
     
   </li>
   
 
   
   <li class="next">
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page6">Next &rarr;</a>
+    <a href="/page6">Next &rarr;</a>
   </li>
   
 
@@ -186,9 +186,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>

+ 27 - 27
_site/page6/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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -161,7 +161,7 @@
   
   <li class="previous">
     
-    <a href="http://jonnnnyw.github.io/php-phantomjs/page5">&larr; Previous</a>
+    <a href="/page5">&larr; Previous</a>
     
   </li>
   
@@ -180,9 +180,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>

+ 27 - 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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -156,7 +156,7 @@
 		<ul class="pager">
 		  
 		  
-		  <li class="next"><a href="http://jonnnnyw.github.io/php-phantomjs/debugging.html" title="Debugging">Debugging &rarr;</a></li>
+		  <li class="next"><a href="/debugging.html" title="Debugging">Debugging &rarr;</a></li>
 		  
 		</ul>
 
@@ -179,9 +179,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 - 30
_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,7 +28,7 @@
 	<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>
         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -60,8 +60,8 @@
 			
 			-->
 			
-			<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>
@@ -69,12 +69,12 @@
 		<!-- 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/debugging.html">Debugging</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="/debugging.html">Debugging</a></li>
+				<li><a href="/troubleshooting.html">Troubleshooting</a></li>
 			</ul>
 		</div><!-- /.navbar-collapse -->
 	</nav>
@@ -85,12 +85,12 @@
 			<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/debugging.html"><i class="fa fa-folder"></i>Debugging</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="/debugging.html"><i class="fa fa-folder"></i>Debugging</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>
@@ -99,11 +99,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>
 
@@ -124,7 +124,7 @@
 		
 		
 		<li>
-			<a class="btn btn-default btn-sm" href="http://jonnnnyw.github.io/php-phantomjs/feed.xml">
+			<a class="btn btn-default btn-sm" href="/feed.xml">
 				<i class="fa fa-rss fa-lg"></i>
 			</a>
 		</li>
@@ -158,7 +158,7 @@
   <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>
 
 <h2 id="basic-request">Basic Request</h2>
 
@@ -319,7 +319,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/debugging.html">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="/debugging.html">debug log</a> for more detailed information about what may have gone wrong.</p>
 
 <h2 id="screen-captures">Screen Captures</h2>
 
@@ -446,10 +446,10 @@
 
 		<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>
 		  
 		  
-		  <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>
 
@@ -472,9 +472,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>

+ 1 - 0
assets/css/style.css

@@ -82,6 +82,7 @@ article .share .gplus:hover {
 }
 
 .page-header {
+    padding: 0 5% 0;
 	color: #e74c3c;
 	text-shadow: 1px 1px 1px rgba(150, 150, 150, 1);
 }