<?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, 24 May 2012 09:30:27 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lukas Smith's Blog: Query parameter handling in Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/17954</guid>
      <link>http://www.phpdeveloper.org/news/17954</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> is <a href="http://pooteeweet.org/blog/0/2096#m2096">looking for feedback</a> about a question that's been in his mind a lot lately - can the handling of query parameters be made better for the <a href="http://symfony.com">Symfony2</a> framework (and even easier to use).
</p>
<blockquote>
Obviously you can already access query parameters today already but it could be easier. Essentially what I want is a way for developers to easily configure what query parameters they expect and what values they expect. This is useful for several things like easier reading and validating of query parameters, self documenting API both for <a href="https://github.com/nelmio/NelmioApiDocBundle">API docs</a> for humans but also <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/issues/52">for machines</a>.
</blockquote>
<p>
He's asking for feedback and ideas from the community on a <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/pull/185">proposed solution</a> that could make things more flexible. He also briefly mentions the route matching and how qurey parameters could cause them not to match:
</p>
<blockquote>
For one I don't think that a mismatch on a <a href="http://symfony.com/doc/master/book/routing.html#adding-requirements">route requirement</a> of a query parameter cause the route to not match. However then it can quickly become confusing for the end user or it would require adding more and more syntax to handle all the different cases.
</blockquote>]]></description>
      <pubDate>Mon, 14 May 2012 11:56:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: PHP mysqlnd query cache plugin quickstart is online!]]></title>
      <guid>http://www.phpdeveloper.org/news/17413</guid>
      <link>http://www.phpdeveloper.org/news/17413</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Ulf Wendel</i> has pointed out that the <a href="http://blog.ulf-wendel.de/2012/php-mysqlnd-query-cache-plugin-quickstart-is-online/">mysqlnd query cache plugin quickstart is posted</a> on the <a href="http://docs.php.net/manual/en/mysqlnd-qc.quickstart.php">docs.php.net</a> site.
</p>
<blockquote>
New in the PHP manual: a <a href="http://docs.php.net/manual/en/mysqlnd-qc.quickstart.php">quickstart for the mysqlnd query cache plugin</a>. PECL/mysqlnd_qc, the mysqlnd query cache plugin, is transparent and ease to use. But, how? Some pointers have been given in assorted <A href="http://blog.ulf-wendel.de/2012/php-mysqlnd-query-cache-plugin-quickstart-is-online/www.slideshare.net/nixnutz/">presentations</a>, here on my blog and in some, few examples from the manual. Fixed. You can now browse a quickstart to gain a quick overview.
</blockquote>
<p>
The <a href="http://pecl.php.net/package/mysqlnd_qc">query cache plugin</a> can replace the query caching MySQL does and can help with things like multiple storage options (memory, APC, Memcache, etc) and almost no changes to your application. There's also a method (mysqlnd_qc_get_query_trace_log) that comes with the plugin that gives you a "stack trace" of every query run through the MySQL interface. 
</p>]]></description>
      <pubDate>Wed, 18 Jan 2012 12:12:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: MongoDB Revisited]]></title>
      <guid>http://www.phpdeveloper.org/news/17407</guid>
      <link>http://www.phpdeveloper.org/news/17407</link>
      <description><![CDATA[<p>
In <a href="http://phpmaster.com/mongodb-revisited/">this new post</a> to PHPMaster.com today <i>Ahmed Shreef</i> continues on from his <a href="http://phpmaster.com/introduction-to-mongodb/">previous introduction to MongoDB</a> and gets into more detail on things like cursors, query operators, queries on embedded documents and the sort/skip methods.
</p>
<blockquote>
In my previous article Introduction to MongoDB I discussed installing Mongo, its PHP extension, and how to perform simple insert and find operations. Of course there are many, many more features than what I mentioned so I wanted to write another article to show you some of them. </blockquote>
<p>
Other topics mentioned include queries on arrays of data and running queries with indexes to improve their performance. Code is also included for each example.
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 12:44:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&#252;ter's Blog: MySQL Query Analyzer and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16935</guid>
      <link>http://www.phpdeveloper.org/news/16935</link>
      <description><![CDATA[<p>
<i>Johannes Schl&#252;ter</i> has a new post to his blog today mentioning the beta release of the <a href="http://pecl.php.net/mysqlnd_ms">mysqlnd_ms plugin</a> (previously mentioned by <a href="http://phpdeveloper.org/news/16918">Ulf Wendel</a> and a new feature that can be plugged into the MySQL Enterprise Monitor to make the Query Analyzer directly use PHP instead.
</p>
<blockquote>
When running a PHP-based application with MySQL it is often quite interesting to see what actually happens on the database sever. Besides monitoring of the system load etc. it is often interesting to see what queries are actually executed and which of them are expensive. A part of MySQL Enterprise Monitor is the <a href="http://mysql.com/products/enterprise/query.html">MySQL Query Analyzer</a> which helps answering these questions.
</blockquote>
<p>
This was handled via a proxy that sat between the database and app server and ran through the queries looking for improvements. This new plugin keeps it closer to PHP itself without having to hit against the proxy. You can see the result in these <a href="http://schlueters.de/blog/uploads/screenshots/mem_quan_php1.png">two</a> <a href="http://schlueters.de/blog/uploads/screenshots/mem_quan_php2.png">screenshots</a> from inside the Manager application. You also have the side benefit of getting a stack trace of it running through the app to help you identify the spots most needing improvement in the code too.
</p>]]></description>
      <pubDate>Fri, 30 Sep 2011 12:56:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Working Software Blog: Escaping single and double quotes for use with XPath queries in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16746</guid>
      <link>http://www.phpdeveloper.org/news/16746</link>
      <description><![CDATA[<p>
On the Working Software blog there's a new post showing a solution to a issue with <a href="http://www.workingsoftware.com.au/page/Escaping_single_and_double_quotes_in_XPath_queries_in_PHP">escaping quotes in XPath queries</a> that's not just an issue in PHP.
</p>
<blockquote>
I've been working with the Basecamp API to plugin our IRC bot that we use for time tracking and I'm astounded to learn that escaping single and/or double quotes for XPath queries in PHP does not have a well documented, best practices solution. In fact, it seems as though this is not peculiar to PHP. I took a look around and found this excellent article by "Kushal": <a href="http://kushalm.com/the-perils-of-xpath-expressions-specifically-escaping-quotes">http://kushalm.com/the-perils-of-xpath-expressions-specifically-escaping-quotes</a>.
</blockquote>
<p>
He's put together <a href="https://gist.github.com/1155973">his own (PHP) solution</a> to the problem - running the entire XPath query through a filtering method that splits it up, replaces the quote characters and combines it back down to a single string.
</p>]]></description>
      <pubDate>Fri, 19 Aug 2011 13:50:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[HashBangCode.com: Revisiting filter_var() and FILTER_VALIDATE_URL]]></title>
      <guid>http://www.phpdeveloper.org/news/16139</guid>
      <link>http://www.phpdeveloper.org/news/16139</link>
      <description><![CDATA[<p>
From the HashBangCode.com site today there's a new post that <a href="http://www.hashbangcode.com/blog/revisiting-filtervar-and-filtervalidateurl-548.html">revisits filtering with the filter_var function</a> included with the language. The focus in this article is specifically in validating URLs with the FILTER_VALIDATE_URL flag.
</p>
<blockquote>
<a href="http://www.hashbangcode.com/blog/php-filter-filtervalidateurl-limitations-111.html">Quite a while ago</a> I looked at using the filter_var() function to validate URL's using the FILTER_VALIDATE_URL flag and someone pointed out recently that this function has not only changed since the initial release, but that a number of flags can be added to change the way that this function works.
</blockquote>
<p>
He lists some of the other flags that are now available that can be used in conjunction with FILTER_VALIDATE_URL to get more fine-grained in your filtering - checks on things like a required scheme, hostname and query string. He includes some code with a set of URLs to run through some tests and output as a table with the pass/fail rank of each URL value. You can see the <a href="http://www.hashbangcode.com/examples/filter_var_url_validate/">resulting output here</a>.
</p>]]></description>
      <pubDate>Mon, 04 Apr 2011 08:44:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SmashinGeeks.com: Display the Number of Retweets for a Post Using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16055</guid>
      <link>http://www.phpdeveloper.org/news/16055</link>
      <description><![CDATA[<p>
On the SmashinGeeks.com site there's a recent post showing you how to make a simple request and get the <a href="http://www.smashingeeks.com/featured/display-the-number-of-retweets-for-a-post-using-php.html">number of retweets for a post</a> using PHP and <a href="http://tweetmeme.com">Tweetmeme</a>/<a href="http://backtype.com">Backtype</a>.
</p>
<blockquote>
Tweeting is what we do after publishing posts. To place some minimal text that jumps upon the Tweet on Twitter will be more great instead of using a tweet button. Its made possible to count the number of tweets using PHP only, however if you want to sizzle it up, then its your way.
</blockquote>
<p>
They include code examples of how to connect to each of the services and make a request for a query string to their API using libraries provided by the service.
</p>]]></description>
      <pubDate>Wed, 16 Mar 2011 12:53:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rafael Dohms' Blog: Using theFacebook PHP-SDK to run FQL]]></title>
      <guid>http://www.phpdeveloper.org/news/15729</guid>
      <link>http://www.phpdeveloper.org/news/15729</link>
      <description><![CDATA[<p>
<i>Rafael Dohms</i> has a new post to his blog today looking at using the <a href="http://blog.rafaeldohms.com.br/2011/01/12/using-the-facebook-php-sdk-to-run-fql/">Facebook PHP-SDK to run FQL</a> queries on the data for your applications.
</p>
<blockquote>
The new SDKs have not, as you can say, fallen far from the tree. While they are really great new and shiny, documentation on how to use them is still vague, missing or spread out in the internet in blogs like these, in posts from us users trying to share the information with other soon-to-be-suffering developers. So this is an example of this, i have been using these new resources and the new PHP-SDK and have ran into various walls, so I decided to start putting some of this on my blog, for 2 reasons: to spread the word, and to have notes for myself when I come back to this.
</blockquote>
<p>
<a href="http://blog.rafaeldohms.com.br/2011/01/12/using-the-facebook-php-sdk-to-run-fql/">The post</a> gives an example of using the "api" method provided by the <a href="https://github.com/facebook/php-sdk">PHP SDK</a> from Facebook to push an array of parameters, one being the query, to the remote API for parsing. He includes the code for a simple (namespaced) helper to take in the query and return the API's return data set.
</p>]]></description>
      <pubDate>Wed, 12 Jan 2011 13:19:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Speed up PHP scripts with asynchronous database queries]]></title>
      <guid>http://www.phpdeveloper.org/news/15260</guid>
      <link>http://www.phpdeveloper.org/news/15260</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.wordpress.com/2010/10/11/speed-up-php-scripts-with-asynchronous-database-queries/">a suggestion for speeding up your scripts</a> that use multiple database connections, possibly ones with larger queries that could take a while to run - asynchronous query handling.
</p>
<blockquote>
That's the situation. A web application with 4 heavy queries. Yes I know you can use a cache or things like that but imagine you must perform the four queries yes or yes. As I say before the four database queries are heavy ones. 2 seconds per one. Do it sequentially, that's means our script will use at least 8 seconds (without adding the extra PHP time). Eight seconds are a huge time in a page load. So here I will show up a technique to speed up our website using asynchronous calls.
</blockquote>
<p>
Since PHP doesn't really support threading, he works around it by creating a separate script for each of the queries (obviously only practical for special cases) as a self-contained unit. Then the "master" script that needs the results of the queries calls each of them via asynchronous <a href="http://php.net/curl">curl</a> class (simply named "Fork") that sends off the requests and waits for each result to come back as a json result set.
</p>]]></description>
      <pubDate>Mon, 11 Oct 2010 11:49:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ServerGrove Blog: Logging MongoDB queries using Symfony 2 and Doctrine ODM]]></title>
      <guid>http://www.phpdeveloper.org/news/15230</guid>
      <link>http://www.phpdeveloper.org/news/15230</link>
      <description><![CDATA[<p>
On the ServerGrove blog today there's <a href="http://blog.servergrove.com/2010/10/05/logging-mongodb-queries-using-symfony-2-and-doctrine-odm/">a quick new post</a> showing a method you can use to log the queries to your MongoDB database in your Symfony2-based application.
</p>
<blockquote>
Symfony 2 comes with native support to connect to MongoDB using the DoctrineMongoDBBundle. Getting started is quite simple and there is not much that needs to be configured, but the manual does not say how to enable query logging although it is already possible with Symfony PR3. Query logging allows you to debug queries sent to the DB server by writing them in a log file. It is very useful for cases when you issue a query and you are not getting the results you expected. 
</blockquote>
<p>
The key is to add a "logger_class" value into your Symfony configuration file pointing to the "DoctrineMongoDBLogger" tool. The queries will then show up in your normal log files. They include a sample line along with a brief explanation of the values inside.
</p>]]></description>
      <pubDate>Tue, 05 Oct 2010 10:56:43 -0500</pubDate>
    </item>
  </channel>
</rss>

