<?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>Mon, 20 May 2013 09:54:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Bob Majdak: On SQL in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19593</guid>
      <link>http://www.phpdeveloper.org/news/19593</link>
      <description><![CDATA[<p>
In a new post to his site <i>Bob Majdak</i> looks at <a href="http://catch404.net/2013/05/on-sql-in-php/">using SQL in PHP</a> and some of the challenges he's come across (some of them with his own tools). He talks about things line inline SQL, loading SQL by unique key or creating a "build object".
</p>
<blockquote>
There is no right or wrong way, but no matter what there is no *pretty* way to do SQL inside of a PHP application. I have been having a personal debate with myself all week about how to make SQL statements nicer in an application without going to a huge DBAL package like Doctrine.
</blockquote>
<p>
He looks at each idea and provides some of the pros and cons about each of them, noting that he hasn't quite decided on which is the best method. Some sample code is included to help clarify the points, showing the "find by unique key" version and how a more complex query might be created with the "builder object."
</p>
Link: http://catch404.net/2013/05/on-sql-in-php]]></description>
      <pubDate>Thu, 16 May 2013 10:11:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Maarten Balliauw: Working with Windows Azure SQL Database in PhpStorm]]></title>
      <guid>http://www.phpdeveloper.org/news/19231</guid>
      <link>http://www.phpdeveloper.org/news/19231</link>
      <description><![CDATA[<p>
<i>Maarten Balliauw</i> has a new post to his site showing how you can work with a Azure SQL database <a href="http://blog.maartenballiauw.be/post/2013/02/25/Working-with-Windows-Azure-SQL-Database-in-PhpStorm.aspx">directly from the UI</a> of the popular PHP IDE, <a href="http://www.jetbrains.com/phpstorm/">phpStorm</a>.
</p>
<blockquote>
PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we'll explore several options that are available for working with Windows Azure SQL Database: Setting up a database connection, creating a table, inserting and updating data, using the database console, generating a database diagram and database refactoring.
</blockquote>
<p>
He includes the instructions and several screenshots showing each step of the above mentioned steps. The database diagram gives you a good overall view of your database structure and allows you to show a visualization of how the tables relate to each other. Note that, though this particular example shows it connecting to an Azure SQL database, the same setup can be used with lots of popular RDBMS out there.
</p>]]></description>
      <pubDate>Mon, 25 Feb 2013 09:13:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a simple SQL wrapper with PHP. Part 2.]]></title>
      <guid>http://www.phpdeveloper.org/news/18106</guid>
      <link>http://www.phpdeveloper.org/news/18106</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has followed up his <a href="http://phpdeveloper.org/news/17953">previous post</a> about creating a simple SQL wrapper with PDO in PHP with <a href="http://gonzalo123.wordpress.com/2012/06/18/building-a-simple-sql-wrapper-with-php-part-2/">this new post</a>, a "part two" looking at improving it a bit with a new class to represent the tables.
</p>
<blockquote>
In one of our last post we built a <a href="http://gonzalo123.wordpress.com/2012/05/14/building-a-simple-sql-wrapper-with-php/">simple SQL wrapper with PHP</a>. Now we are going to improve it a little bit. We area going to use a class Table instead of the table name. Why? Simple. We want to create triggers. OK we can create triggers directly in the database but sometimes our triggers need to perform operations outside the database, such as call a REST webservice, filesystem's logs or things like that.
</blockquote>
<p>
He includes the updated code with the new "Table" class with methods that let you set up pre- and post-action hooks on each of the types (insert, delete, update) along with the rest of the library, there ready for the copy & pasting.
</p>]]></description>
      <pubDate>Mon, 18 Jun 2012 10:05:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Agile Toolkit Blog: Which PHP Framework is the Fastest?]]></title>
      <guid>http://www.phpdeveloper.org/news/18060</guid>
      <link>http://www.phpdeveloper.org/news/18060</link>
      <description><![CDATA[<p>
The Agile Toolkit blog has a new post today that looks at <a href="http://agiletoolkit.org/blog/which-php-framework-is-the-fastest/">speed in PHP frameworks</a> the their relative speed (no, there's no benchmarks here).
</p>
<blockquote>
This question is often asked, but is never answered properly. So how to measure framework speed? Let me also explain why "scalability" is more important than general "performance". [...] This along with a general overheads of the framework greatly contributes to the "slowness" of your project. So how can framework contribute to performance of your project?
</blockquote>
<p>They touch a few different ways that frameworks can help execute things a bit faster like:</p>
<ul>
<li>Make Fewer SQL Queries
<li>Selective render
<li>Parallelization
<li>Overheads
<li>Caching
</ul>]]></description>
      <pubDate>Thu, 07 Jun 2012 12:47:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Nerdery Blog: Minnesota PHP User Group (May 2012 Meeting) Recordings]]></title>
      <guid>http://www.phpdeveloper.org/news/17975</guid>
      <link>http://www.phpdeveloper.org/news/17975</link>
      <description><![CDATA[<p>
On the Nerdery blog today there's a new post about the <a href="http://blog.nerdery.com/2012/05/mn-php-user-group/">recent Minnesota PHP User Group's latest meeting</a> where the topics were "When SQL Meets Developers" and "Message Queues & Distributed Job Processing".
</p>
<blockquote>
In their May meeting, the Minnesota PHP User Group heard two talks on "When SQL Meets Documents" [above] and "Message Queues & Distributed Job Processing" [below]. <a href="http://www.mnphp.org/">MNPHP</a> meets once a month at The Nerdery's office in Bloomington. 
</blockquote>
<p>
Both of the presentations were recorded - you can find the videos over on Vimeo: <a href="http://vimeo.com/42220376">SQL Meets Developers</a> and <a href="http://vimeo.com/42221874">Message Queues</a>. 
</p>]]></description>
      <pubDate>Fri, 18 May 2012 08:02:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a simple SQL wrapper with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17953</guid>
      <link>http://www.phpdeveloper.org/news/17953</link>
      <description><![CDATA[<p>
In <a href="http://gonzalo123.wordpress.com/2012/05/14/building-a-simple-sql-wrapper-with-php/">this new post</a> to his blog <i>Gonzalo Ayuso</i> has shared a simple SQL wrapper that he uses to work with his databases. It takes in an injection of the database connection component (a href="http://php.net/pdo">PDO</a>) and provides functionality for inserts, updates, etc. with transaction support.
</p>
<blockquote>
If we don't use an ORM within our projects we need to write SQL statements by hand. I don't mind to write SQL. It's simple and descriptive but sometimes we like to use helpers to avoid write the same code again and again. Today we are going to create a simple library to help use to write simple SQL queries.
</blockquote>
<p>
It's a <a href="https://github.com/gonzalo123/sqlWrapper">lightweight library</a> that'd be good for basic uses, but when you start getting into something a bit more complex, something like <a href="http://www.doctrine-project.org/">Doctrine2</a> or <a href="http://www.propelorm.org/">Propel</a> might be a better solution (or whatever your framework of choice has built in).
</p>]]></description>
      <pubDate>Mon, 14 May 2012 10:17:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Infosec Institute: SQL Injection through HTTP Headers]]></title>
      <guid>http://www.phpdeveloper.org/news/17775</guid>
      <link>http://www.phpdeveloper.org/news/17775</link>
      <description><![CDATA[<p>
While not specific to PHP, security is something that all developers need to think about in their applications. To that end, the Infosec Institute has <a href="http://resources.infosecinstitute.com/sql-injection-http-headers/">published this guide</a> to helping you prevent SQL injection attacks that could come in via the HTTP headers of requests to your site.
</p>
<blockquote>
During vulnerability assessment or penetration testing, identifying the input vectors of the target application is a primordial step. Sometimes, when dealing with Web application testing, verification routines related to SQL injection flaws discovery are restricted to the GET and POST variables as the unique inputs vectors ever. What about other HTTP header parameters? Aren't they potential input vectors for SQL injection attacks? How can one test all these HTTP parameters and which vulnerability scanners to use in order to avoid leaving vulnerabilities undiscovered in parts of the application?
</blockquote>
<p>
They start by describing the different kinds of headers that the attacks could come in on - GET, POST, cookies and the other HTTP headers. According to <a href="http://resources.infosecinstitute.com/wp-content/uploads/033012_1704_SQLInjectio1.png?d9c344">some results</a>, the HTTP headers option is the least protected in most common applications. He includes some good examples of headers that might contain malicious data such as:
</p>
<ul>
<li>X-Forwarded-For
<li>User-agent
<li>Referer
</ul>
<p>
Techniques are also included showing you tools and methods to help test your own applications including some in-browser tools and external applications (like Sqlmap, Nessus, WebInspect, SkipFish and Wapiti) with some <a href="http://resources.infosecinstitute.com/wp-content/uploads/033012_1704_SQLInjectio13.png?d9c344">average scores</a> from running them on various coverage scores.
</p>]]></description>
      <pubDate>Wed, 04 Apr 2012 10:17:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: How to protect from SQL Injection with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17514</guid>
      <link>http://www.phpdeveloper.org/news/17514</link>
      <description><![CDATA[<p>
In a recent post to his blog, <i>Gonzalo Ayuso</i> shares a few tips on <a href="http://gonzalo123.wordpress.com/2012/02/06/how-to-protect-from-sql-injection-with-php/">preventing SQL injection</a> attacks on your applications.
</p>
<blockquote>
Security is a part of our work as developers. We need to ensure our applications against malicious attacks. SQL Injection is one of the most common possible attacks. Basically SQL Injection is one kind of attack that happens when someone injects SQL statements in our application. You can find a lot of info about SQL Injection attack. Basically you need to follow the security golden rule: "Filter input, Escape output".
</blockquote>
<p>
He advocates the use of the PDO abstraction layer to filter out a lot of the issues. Using its prepared statements, you can easily strip out things that just adding slashes to user input wouldn't prevent. He also includes a reminder about database permissions - allowing only certain users the ability to, for example, delete can help provide one more level of security (in other words, don't use a "super user" in production).
</p>]]></description>
      <pubDate>Wed, 08 Feb 2012 08:07:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Using SQL Azure to Store PHP Session Data]]></title>
      <guid>http://www.phpdeveloper.org/news/17024</guid>
      <link>http://www.phpdeveloper.org/news/17024</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Brian Swan</i> takes a look at working with sessions in PHP and, specifically, how to <a href="http://blogs.msdn.com/b/silverlining/archive/2011/10/19/using-sql-azure-to-store-php-session-data.aspx">save them to Azure</a> along with all of their data.
</p>
<blockquote>
In my <a href="http://blogs.msdn.com/b/silverlining/archive/2011/10/18/handling-php-sessions-in-windows-azure.aspx">last post</a>, I looked at the session handling functionality that is built into the <a href="http://phpazure.codeplex.com/">Windows Azure SDK for PHP</a>, which uses <a href="http://www.microsoft.com/windowsazure/features/storage/">Azure Tables or Azure Blobs</a> for storing session data. As I wrote that post, I wondered how easy it would be to use <a href="http://msdn.microsoft.com/en-us/library/ee336241.aspx">SQL Azure</a> to store session data, especially since using a database to store session data is a common and familiar practice when building distributed PHP applications.  As I found out, using SQL Azure to store session data was relatively easy (as I'll show in this post), but I did run into a couple of small hurdles that might be worth taking note of.
</blockquote>
<p>
He uses PHP's own <a href="http://us2.php.net/session_set_save_handler">session_set_save_handler</a> to point to his custom Azure handling class with the needed methods (like write, close and destroy). He breaks it out into three simple steps, some with a bit of code attached:
</p>
<ul>
<li>Create the database, table, and stored procedure
<li>Add the SqlAzureSessionHandler class to your project
<li>Instantiate SqlAzureSessionHandler before calling session functions as you normally would
</ul>
<p>
The code for the Azure handling class can be downloaded <a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-22-76-75/SqlAzureSessionHandler.zip">here</a>.
</p>]]></description>
      <pubDate>Fri, 21 Oct 2011 08:32:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Drive Blog: How to Prevent a SQL Injection Attack]]></title>
      <guid>http://www.phpdeveloper.org/news/16994</guid>
      <link>http://www.phpdeveloper.org/news/16994</link>
      <description><![CDATA[<p>
From the Developer Drive blog there's a recent post with some suggestions on how you can help to <a href="http://www.developerdrive.com/2011/10/how-to-prevent-a-sql-injection-attack/">prevent SQL injections</a> in your PHP application and make it that much harder for would-be attackers to do what they shouldn't.
</p>
<blockquote>
Why do SQL injections happen so often?
The shortest answer is that SQL injections are so popular because of poor programming. Hackers know about the potential of a successful SQL injection attack and they search for vulnerabilities. Unfortunately, very often they don't have to search hard - vulnerabilities pop right in their face. [...] The good news is that fortunately, SQL injections are also relatively easy to prevent.
</blockquote>
<p>They list nine easy things you can do to help prevent the attacks:</p>
<ul>
<li>Patch your SQL server regularly
<li>Limit the use of dynamic queries
<li>Escape user input
<li>Store database credentials in a separate file
<li>Use the principle of least privilege
<li>Turn magic quotes off
<li>Disable shells
<li>Disable any other DB functionality you don't need
<li>Test your code
</ul>]]></description>
      <pubDate>Fri, 14 Oct 2011 09:25:12 -0500</pubDate>
    </item>
  </channel>
</rss>
