|
|
@@ -3,8 +3,8 @@
|
|
|
<channel>
|
|
|
<title>PHP PhantomJs</title>
|
|
|
<description>Run PhantomJS scripts through PHP</description>
|
|
|
- <link>/</link>
|
|
|
- <atom:link href="/feed.xml" rel="self" type="application/rss+xml" />
|
|
|
+ <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" />
|
|
|
|
|
|
<item>
|
|
|
<title>Introduction</title>
|
|
|
@@ -59,7 +59,7 @@ code etc.</li>
|
|
|
|
|
|
<span class="nv">$ </span>composer require <span class="s2">&quot;jonnyw/php-phantomjs:3.*&quot;</span></code></pre></div>
|
|
|
|
|
|
-<p>If you would like to use another installation method or would like to see more detailed installation instructions, see the <a href="/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="http://jonnnnyw.github.io/php-phantomjs/installation.html">installation</a> documentation.</p>
|
|
|
|
|
|
<h2 id="basic-usage">Basic Usage</h2>
|
|
|
|
|
|
@@ -112,12 +112,12 @@ 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="/usage.html">usage</a> section, or to create your own custom scripts check out the <a href="/advanced.html">advanced</a> documentation.</p>
|
|
|
+<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>
|
|
|
|
|
|
</description>
|
|
|
<pubDate>Mon, 28 Jul 2014 00:00:00 +0100</pubDate>
|
|
|
- <link>/introduction.html</link>
|
|
|
- <guid isPermaLink="true">/introduction.html</guid>
|
|
|
+ <link>http://jonnnnyw.github.io/php-phantomjs/introduction.html</link>
|
|
|
+ <guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/introduction.html</guid>
|
|
|
</item>
|
|
|
|
|
|
<item>
|
|
|
@@ -181,7 +181,14 @@ code etc.</li>
|
|
|
<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">setPhantomJs</span><span class="p">(</span><span class="s1">&#39;/path/to/phantomjs&#39;</span><span class="p">);</span></code></pre></div>
|
|
|
|
|
|
-<p>If you would like composer to install the PhantomJS executable to a custom location when installing dependencies, set the bin dir location in your project’s <code>composer.json</code> file:</p>
|
|
|
+<blockquote>
|
|
|
+ <h4 id="important">Important</h4>
|
|
|
+ <p>The PHP PhantomJS library also requires a <code>phantomloader</code> file that comes bundled with the library and is installed to the bin folder defined in your <code>composer.json</code> file. If you are setting a custom path to the PhantomJS executable, you need to make sure that the <code>phantomloader</code> file can be found in the bin folder it was installed to.</p>
|
|
|
+
|
|
|
+ <p>See below if you wish to use a custom bin folder.</p>
|
|
|
+</blockquote>
|
|
|
+
|
|
|
+<p>If you would like composer to install all executable files to a custom bin location when installing dependencies, set the bin dir location in your project’s <code>composer.json</code> file:</p>
|
|
|
|
|
|
<div class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="c1">#composer.json</span>
|
|
|
|
|
|
@@ -199,14 +206,16 @@ code etc.</li>
|
|
|
|
|
|
<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>
|
|
|
+<p>This should install the correct PhantomJS executable for your system and the required <code>phantomloader</code> file to the bin locaiton you defined in your <code>composer.json</code> file. </p>
|
|
|
+
|
|
|
+<p>Now you need to tell the client where to find your bin folder:</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">setPhantomJs</span><span class="p">(</span><span class="s1">&#39;/path/to/phantomjs&#39;</span><span class="p">);</span></code></pre></div>
|
|
|
+ <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">setBinDir</span><span class="p">(</span><span class="s1">&#39;/path/to/bin/dir&#39;</span><span class="p">);</span></code></pre></div>
|
|
|
|
|
|
<h2 id="installing-from-tarball">Installing from tarball</h2>
|
|
|
|
|
|
@@ -226,8 +235,8 @@ code etc.</li>
|
|
|
<p>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 <a href="#custom-installation">Custom Installation</a> section.</p>
|
|
|
</description>
|
|
|
<pubDate>Sun, 27 Jul 2014 00:00:00 +0100</pubDate>
|
|
|
- <link>/installation.html</link>
|
|
|
- <guid isPermaLink="true">/installation.html</guid>
|
|
|
+ <link>http://jonnnnyw.github.io/php-phantomjs/installation.html</link>
|
|
|
+ <guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/installation.html</guid>
|
|
|
</item>
|
|
|
|
|
|
<item>
|
|
|
@@ -245,7 +254,7 @@ code etc.</li>
|
|
|
<li><a href="#custom-run-options">Custom Run Options</a></li>
|
|
|
</ul>
|
|
|
|
|
|
-<p>For more advanced customization or to load your own PhantomJS scripts, see the <a href="/advanced.html">advanced</a> documentation.</p>
|
|
|
+<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>
|
|
|
|
|
|
<h2 id="basic-request">Basic Request</h2>
|
|
|
|
|
|
@@ -406,7 +415,7 @@ code etc.</li>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
-<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>
|
|
|
+<p>If the response contains a status code of 0, chances are the request failed. Check the request <a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html#debugging">debug log</a> for more detailed information about what may have gone wrong.</p>
|
|
|
|
|
|
<h2 id="screen-captures">Screen Captures</h2>
|
|
|
|
|
|
@@ -526,15 +535,15 @@ code etc.</li>
|
|
|
<p>See the <a href="http://phantomjs.org/api/command-line.html">PhantomJS Documentation</a> for a full list of command line options.</p>
|
|
|
</description>
|
|
|
<pubDate>Sat, 26 Jul 2014 00:00:00 +0100</pubDate>
|
|
|
- <link>/usage.html</link>
|
|
|
- <guid isPermaLink="true">/usage.html</guid>
|
|
|
+ <link>http://jonnnnyw.github.io/php-phantomjs/usage.html</link>
|
|
|
+ <guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/usage.html</guid>
|
|
|
</item>
|
|
|
|
|
|
<item>
|
|
|
<title>Advanced Usage</title>
|
|
|
<description><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>
|
|
|
+ <li><a href="#custom-phantomjs-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>
|
|
|
@@ -664,6 +673,16 @@ code etc.</li>
|
|
|
<td>The page render delay in seconds.</td>
|
|
|
<td style="text-align: center">{{ request.getDelay() }}</td>
|
|
|
</tr>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align: center">getViewportWidth()</td>
|
|
|
+ <td>The viewport width.</td>
|
|
|
+ <td style="text-align: center">{{ request.getViewportWidth() }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align: center">getViewportHeight()</td>
|
|
|
+ <td>The viewport height.</td>
|
|
|
+ <td style="text-align: center">{{ request.getViewportHeight() }}</td>
|
|
|
+ </tr>
|
|
|
<tr>
|
|
|
<td style="text-align: center">getUrl()</td>
|
|
|
<td>The request URL.</td>
|
|
|
@@ -848,11 +867,11 @@ code etc.</li>
|
|
|
<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>
|
|
|
+<p>See more detailed information about <a href="http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html">troubleshooting</a>.</p>
|
|
|
</description>
|
|
|
<pubDate>Fri, 25 Jul 2014 00:00:00 +0100</pubDate>
|
|
|
- <link>/advanced.html</link>
|
|
|
- <guid isPermaLink="true">/advanced.html</guid>
|
|
|
+ <link>http://jonnnnyw.github.io/php-phantomjs/advanced.html</link>
|
|
|
+ <guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/advanced.html</guid>
|
|
|
</item>
|
|
|
|
|
|
<item>
|
|
|
@@ -860,8 +879,8 @@ code etc.</li>
|
|
|
<description><p>This documentation page will be up in the next couple of days.</p>
|
|
|
</description>
|
|
|
<pubDate>Wed, 23 Jul 2014 00:00:00 +0100</pubDate>
|
|
|
- <link>/troubleshooting.html</link>
|
|
|
- <guid isPermaLink="true">/troubleshooting.html</guid>
|
|
|
+ <link>http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html</link>
|
|
|
+ <guid isPermaLink="true">http://jonnnnyw.github.io/php-phantomjs/troubleshooting.html</guid>
|
|
|
</item>
|
|
|
|
|
|
</channel>
|