<?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, 22 May 2013 00:09:53 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Anthony Ferrara: Is Autoloading A Good Solution?]]></title>
      <guid>http://www.phpdeveloper.org/news/18255</guid>
      <link>http://www.phpdeveloper.org/news/18255</link>
      <description><![CDATA[<p>
In his <a href="http://blog.ircmaxell.com/2012/07/is-autoloading-good-solution.html">most recent post</a> <i>Anthony Ferrara</i> takes a look at autoloading - mostly asking the question of whether the problems it has really outweigh the benefits.
</p>
<blockquote>
The real problem that autoloaders solve is to load dependencies. [...] The normal logic that's used to justify autoloading over manual dependency loading in production is that it only loads the classes you need. Therefore you save the parsing costs of classes that you don't need. But surely that additional run-time loading has costs. So I decided to setup a test to see how expensive that additional run-time loading costs us, and to prove whether or not autoloading is worth it in production.
</blockquote>
<p>
He gives an example of the two methods - using the <a href="http://php.net/spl_autoload_register"> spl_autoload_register</a> method to define a loader and loading them with a defined file path instead. He found the autoloading version slower than the hard-coded (by quite a bit) but how, when the number of files is reduced, the performance gets much closer. He also briefly looks at two other pieces of file-related functionality: <a href="http://php.net/file_exists">file_exists</a> and <a href="http://php.net/require_once">require_once</a>.
</p>]]></description>
      <pubDate>Fri, 20 Jul 2012 15:56:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sean Coates' Blog: Use `env`]]></title>
      <guid>http://www.phpdeveloper.org/news/17984</guid>
      <link>http://www.phpdeveloper.org/news/17984</link>
      <description><![CDATA[<p>
<i>Sean Coates</i> has posted a reminder for PHP developers (and really anyone executing command-line scripts) to <a href="http://seancoates.com/blogs/use-env">use "env"</a> instead of hard-coding the path to the PHP interpreter.
</p>
<blockquote>
These [support] scripts often run PHP in Gimme Bar land, and we make extensive use of the shebang syntax that uses common Unix practice of putting #!/path/to/interpreter at the beginning of our command-line code. Clearly, this is nothing special -lots of people do exactly this same thing with PHP scripts. One thing I have noticed, though, is that many developers of PHP scripts are not aware of the common Unix(y) environment helper, env.
</blockquote>
<p>
The "env" alias makes use of your currently defined include path to track down a PHP binary to use to execute the script. Since there's only a "best practices" approach to places to put PHP on a server, the "env" usage makes your script more portable and it's one less thing to remember to change.
</p>
<blockquote>
If you distribute a PHP application that has command-line scripts and shebang lines, I encourage you to adopt the practice of making your shebang line "#!/usr/bin/env php". Note that this doesn't just apply to PHP of course, but I've seen a definite lack of env in the PHP world.
</blockquote>]]></description>
      <pubDate>Mon, 21 May 2012 11:58:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Henrik Bj&oslash;rnskov' Blog: Symfony2: Quick tip for your security configuration]]></title>
      <guid>http://www.phpdeveloper.org/news/17307</guid>
      <link>http://www.phpdeveloper.org/news/17307</link>
      <description><![CDATA[<p>
<i>Henrik Bj&oslash;rnskov</i> has a <a href="http://henrik.bjrnskov.dk/symfony2-security-configuration-tip/">quick new post</a> with a security tip for those using the Symfony2 framework in its configuration.
</p>
<blockquote>
Earlier when playing around with the Security component and SecurityBundle i found that for all paths you can specify a route name and the component will match it when check for the request paths. 
</blockquote>
<p>
Setting this up in your configuration gives you more control over the paths that are matched as well as more flexibility in defining them. He includes a note about a change you might have to make to the SecurityBundle's code to get the "check_path" part working correctly. You can find out more about the SecurityBundle's integration in <a href="http://tracehello.wordpress.com/2011/07/25/symfony2-securitybundle/">this blog post</a> from <i>Pablo Bandin</i>.
</p>]]></description>
      <pubDate>Tue, 27 Dec 2011 08:40:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Josh Adell's Blog: Path finding with Neo4j]]></title>
      <guid>http://www.phpdeveloper.org/news/16530</guid>
      <link>http://www.phpdeveloper.org/news/16530</link>
      <description><![CDATA[<p>
In a follow up to his previous post on <a href="http://phpdeveloper.org/news/16485">using Neo4j with PHP</a>, <i>Josh Adell</i> looks in a bit more detail about how to <a href="http://blog.everymansoftware.com/2011/06/path-finding-with-neo4j.html">find paths in the data</a> via a REST interface to the database.
</p>
<blockquote>
The thing that makes graphing databases useful is the ability to find relationship paths from one node to another. There are many algorithms for finding paths efficiently, depending on the use case.
</blockquote>
<p>
He includes some code showing the REST request (made via <a href="https://github.com/jadell/Neo4jPHP">this client</a>) to fetch <a href="http://1.bp.blogspot.com/-qteFgW-vvPE/TgK3beUyk_I/AAAAAAAAAA8/cstHGsCaLEU/s1600/street_graph.png">these street-based relationships</a>. He then creates a little sample script that provides driving directions from one intersection to another with a "findPathsTo" call. He modifies it a bit later on to use the <a href="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm">Dijkstra algorithm</a>.
</p>]]></description>
      <pubDate>Tue, 28 Jun 2011 12:38:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: File Path Injection in PHP <= 5.3.6 File Update (CVE 2011-2202)]]></title>
      <guid>http://www.phpdeveloper.org/news/16495</guid>
      <link>http://www.phpdeveloper.org/news/16495</link>
      <description><![CDATA[<p>
On DZone.com's PHP on Windows section today <i>Krzysztof Kotowicz</i> has a new post talking about <a href="http://css.dzone.com/articles/file-path-injection-php-536">a file path injection exploit</a> in PHP versions lower than 5.3.6.
</p>
<blockquote>
Since the thing <a href="http://www.devquotes.com/2011/06/15/php-cve-2011-2202/">went public</a> before new PHP version has been released, I present full details of the <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2202">latest PHP vulnerability</a> I reported - together with some sweet demo exploit. The issue was found with fuzzing being part of my recent <a href="http://blog.kotowicz.net/2011/04/how-to-upload-arbitrary-file-contents.html">file upload research</a>. And I still have some more to show in the future :)
</blockquote>
<p>
The issue, described in more detail <a href="http://bugs.php.net/bug.php?id=54939">here on bugs.php.net</a> (as of the time of this post, unfortunately unavailable) and his code to reproduce the issue is <a href="http://pastebin.com/1edSuSVN">here</a>. Due to a bug in the code that should strip down the upload to just the filename, certain kinds of file paths can make it through. The real problem comes in when an application blindly uses this filename to write to, possibly overwriting important files. You can see a screenshot of it in action <a href="http://www.youtube.com/watch?feature=player_embedded&v=hpsNOJq7tHM">here</a>.
</p>]]></description>
      <pubDate>Tue, 21 Jun 2011 08:44:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Josh Adell's Blog: Neo4j for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16485</guid>
      <link>http://www.phpdeveloper.org/news/16485</link>
      <description><![CDATA[<p>
<i>Josh Adell</i> has written up a new post for his blog showing some of his experience <a href="http://blog.everymansoftware.com/2011/06/neo4j-for-php.html">connecting PHP to Neo4j</a>, a graph database (and <a href="http://github.com/neo4j">open source project</a>). It helps to solve a problem of related datasets and the difficulties that traditional RDBMS have with them.
</p>
<blockquote>
Lately, I've been playing around with the graph database Neo4j and its application to certain classes of problems. Graph databases are meant to solve problems in domains where data relationships can be multiple levels deep. [...] As you continue to add degrees, the query becomes increasingly unwieldy, harder to maintain, and less performant.
</blockquote>
<p>
Graph databases, like Neo4j, handle these sorts of needs perfectly. There wasn't an official PHP interface for it, so he decided to <a href="http://github.com/jadell/Neo4jPHP">create his own</a> that worked with the REST interface the database provides. He includes a few code snippets showing how to connect and make a few requests - setting properties on objects, relating objects to one another and making queries that follow the paths from user to user and return them as a simple array.
</p>]]></description>
      <pubDate>Fri, 17 Jun 2011 10:05:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPRiot.com: Reducing a Map Path Using Douglas-Peucker Algorithm]]></title>
      <guid>http://www.phpdeveloper.org/news/16274</guid>
      <link>http://www.phpdeveloper.org/news/16274</link>
      <description><![CDATA[<p>
On PHPRiot.com there's a new tutorial showing you how to <a href="http://phpriot.com/articles/reducing-map-path-douglas-peucker-algorithm">use the Douglas-Peucker algorithm</a> to make the pathing on your map the simplest possible (the fewer points the better) having serious benefits a wide range of users, most notably those on mobile devices.
</p>
<blockquote>
When drawing a path on a map (for instance, the directions from point A to point B) it is important to consider the limitations of the device you're drawing the path on. In this article, I will show you how to reduce the number of points in a path so the path can be displayed with minimal loss of quality on devices such as iPhone or Android-powered devices that may struggle with an extremely large set of points.
</blockquote>
<p>
Using the <a href="http://code.google.com/transit/spec/transit_feed_specification.html">GTFS</a> service's data, he's been creating maps for an iPhone application. Naturally, a path with <a href="http://phpriot.com/assets/2223-58---e759">700 points</a> would take a lot of resources to render. Using the Douglas-Peucker algorithm he can reduce it down to a much more manageable <a href="http://phpriot.com/assets/ed88-59---8965">70 points</a>. He explains the algorithm briefly and hows how to implement it in PHP with three classes - ShapePoint, Shape and ShapeReducer. The resulting reduced dataset is then passed directly over to a Google Maps for plotting.
</p>]]></description>
      <pubDate>Fri, 29 Apr 2011 12:40:42 -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[Paul Reinheimer's Blog: Open the field to find the paths]]></title>
      <guid>http://www.phpdeveloper.org/news/15312</guid>
      <link>http://www.phpdeveloper.org/news/15312</link>
      <description><![CDATA[<p>
<i>Paul Reinheimer</i> has <a href="http://blog.preinheimer.com/index.php?/archives/360-Open-the-field-to-find-the-paths.html">posted something to think about</a> for both developers and those planning out projects and features - the paths the users will take through the application, not just the features they'll have available.
</p>
<blockquote>
<p>
There's a popular turn of phrase "pave the cow paths", which was introduced to me by my friend Chris Shiflett in one of his talks. The essence (as I understand it) of paving the cow paths is that it's easier to positively encourage users to act they way they already want to, than to have them change their behaviour.
</p>
<p>
[...] You can't hope to guess all the ways users will want to interact with your products. [...] You can however release your core feature with some flexibility and mind, then watch. 
</p>
</blockquote>
<p>
He suggests four ways that you can try to figure out these paths in your applications: by logging routes not just hits, give them somewhere to talk about their experiences with the app, open it up to outside interface (like APIs) and try to open it up for multiple kinds of use, not just what trends in statistical results.
</p>]]></description>
      <pubDate>Thu, 21 Oct 2010 08:15:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: More source analysis with VLD]]></title>
      <guid>http://www.phpdeveloper.org/news/14075</guid>
      <link>http://www.phpdeveloper.org/news/14075</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has been working on some updates to a tool he's developed, <a href="http://derickrethans.nl/projects.html#vld">VLD</a>, to make it more helpful and effecting in optimizing the opcodes in your scripts and find the dead opcodes and paths. He talks about these updates in <a href="http://derickrethans.nl/more-source-analysis-with-vld.html">this recent post</a>.
</p>
<blockquote>
Recently I've been working on some new functionality to visualise all the code paths that make up each function. These new routines sit on top of the routines that do dead code analysis. These new routines sit on top of the routines that do dead code analysis. Every branch instruction (such as if, but also for and foreach) is analysed and a list of branches is created. [...] Once all the branches and their links are found, another algorithm runs to figure out which paths can be created out of all the branches.
</blockquote>
<p>
He illustrates with a few examples, showing both the command that was executed and the resulting output with the new path information of a simple test file using a "for" loop and an "if/else" conditional.
</p>]]></description>
      <pubDate>Tue, 23 Feb 2010 10:49:26 -0600</pubDate>
    </item>
  </channel>
</rss>
