<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 11:46:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Segment.io: How to Make Async Requests in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19142</guid>
      <link>http://www.phpdeveloper.org/news/19142</link>
      <description><![CDATA[<p>
On the Segment.io blog there's a new post by <i>Calvin</i> talking about <a href="https://segment.io/blog/how-to-make-async-requests-in-php/">making asyncronous requests in PHP</a> and three different approaches you could use, depending on your situation.
</p>
<blockquote>
When designing client libraries to send data to our API, one of our top priorities is to make sure that none of our code affects the performance of your core application. That is tricky when you have a single-threaded, "shared-nothing" language like PHP. [...] Ideally, we like to keep the setup process minimal and address a wide variety of use cases. As long as it runs with PHP (and possibly a common script or two), you should be ready to dive right in. We ended up experimenting with three main approaches to make requests in PHP. Here's what we learned.
</blockquote>
<p>
Their three suggestions don't involve external dependencies (like a queue server) and can operate pretty quickly:
</p>
<ul>
<li>Opening a socket and closing it before waiting for a response
<li>Write to a log file (a pseudo-queue)
<li>Fork a curl process (through something like <a href="http://php.net/exec">exec</a>)
</ul>
<p>
They each have small code examples included with them and explanations as to their plusses and minuses. For their needs, the "forked curl" solution worked out the best, but check out the other options too - you might have different needs.
</p>]]></description>
      <pubDate>Wed, 06 Feb 2013 09:52:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Smashing Magazine: Powerful Command Line Tools For Developers]]></title>
      <guid>http://www.phpdeveloper.org/news/18675</guid>
      <link>http://www.phpdeveloper.org/news/18675</link>
      <description><![CDATA[<p>
On the Smashing Magazine site today they've <a href="http://coding.smashingmagazine.com/2012/10/29/powerful-command-line-tools-developers/">posted a list of powerful CLI tools</a> that every developer should at least know about to help make their lives easier - six of them ranging from SSH tunnels to HTTP testing.
</p>
<blockquote>
Good tools are invaluable in figuring out where problems lie, and can also help to prevent problems from occurring in the first place, or just help you to be more efficient in general. Command line tools are particularly useful because they lend themselves well to automation and scripting, where they can be combined and reused in all sorts of different ways. Here we cover six particularly powerful and versatile tools which can help make your life a little bit easier.
</blockquote>
<p>The tools they mention are all things you'd install on a unix-based system:</p>
<ul>
<li>Curl
<li>Ngrep (network packet searching)
<li>Netcat (to work with network connections)
<li>Sshuttle (SSH tunneling)
<li>Siege (HTTP benchmarking)
<li>Mitmproxy (capturing proxy, both HTTP and HTTPS)
</ul>]]></description>
      <pubDate>Tue, 30 Oct 2012 10:18:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Maclean: Why one-line installers are a bad idea]]></title>
      <guid>http://www.phpdeveloper.org/news/18505</guid>
      <link>http://www.phpdeveloper.org/news/18505</link>
      <description><![CDATA[<p>
There's a feature that's usage has been showing up more and more in software projects (both open source and not) that allows you to install their system with a single line command, usually involving curl and maybe piping it to a shell. In <a href="http://mgdm.net/weblog/why-one-line-installers-are-bad/">this recent post</a> <i>Michael Maclean</i> takes a look at this trend and some of the possible pitfalls of the approach.
</p>
<blockquote>
There has been a trend in the last while for various bits of useful software to have a one-line shell command recommended as the installation method. The usual form of this is to pipe something like curl or wget to some interpreter, be it bash, php, ruby, or some such. [...] This [type of] command takes the output of curl and pipes it straight to bash. I have several issues with this.
</blockquote>
<p>
His three main points center around the fact that you cannot inspect the code before executing it with this method, that you can't verify the source of the code and that it teaches users bad habits of trusting in "magic commands" like these.
</p>]]></description>
      <pubDate>Fri, 21 Sep 2012 11:35:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Patrick van Kouteren: CloudVPS object store beta introduction]]></title>
      <guid>http://www.phpdeveloper.org/news/18414</guid>
      <link>http://www.phpdeveloper.org/news/18414</link>
      <description><![CDATA[<p>
<i>Patrick van Kouteren</i> has <a href="http://www.vankouteren.eu/blog/2012/08/cloudvps-object-store-beta-introduction/">a new tutorial posted</a> to his site showing you how to connect your application with an OpenStack instance (specifically the <a href="https://www.cloudvps.com/community/knowledge-base/cloudvps-object-store/">CloudVPS</a> option) via some simple CURL commands (easily translatable <a href="http://php.net/curl">into PHP</a>).
</p> 
<blockquote>
Lately I've been playing around with the <a href="https://www.cloudvps.com/community/knowledge-base/cloudvps-object-store/">CloudVPS ObjectStore</a>, which is currently in beta phase. This blogpost shows the options of this ObjectStore in a practical way and concludes with a summary of commands you can use yourself to interact with it and some ideas. For this post, I assume you are familiar with cURL, REST and HTTP headers.
</blockquote>
<p>He shows how to make the requests for:</p>
<ul>
<li>Authentication
<li>Working with containers
<li>Adding files to a container
<li>Setting access permissions
</ul>]]></description>
      <pubDate>Tue, 28 Aug 2012 12:52:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Building a simple API proxy server with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18358</guid>
      <link>http://www.phpdeveloper.org/news/18358</link>
      <description><![CDATA[<p>
In some of his work with <a href="http://backbonejs.org/">Backbone.js</a> recently, <i>Gonzalo Ayuso</i> has been frustrated by something that's a wall for many developers wanting to work with outside datasources - the browser restriction that prevents cross-domain requests. His solution? Create <a href="http://gonzalo123.wordpress.com/2012/08/13/building-a-simple-api-proxy-server-with-php/">a REST proxy</a> to live on his server and pass the requests through.
</p>
<blockquote>
Nowadays there is a header to allow it: <a href="https://developer.mozilla.org/en-US/docs/HTTP_access_control">Access-Control-Allow-Origin</a>. The problem is that the remote server must set up this header. For example I was playing with github's API and github doesn't have this header. If the server is my server, is pretty straightforward to put this header but obviously I'm not the sysadmin of github, so I cannot do it. What the solution? One possible solution is, for example, create a proxy server at localhost with PHP. 
</blockquote>
<p>
He shares the full code for his project - basically a handler that takes the incoming request and mirrors to out to the public, remote API - request method and all. It uses some of the packages from Symfony (like the http-foundation) and <a href="https://github.com/gonzalo123/rest-proxy/blob/master/lib/RestProxy/CurlWrapper.php">wraps around cURL</a> to handle the requests. The project is <a href="http://packagist.org/packages/gonzalo123/rest-proxy">available for Composer users</a> as well.
</p>]]></description>
      <pubDate>Tue, 14 Aug 2012 11:07:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Design Aeon: Check Dead Links From Database Using PHP CURL]]></title>
      <guid>http://www.phpdeveloper.org/news/18105</guid>
      <link>http://www.phpdeveloper.org/news/18105</link>
      <description><![CDATA[<p>
On DesignAeon.com there's a recent tutorial posted showing you how to extract URLs from your database and <a href="http://www.designaeon.com/check-dead-links-from-database-using-php-curl/">determine which ones are "dead"</a> automatically with the help of <a href="http://php.net/curl">cURL</a>.
</p>
<blockquote>
Checking Deadlinks From the database manually is a Headache ,So why not use a script which return the http status of the particular link and tell us if the link is dead or not.So how do we check the dead links from the database ? How do we programatically  check whether the link is dead or not ? To check broken or dead links from Database we will use curl .
</blockquote>
<p>
Included in the post is a <a href="http://www.designaeon.com/check-dead-links-from-database-using-php-curl/">sample script</a> that extracts the URLs from a field in the database (you'd need some extra smarts if you're pulling it from content) and running it though a "checklink" function. If the call to <a href="http://php.net/curl_getinfo">curl_getinfo</a> returns false, the link is marked dead.
</p>]]></description>
      <pubDate>Mon, 18 Jun 2012 09:45:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: REST - Can You do More than Spell It? Part 3]]></title>
      <guid>http://www.phpdeveloper.org/news/17952</guid>
      <link>http://www.phpdeveloper.org/news/17952</link>
      <description><![CDATA[<p>
On PHPMaster.com they've posted <a href="http://phpmaster.com/rest-can-you-do-more-than-spell-it-3/">the third part</a> of their series looking at development around RESTful APIs. In this latest article they take an outsider's perspective and look at using services rather than creating one from scratch. (<a href="http://phpdeveloper.org/news/17881">Part 1</a>, <a href="http://phpdeveloper.org/news/17912">Part 2</a>)
</p>
<blockquote>
Imagine it's a warm, sunny, summer day. You're just walking along, taking a leisurely noonday stroll, when all of a sudden you come face to face with a RESTful API. What do you do? How do you interface with it? Or, as those of us in the know would say, "how do you consume RESTful services?" That, my friends, is the subject of this article.
</blockquote>
<p>
They mention using other tools (like components/features of common frameworks) to interface with the services, but end up using the <a href="http://php.net/curl">curl</a> extension to make  a POST request to a service to add a few events to a "/summerschedule" resource.
</p>]]></description>
      <pubDate>Mon, 14 May 2012 09:41:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[XPertDeveloper.com: Get Facebook Page Detail Using Graph API and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17338</guid>
      <link>http://www.phpdeveloper.org/news/17338</link>
      <description><![CDATA[<p>
New from the XPertDeveloper.com blog there's a tutorial showing how to <a href="http://www.xpertdeveloper.com/2012/01/facebook-page-detail-using-graph-api-and-php/">use the Facebook graph API to get page details</a> via a simple cURL request (<a href="http://pecl.php.net/curl">cURL PHP support required</a> for the example).
</p>
<blockquote>
Here is the technique to get the detail of the Facebook page with Graph API and PHP. This is the very easy method to get the Facebook page detail. So Let's see how to get this done. With this method you can get details of any Facebook page [inluding] name, picture, link, website, products, description and if the user can post to it.
</blockquote>
<p>
The sample code is only a few lines - it uses the Facebook page ID (easy to grab from the URL) and fetches a URL with it as a parameter. The output is returned as a standard PHP object with all of the properties attached (decoded from JSON). This is just one of many methods the Facebook graph API has, so check out <a href="http://graph.facebook.com">their documentation</a> for more methods and details on returned values.
</p>]]></description>
      <pubDate>Tue, 03 Jan 2012 11:06:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL]]></title>
      <guid>http://www.phpdeveloper.org/news/17161</guid>
      <link>http://www.phpdeveloper.org/news/17161</link>
      <description><![CDATA[<p>
On her blog today <i>Lorna Mitchell</i> has a quick tip for anyone having an issue sending POSTed JSON data with the <a href="http://php.net/curl">curl</a> functionality that can be built into PHP. The <a href="http://www.lornajane.net/posts/2011/posting-json-data-with-php-curl">trick to her method</a> is sending things with the right header.
</p>
<blockquote>
We can't send post fields, because we want to send JSON, not pretend to be a form (the merits of an API which accepts POST requests with data in form-format is an interesting debate). Instead, we create the correct JSON data, set that as the body of the POST request, and also set the headers correctly so that the server that receives this request will understand what we sent.
</blockquote>
<p>
She includes a code example (about ten lines) showing the POSTing process that sets up options using curl's <a href="http://php.net/curl_setopt">curl_setopt</a>. Be sure to set up the headers to send as "application/json" - that's the trick to letting the remote end know the format.
</p>]]></description>
      <pubDate>Tue, 22 Nov 2011 18:06:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic's Blog: Benchmarking pages behind a login with ab]]></title>
      <guid>http://www.phpdeveloper.org/news/17124</guid>
      <link>http://www.phpdeveloper.org/news/17124</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has a recent post showing you how to use the "cookie jar" functionality included with Apache's "ab" benchmarking tool to <a href="http://robertbasic.com/blog/benchmarking-pages-behind-a-login-with-ab/">get behind your PHP-based login</a> with a simple curl and grep combo.
</p>
<blockquote>
Tonight I decided to relax a bit and what better way of relaxing is there for a geek then to do some bash scripting?! So for fun and no profit I decided to try and benchmark pages with <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab, Apache HTTP server benchmarking tool</a>, which are behind a login. Turns out, it's pretty easy after reading some man pages.
</blockquote>
<p>
He includes an example of the format of the "cookie jar" and the shell script he used to grab the PHP session ID from it and inject it into the "ab" call. The <a href="https://github.com/robertbasic/blog-examples/tree/master/ab-login">script is on github</a>.
</p>]]></description>
      <pubDate>Mon, 14 Nov 2011 10:12:05 -0600</pubDate>
    </item>
  </channel>
</rss>
