<?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>Thu, 17 May 2012 03:53:50 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Developer.com: Creating a Custom ACL in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17946</guid>
      <link>http://www.phpdeveloper.org/news/17946</link>
      <description><![CDATA[<p>
On Developer.com there's a recent tutorial showing you how to <a href="http://www.developer.com/lang/php/creating-a-custom-acl-in-php.html">create a basic access control list</a> in PHP (not in any specific framework). It allows you to define not only user permissions but groups and group permissions as well.
</p>
<blockquote>
So, what are the advantages of an ACL model? The first advantage is security. Using this model will make your application more secure and less vulnerable to exploits. When securing any program, it is good to give to the user only the privileges he/she needs. That means that, for example, you should not give super administrator privileges to someone who will only manage website content. The ACL security model allows you to do just that. The second advantage is the easiness of user management. You can divide users into groups, while each group has certain access permissions. Also, you can easily add new user groups, delete the old ones or change group permissions.
</blockquote>
<p>
They include the database structure you'll need to make the backend work (four tables) and the code to create an "Acl" class with methods to check a user+group for a permission, get the permissions for a user and get the permissions for a group. It's a pretty simple system and has a lot more that could be added to it to make it more robust, but it's a good start.
</p>]]></description>
      <pubDate>Fri, 11 May 2012 10:53:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using an Access Database with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17927</guid>
      <link>http://www.phpdeveloper.org/news/17927</link>
      <description><![CDATA[<p>
On the PHPMaster.com site there's a new tutorial (from <i>David Francis</i>) about <a href="http://phpmaster.com/using-an-access-database-with-php/">connecting to a database</a> (a basic introduction using <a href="http://php.net/pdo">PDO</a>) and doing some of the common operations with the connection.
</p>
<blockquote>
Wouldn't it have been better for them to able to maintain their database where ever they were? Of course, but how? Simple - put it online.  [...] In this article I'll focus on the essential elements of PHP you'll need to use an existing Access database online. One other item that's standard with a Windows installation is the availability of ODBC drivers. These are essential for the use of Access from PHP.
</blockquote>
<p>
He includes a sample database structure (with "product", "product_category" and "category" tables)  and includes some sample code showing how to connect to the remote database and perform some basic actions - select, update, insert and delete
</p>]]></description>
      <pubDate>Tue, 08 May 2012 14:57:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Role Based Access Control in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17668</guid>
      <link>http://www.phpdeveloper.org/news/17668</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial posted (from <i>Martin Psinas</i>) about using <a href="http://phpmaster.com/role-based-access-control-in-php/">role-based access controls</a> in PHP-based applications. His method isn't based in any specific framework, so it's easily portable to just about any app out there.
</p>
<blockquote>
In this article I will discuss my personal favorite approach: role based access control (RBAC). RBAC is a model in which roles are created for various job functions, and permissions to perform certain operations are then tied to roles. A user can be assigned one or multiple roles which restricts their system access to the permissions for which they have been authorized.
</blockquote>
<p>
He starts with a warning that, if not properly maintained, a role-based system like this can get to be somewhat chaotic so a rules should be in place around the adding and removing of permissions at certain times. His functionality is based on a few database tables - roles, permissions and cross-reference tables between users/roles & permissions/roles. All of the code you'll need to implement the system is included in a Role class, the PrivilegedUser class and the methods you'll need to add/remove/check the logged in user's permissions.
</p>]]></description>
      <pubDate>Tue, 13 Mar 2012 13:10:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Refulz.com: CakePHP AclComponent - ACOs, AROs and Mapping]]></title>
      <guid>http://www.phpdeveloper.org/news/17605</guid>
      <link>http://www.phpdeveloper.org/news/17605</link>
      <description><![CDATA[<p>
On the Refulz blog they've posted <a href="http://php.refulz.com/cakephp-aclcomponent-acos-aros-and-mapping/">the next in their series</a> about access control in CakePHP applications. In this new article they look at Access Request Objects (AROs) and Access Control Objects (ACOs) and how they can be managed via the built-in ACL functionality.
</p>
<blockquote>
Continuing with Access Control Lists, we will read about the two Access Control Lists and their mapping. The Access Request Objects (AROs) are a list of the things that seek permissions and the Access Control Objects (ACOs) are the resources on which permissions are required. Both the lists are maintained in the tow tables, namely aros and acos respectively.
</blockquote>
<p>
Included in the post is the SQL you'll need to create the tables for the system to use as well as some basic code to use the AclComponent with the ACOs/AROs. They also show how to use the parentNode method to create parent/child relationships between the objects.
</p>]]></description>
      <pubDate>Wed, 29 Feb 2012 11:38:12 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell' Blog: PHP OAuth Provider: Access Tokens]]></title>
      <guid>http://www.phpdeveloper.org/news/16788</guid>
      <link>http://www.phpdeveloper.org/news/16788</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has posted the latest in her look at OAuth in PHP to her blog today, an <a href="http://www.lornajane.net/posts/2011/php-oauth-provider-access-tokens">introduction to access tokens</a> - generating and handling them in your application.
</p>
<blockquote>
I've been working with <a href="http://oauth.net/">OAuth</a>, as a provider and consumer, and there isn't a lot of documentation around it for PHP at the moment so I thought I'd share my experience in this series of articles. [...] This entry follows on from the ones about the <a href="http://www.lornajane.net/posts/2011/PHP-OAuth-Provider-Initial-Requirements">initial requirements</a>, <a href="http://www.lornajane.net/posts/2011/PHP-OAuth-Provider-Request-Tokens">how to how to handle request tokens</a>, and <a href="http://www.lornajane.net/posts/2011/php-oauth-provider-authenticate-user">authenticating users</a>.
</blockquote>
<p>
In this latest post, she talks about the three different types of tokens - consumer, request and verififier - and how to use them to locate a user in your app's users. Her code validates the request token and verifier against the database and, if successful, inserts the rest of the token information for the user.
</p>]]></description>
      <pubDate>Tue, 30 Aug 2011 08:28:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Proxies in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16555</guid>
      <link>http://www.phpdeveloper.org/news/16555</link>
      <description><![CDATA[<p>
In a new blog post <i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/263-Proxies-in-PHP.html">taken a look at proxy objects</a> (the Proxy design pattern) and how it differs from some of the other popular patterns.
</p>
<blockquote>
Of the other patterns mentioned, the one closest to the Proxy is the Decorator. In the case of a Decorator, the focus is on adding functionality to an existing object -- for instance, adding methods, processing input before delegating to the target object, or filtering the return of a method from a target object.
</blockquote>
<p>
Proxies stand in for objects and have several benefits for your application that may or may not need all of the overhead a full object could cause. <i>Matthew</i> focuses on one benefit in particular - consuming and controlling access to another object. He sets up a problem of wanting to use properties/methods on objects that aren't exposed directly (like a protected method). His solution is a proxy layer class on top of the original object. He includes a few "gotchas" to look out for when using this technique including overwriting all necessary methods and copying over all of the needed properties.
</p>]]></description>
      <pubDate>Wed, 06 Jul 2011 08:10:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Use PDO to Access Just About Any Database from PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16240</guid>
      <link>http://www.phpdeveloper.org/news/16240</link>
      <description><![CDATA[<p>
New on PHPBuilder.com there's a tutorial from <i>Leidago Noabeb</i> about using the PDO functionality that comes installed on many PHP platforms out there to <a href="http://www.phpbuilder.com/columns/pdo-php-data-objects/Leidago_Noabeb04212011.php3">access just about any database</a> you might need to work work. This includes technology like MySQL, DB2, SQLite and PostgreSQL.
</p>
<blockquote>
PHP Data Objects, or "PDO" as it is commonly known, is a lightweight database abstraction layer that is arguably the best, at least in terms of speed. A great deal of this speed is owing to the fact that the PDO extension was compiled with C/C++. The extension became available in PHP5, and as with any other database abstraction layer, its aim is to provide a uniform interface to access a variety of databases. This is also a way for developers to create portable code for a variety of platforms.
</blockquote>
<p>
The tutorial shows you how to find the enabled PDO connection types for your installation (and where to go if you have access to turn more on or off). They show an example connection - in this case, to a MySQL database - and how to run a query or two using this new resource.
</p>]]></description>
      <pubDate>Mon, 25 Apr 2011 08:17:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: 3 Ways to Access a Namespaced PHP Class]]></title>
      <guid>http://www.phpdeveloper.org/news/15507</guid>
      <link>http://www.phpdeveloper.org/news/15507</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has posted <a href="http://www.lornajane.net/posts/2010/3-Ways-to-Access-a-Namespaced-PHP-Class">three different ways</a> you can use to get access to a namespaced class in a PHP 5.3 application, all useful depending on where you are in the application and your needs.
</p>
<blockquote>
After what felt like years of debate over the notation to use for PHP's namespaces, it seems like the feature itself has had relatively little use or attention since it was actually implemented in PHP 5.3. We're all used to working without it but using it does make code neater.
</blockquote>
<p>Her three options are:</p>
<ul>
<li>Refer Namespace and Class Name
<li>Import the Namespace
<li>Alias the Namespace and/or Class
</ul>
<p>
You can find out more about namespaces in PHP applications on <a href="http://php.net/namespace">the PHP manual</a>.
</p>]]></description>
      <pubDate>Mon, 29 Nov 2010 12:49:36 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: Dependency Injection for static methods]]></title>
      <guid>http://www.phpdeveloper.org/news/15398</guid>
      <link>http://www.phpdeveloper.org/news/15398</link>
      <description><![CDATA[<p>
On the Stubbles blog today there's <a href="http://www.stubbles.org/archives/85-Dependency-Injection-for-static-methods.html">a new post</a> from <i>Frank Kleine</i> showing how you can use a new feature of PHP 5.3 to perform dependency injection on  static method - calling static methods with dynamic class names.
</p>
<blockquote>
Developers who are familiar with the topic of clean code know that static methods are a problem, especially if it comes to testability. Static makes the code global, and if there is some kind of state involved it is even more a problem because this is global state then - both a maintenance and testability nightmare. [...] How can we keep our code clean and testable, at best without having a strongly coupled dependency to the class hosting the static method? Enter dependency injection for static methods.
</blockquote>
<p>
He gives an example of how to use this to create a simple class that can change the name of the object an inner static function call is made to.
</p>]]></description>
      <pubDate>Mon, 08 Nov 2010 12:38:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Authenticating with OAuth from PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15202</guid>
      <link>http://www.phpdeveloper.org/news/15202</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has <a href="http://www.lornajane.net/posts/2010/Authenticating-with-OAuth-from-PHP">posted about her experiences</a> with getting OAuth working with her PHP application by way of the <a href="http://pecl.php.net/package/oauth">PECL package</a> that adds support into PHP.
</p>
<blockquote>
I've been looking into OAuth recently and really like what I see, so I started looking at actually starting to play with something that uses it (and isn't twitter). In the pursuit of this, I spent some time walking through the process of how to actually authenticate using OAuth, as a client.
</blockquote>
<p>
She briefly touches on the consumer key and secret and how those are passed along with the OAuth object creation to grab a request token, complete with details on setting a callback. She also mentions how to grab an access token - a piece of information you include in your API calls to let the remote service know who you are. All of her examples are using <a href="http://developer.yahoo.com/oauth/guide/about.html">Yahoo! OAuth services</a>.
</p>]]></description>
      <pubDate>Wed, 29 Sep 2010 08:18:32 -0500</pubDate>
    </item>
  </channel>
</rss>

