<?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>Wed, 23 May 2012 12:50:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Zend PHP Certification Blog: PHP Sorting Functions]]></title>
      <guid>http://www.phpdeveloper.org/news/17288</guid>
      <link>http://www.phpdeveloper.org/news/17288</link>
      <description><![CDATA[<p>
On the "Zend PHP Certification" blog (study notes), there's <a href="http://zend-php-certification.com/2011/12/20/php-sorting-functions/>a recent post</a> getting into the details of some of the sorting functions in PHP (like <a href="http://php.net/sort">sort</a> and <a href="http://php.net/natsort">natsort</a>).
</p>
<blockquote>
In all the countless hours I've spent with php, I've maybe used three or four of these sorting functions. I really had no idea that there is a total of eleven functions used for sorting arrays. Anyway, I'm betting that it may be useful to have these memorized before I take the Zend PHP Certification Exam so here is a brief overview of each one.
</blockquote>
<p>
He talks about the various flags that can be used in the sorting (for regular, numeric, string and locale-based string handling) and the parameters to call for normal sorting, "natural" sorting, reverse key sorting and others. You can find specifics on these array sorting methods <a href="http://www.php.net/manual/en/array.sorting.php">in the PHP manual</a>.
</p>]]></description>
      <pubDate>Wed, 21 Dec 2011 11:39:06 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stas Malyshev's Blog: ZF Oauth Provider]]></title>
      <guid>http://www.phpdeveloper.org/news/16783</guid>
      <link>http://www.phpdeveloper.org/news/16783</link>
      <description><![CDATA[<p>
In a new post <i>Stas Malyshev</i> has <a href="http://php100.wordpress.com/2011/08/28/zf-oauth-provider/">shared some code for an OAuth provider</a> he's written up to work specifically with <a href="http://framework.zend.com">Zend Framework</a> applications. 
</p>
<blockquote>
Zend Framework has pretty good <a href="http://en.wikipedia.org/wiki/OAuth">OAuth</a> <a href="http://framework.zend.com/manual/en/zend.oauth.introduction.html">consumer implementation</a>. However, it has <a href="http://stackoverflow.com/questions/4061435/zend-framework-oauth-provider">no support</a> for implementing OAuth provider, and it turns out that there aren't many <a href="http://stackoverflow.com/questions/6086454/pure-php-oauth-provider">other libraries</a> for it. Most examples out there base on <a href="http://php.net/oauth">PECL oauth extension</a>, which works just fine, with one caveat - you have to have this PECL extension installed, while ZF implementation does not require that. So I went ahead and wrote <a href="https://github.com/smalyshev/Zend_OAuth_Provider">some code that allows to easily add OAuth provider to your ZF-based or ZF-using application</a>. That should make writing OAuth provider easier.
</blockquote>
<p>
His code just fleshes out the server portion of the provider, not all of the token generation and key handling it'll need on the backend - that'll still be the job of your scripts. You can find the library over on github in his <a href="https://github.com/smalyshev/Zend_OAuth_Provider">Zend_OAuth_Provider</a> repository.
</p>]]></description>
      <pubDate>Mon, 29 Aug 2011 10:41:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Getting an OAuth Access Token from the Command Line]]></title>
      <guid>http://www.phpdeveloper.org/news/16448</guid>
      <link>http://www.phpdeveloper.org/news/16448</link>
      <description><![CDATA[<p>
<i>Tim Lytle</i> has written up a <a href="http://devzone.zend.com/article/15363-Getting-an-OAuth-Access-Token-from-the-Command-Line">new tutorial</a> for the Zend Developer Zone talking about OAuth and making one of the more difficult parts - getting an access token - a bit simpler using a command-line application.
</p>
<blockquote>
OAuth is great - there's no need to save users' passwords, it's - in theory - a consistent way to interact with other services, and it's hopefully something that your users are familiar and comfortable using. But if you're not just interacting with your users' accounts - for example, your application uses a single account on a service to broadcast messages, or analyze data - getting or renewing the access token can be painful.
</blockquote>
<p>
He illustrates the problem with an example connecting to Twitter and even <a href="https://gist.github.com/407858">points out a script</a> that makes bridging this gap simpler. Unfortunately, it's not exactly what he needed, so he reworked the idea with a call to the Twitter API using a Zend_Oauth_Consumer and a custom callback. The script is then set up with some command line options for inputting the key and secret information. Also included is functionality letting you define a configuration file. You can see the final result <a href="https://gist.github.com/1014769">here on github</a>.
</p>]]></description>
      <pubDate>Thu, 09 Jun 2011 11:04:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Freek Lijten's Blog: OAuth, a practical introduction with examples using the Twitter API]]></title>
      <guid>http://www.phpdeveloper.org/news/16414</guid>
      <link>http://www.phpdeveloper.org/news/16414</link>
      <description><![CDATA[<p>
<i>Freek Lijten</i> has <a href="http://www.freeklijten.nl/en/home/2011/05/18/OAuth-a-practical-introduction-with-examples-using-the-Twitter-API">posted a great introduction</a> to using OAuth in PHP via the <a href="http://nl.php.net/manual/en/oauth.setup.php">PECL OAuth package</a>.
</p>
<blockquote>
If you're a webdeveloper and haven't heard of OAuth yet, you've been living under a rock. Apparently you moved though as you're reading this. In this article I'll try to explain the concept behind OAuth, give a quick overview of the technique behind it and give a real-world example using the Twitter API and a PECL package called OAuth.
</blockquote>
<p>
He introduces you to some of the concepts behind OAuth, what it stands for and what problem it solves, and includes <a href="http://www.freeklijten.nl/l/library/download/735?ext=.png">a graphic</a> showing how a typical OAuth request happens. Next up is some code, a sample connection to an OAuth-based service to fetch a request token and apply it to your requests. His example makes a request to the <a href="http://twitter.com">Twitter</a> API.
</p>]]></description>
      <pubDate>Wed, 01 Jun 2011 12:38:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: Yahoo: oauth_problem=consumer_key_rejected]]></title>
      <guid>http://www.phpdeveloper.org/news/16370</guid>
      <link>http://www.phpdeveloper.org/news/16370</link>
      <description><![CDATA[<p>
During some of his work with the Yahoo! Search Boss API, <i>Till Klampaeckel</i> <a href="http://till.klampaeckel.de/blog/archives/153-Yahoo-oauth_problemconsumer_key_rejected.html">came across an issue</a> with the OAuth connection causing an error of "oauth_problem=consumer_key_rejected" with his Zend Framework-based application.
</p>
<blockquote>
The above process doesn't even take five minutes, but then I spent eight hours figuring out what oauth_problem=consumer_key_rejected means. Spent a couple hours googling, reading bug reports and even posted to the Yahoo! group associated with Search Boss. To cut to the chase: When you create a new project, it's not sufficient to just activate "Yahoo! Search Boss" (and provide billing details and so on).
</blockquote>
<p>
His real issue was because of how Yahoo! apparently creates (or when they create) the OAuth connection information for you. He gives a two line example of how the Zend Framework can grab a OAuth token with Zend_Oauth. He goes on to talk about the OAuth implementation in PHP and how it's "pretty sucky" and that there's not much documentation around to help. He got things working, though, and included the sample code he used to make the connection - pulling the info from a an oauth.ini file, pushing the authentication parameters to the remote side, grabbing the headers and making the HTTP request with the OAuth information in place.
</p>]]></description>
      <pubDate>Mon, 23 May 2011 09:29:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Cal Evans' Blog: Accessing Twitter via Zend_Service_Twitter]]></title>
      <guid>http://www.phpdeveloper.org/news/15803</guid>
      <link>http://www.phpdeveloper.org/news/15803</link>
      <description><![CDATA[<p>
In <a href="http://blog.calevans.com/2011/01/25/accessing-twitter-via-zend_service_twitter/">this new post</a> to his blog <i>Cal Evans</i> talks about a project he was working on that needed to interface with Twitter via their API. This, of course, requires OAuth but his script is all backend and Twitter requires a frontend to allow the application access.
</p>
<blockquote>
There is no front end at all. It just collects info and stores it in a database so I can query it later. (I'm an old-school database guy and love just writing ad-hoc queries to see what I can see) Twitter wants to redirect you to a site once you have authorized access. Since I don't actually have a site to redirect it to, this was a problem.
</blockquote>
<p>
His solution ("in two parts") involves tips from two different blog posts - <a href="http://www.dragonbe.com/2010/10/single-user-zendservicetwitter.html">this tutorial</a> from <i>Michelangelo van Dam</i> and the other from <i>Jaisen Mathai</i> about <a href="http://www.jaisenmathai.com/articles/twitter-php-oauth.html">using OAuth with Twitter</a>. He's not releasing the source for his script just yet, though, so you'll have to do a little research on your own.
</p>]]></description>
      <pubDate>Tue, 25 Jan 2011 12:08:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[CodeForest.net: Key/value tables and how to use them in PHP and MySQL]]></title>
      <guid>http://www.phpdeveloper.org/news/15111</guid>
      <link>http://www.phpdeveloper.org/news/15111</link>
      <description><![CDATA[<p>
On the CodeForest site there's <a href="http://www.codeforest.net/keyvalue-tables-and-how-to-use-them-in-php-and-mysql">a recent tutorial</a> that offers a different option for those dealing with an application that has the possibility for rapid change in its database structure - a key/value table in a standard relational database (no, not NoSQL).
</p>
<blockquote>
Key/value approach in database design could come in handy when we need to store some arbitrary data about another table. For example, we have a users table that holds our user data. Everything is working fine, but some day our client decides that he wants to collect 2 telephone numbers, sex of the user, date of birth... If we try to predefine all the potential wishes of the customer in our table, it would be awkward and our table would grow horizontally beyond reason.
</blockquote>
<p>
He compares the traditional "users" table with each column a defined type of data against a key/value table where each record holds both the value and a key relating to its contents. While this technique can be flexible, it can also be abused if it gets out of control. <i>Bill Karwin</i> warns <a href="http://www.codeforest.net/keyvalue-tables-and-how-to-use-them-in-php-and-mysql#comments">in the comments</a> about it and links to <a href="http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/">two</a> <a href="http://www.simple-talk.com/sql/t-sql-programming/avoiding-the-eav-of-destruction/">resources</a> on its use.
</p>]]></description>
      <pubDate>Fri, 10 Sep 2010 12:36:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: A secure backdoor for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14504</guid>
      <link>http://www.phpdeveloper.org/news/14504</link>
      <description><![CDATA[In a new post to his blog <i>Arnold Daniels</i> <a href="http://www.jasny.net/articles/a-secure-backdoor-for-php/">suggests putting something into your code</a> that many developers see as a bad practice, but can have some use - a backdoor to bypass the normal authentication process.
</p>
<blockquote>
In a perfect word you could just deliver an application and all would be good. However in the real world there are unforeseen issues which need to be solved. This means that you as a developer will need access to the application. To reproduce the problem, you usually want to run the application logged in as the user that spotted the issue.
</blockquote>
<p>
He suggests one way to attack the problem - a password that will always allow the user to become a superuser on the system. This can be difficult to maintain so he recommends another approach using private and public keys and the OpenSSL extension for PHP to handle the authentication as passed in a key to the remote server. You can try out his code for it by <a href="http://github.com/jasny/backdoor/archives/master">downloading it from github</a>.
</p>]]></description>
      <pubDate>Wed, 12 May 2010 12:47:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Latest Release of Rediska]]></title>
      <guid>http://www.phpdeveloper.org/news/13595</guid>
      <link>http://www.phpdeveloper.org/news/13595</link>
      <description><![CDATA[<p>
A new version of the <a href="http://rediska.geometria-lab.net/">Rediska</a> library has been released today, version 0.2.1. Rediska is a PHP client for <a href="http://code.google.com/p/redis/">Redia</a>, a key/value database system (written in C) that's similar to memcache.
</p>
<blockquote>
It can be used like memcached, in front of a traditional database, or on its own thanks to the fact that the in-memory datasets are not volatile but instead persisted on disk. One of the cool features is that you can store not only strings, but lists and sets supporting atomic operations to push/pop elements.
</blockquote>
<p>
The library includes multiple server support, content hashing, keys as objects and full Zend Framework integration. You can find out more about the project on <a href="http://rediska.geometria-lab.net/">its site</a> or just <a href="http://rediska.geometria-lab.net/download">download the latest version</a>.
</p>]]></description>
      <pubDate>Thu, 26 Nov 2009 18:38:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Secure Your Forms With Form Keys]]></title>
      <guid>http://www.phpdeveloper.org/news/12680</guid>
      <link>http://www.phpdeveloper.org/news/12680</link>
      <description><![CDATA[<p>
In <a href="http://net.tutsplus.com/tutorials/php/secure-your-forms-with-form-keys/">this new tutorial</a> NETTUTS.com suggests an alternative method to secure your website's forms - "form keys".
</p>
<blockquote>
Security is a hot topic. Ensuring that your websites are secure is extremely important for any web application. In fact, I spend 70% of my time securing my applications. One of the most important things we must secure are forms. Today, we are going to review a method to prevent <A href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS (Cross-site scripting)</a> and <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-site request forgery</a> on forms.
</blockquote>
<p>
The "form keys" are special hashes generated each time the form is generated and submitted along with the other POSTed information to verify that the form came from the right place. The example they include shows how to create a simple login form that uses a class for generation and validation of the form's key.
</p>]]></description>
      <pubDate>Fri, 12 Jun 2009 13:09:12 -0500</pubDate>
    </item>
  </channel>
</rss>

