<?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>Sat, 18 May 2013 18:00:13 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mike Purcell's Blog: PHPUnit - Upgrade - Convert assertType to assertInternalType]]></title>
      <guid>http://www.phpdeveloper.org/news/17982</guid>
      <link>http://www.phpdeveloper.org/news/17982</link>
      <description><![CDATA[<p>
In <a href="http://melikedev.com/2012/05/18/phpunit-upgrade-convert-asserttype-to-assertinternaltype/">this quick post</a> to his blog, <i>Mike Purcell</i> mentions the deprecation of the "assertType" assertion and includes some code you can add to correct the issue in your tests.
</p>
<blockquote>
We recently upgraded phpunit from a very old version to the current 3.6.x version (at time of writing). During the upgrade I noticed that assertType is no longer supported in many of our tests which were testing if something was a string, an array, or an object. So I had to write a quick script to update assertType to assertInternalType and figured I would post it for others if they needed to do the same.
</blockquote>
<p>
The code goes into each of your tests (recursively) and finds the places where the "assertType" assertion is used and replaces it with its newer cousin "assertIntrnalType". 
</p>]]></description>
      <pubDate>Mon, 21 May 2012 09:56:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Practicing Regular Expressions with Search and Replace]]></title>
      <guid>http://www.phpdeveloper.org/news/17163</guid>
      <link>http://www.phpdeveloper.org/news/17163</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial that <a href="http://phpmaster.com/practicing-regular-expressions/">shares a few regular expression tips</a> about doing some search and replace in your content.
</p>
<blockquote>
So how can you practice using regex if you are limited to just using them in your code? The answer is to use a utility, of which there are many, that uses regex for performing search and replace. I'm sure everyone is familiar with the standard "find x and replace it with y" type of search and replace. Most IDEs and text editors have built in regex engines to handle search and replace. In this article I'd like to walk through a series of exercises to help you practice using regex. 
</blockquote>
<p>
His examples are based on <a href="http://netbeans.org/">Netbeans</a> but can be used in just about any IDE that supports regex (or even just your code). He shows how to match word boundaries, do some grouping, work with back references and doing some search/replace based on multiple groupings.
</p>]]></description>
      <pubDate>Wed, 23 Nov 2011 14:27:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: PHP Simple HTML DOM Parser: Editing HTML Elements in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16833</guid>
      <link>http://www.phpdeveloper.org/news/16833</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new tutorial from <i>Vojislav Janjic</i> about using a <a href="http://www.phpbuilder.com/columns/PHP_HTML_DOM_parser/PHPHTMLDOMParser.cc_09-07-2011.php3">simple DOM parser</a> in PHP to edit the markup even if it's not correctly W3C-formatted - the <a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM Parser</a>
</p>
<blockquote>
Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered. 
</blockquote>
<p>
They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.
</p>]]></description>
      <pubDate>Thu, 08 Sep 2011 10:06:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[JSClasses.org Blog: Lately in JavaScript podcast - Episode 5 (Javascript to Replace PHP?)]]></title>
      <guid>http://www.phpdeveloper.org/news/16446</guid>
      <link>http://www.phpdeveloper.org/news/16446</link>
      <description><![CDATA[<p>
From the JSClasses.org site today there's a <a href="http://www.jsclasses.org/blog/post/14-Is-JavaScript-going-to-replace-PHP--Lately-in-JavaScript-podcast-episode-7.html">new episode</a> of their "Lately in Javascript" podcast that asks the question "Is Javascript going to replace PHP?"
</p>
<blockquote>
So it seems that recently Douglas Crockford of Yahoo commented they are considering to replace PHP with Node.js based JavaScript for server side Web applications. On episode 7 of the Lately in JavaScript podcast, Manuel Lemos and Michael Kimsal have Zachary Kessin, author of the Programming HTML 5 Applications book, to debate whether it makes sense to drop PHP for JavaScript on the server side.
</blockquote>
<p>
You can listen to this latest episode either by using the <a href="http://www.jsclasses.org/blog/post/14-Is-JavaScript-going-to-replace-PHP--Lately-in-JavaScript-podcast-episode-7.html">in-page player</a> or you can <a href="http://www.jsclasses.org/blog/post/14/file/19/name/Lately-In-JavaScript-7.mp3">download the mp3</a> directly.
</p>]]></description>
      <pubDate>Thu, 09 Jun 2011 09:26:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Bence Eros' Blog: Life without static in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15604</guid>
      <link>http://www.phpdeveloper.org/news/15604</link>
      <description><![CDATA[<p>
In <a href="http://erosbence.blogspot.com/2010/12/life-without-static-in-php.html">this new post</a> to his blog <i>Bence Eros</i> shares some of the frustrations and issues he's had when dealing with static methods and properties in his applications and how, with a bit of re-engineering, you might be able to have "life without static".
</p>
<blockquote>
The problem with static members in PHP is the poor initialisation capabilities. The initial value of a static property can only be a literal or a named constant. [...] The same problem exists for non-static properties too, but the constructor is a dedicated place to initialize non-static properties. But since we don't have Java-like static constructors in PHP there is no place to do static property initialization. In a lot of cases people do it by putting the assignment statements after the body of the class, but this method is very ugly.
</blockquote>
<p>
An alternate method he suggests is using a singleton to initialize and grab the value of a class value. He gives some sample code to show how it might be done, but warns that it might not be the right way to do things. It has "significant disadvantages" that could cause trouble down the road (for one, singletons make it difficult to unit test).
</p>]]></description>
      <pubDate>Mon, 20 Dec 2010 13:17:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Seldo.com: PHP needs to die. What will replace it?]]></title>
      <guid>http://www.phpdeveloper.org/news/15239</guid>
      <link>http://www.phpdeveloper.org/news/15239</link>
      <description><![CDATA[<p>
In <a href="http://seldo.com/weblog/2010/09/27/php_needs_to_die_what_will_replace_it">this recent post</a> <i>Laurie Voss</i> has voiced his opinion about the PHP language - that it needs to die, but also asks what should replace it.
</p>
<blockquote>
The reason I know PHP has to die is because I've seen this before. Roughly a decade ago, PHP killed Perl. [...] As a language for newcomers, and especially for web developers, it was already dying in 1999 and was mostly dead by sometime around 2005. [...] There was no reason you couldn't write a perfect web app in Perl, but in PHP you'd do it faster and easier, despite the flaws in PHP itself which were, even then, already obvious. 
</blockquote>
<p>
He talks about moving on from PHP, why almost requiring a framework to do anything these days is a bad thing and how, despite the flaws the language has, he feels "trapped in a language that's losing its suitability for the task." He suggests that one successor might be Ruby on Rails but also points out some of the flaws it has including performance, Active Record and possible issues with code generation. He notes, though, that this isn't quite the replacement he had in mind and that there's just not something there to fill that gap.
</p>
<p>
Be sure to <a href="http://seldo.com/weblog/2010/09/27/php_needs_to_die_what_will_replace_it#comments">read the comments</a> for lots of great opinions from both sides of the PHP opinion fence.
</p>]]></description>
      <pubDate>Wed, 06 Oct 2010 12:19:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrey Hristov's Blog: Replacing mysqli's Connection, Result and Statement classes]]></title>
      <guid>http://www.phpdeveloper.org/news/14770</guid>
      <link>http://www.phpdeveloper.org/news/14770</link>
      <description><![CDATA[<p>
On his blog today <i>Andrey Hristov</i> has <a href="http://hristov.com/oblog/blog/post/2010/07/08/replacing-mysqlis-connection-result-and-statement-classes/">a quick post</a> that talks about two methods to extend the functionality that the mysqli extension offers in PHP with your own custom code.
</p>
<blockquote>
Have you ever though about extending mysqli's classes. It's pretty simple to subclass the connection class mysqli. However, subclassing mysqli_result and mysqli_stmt is not so obvious, actually I though that it's even not possible. However, never say never! After discussing mysqli's OO interface for an hour yesterday [...] I found out how one can plug his own classes.
</blockquote>
<p>
Two code examples are provided - one for extending the mysqli_result and the other extending the mysql_stmt class. You can find more about these and other classes the mysqli extension has to offer in <a href="http://us3.php.net/manual/en/book.mysqli.php">this section of the PHP manual</a>.
</p>]]></description>
      <pubDate>Fri, 09 Jul 2010 10:31:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Noupe.com: Getting Started with PHP Regular Expressions]]></title>
      <guid>http://www.phpdeveloper.org/news/13093</guid>
      <link>http://www.phpdeveloper.org/news/13093</link>
      <description><![CDATA[<p>
Noupe.com has posted <a href="http://www.noupe.com/php/php-regular-expressions.html">a new guide</a> to getting started with regular expressions in PHP. Regular expressions can be one of the most powerful tools at your disposal when used correctly.
</p>
<blockquote>
The main purpose of regular expressions, also called regex or regexp, is to efficiently search for patterns in a given text. These search patterns are written using a special format which a regular expression parser understands.
</blockquote>
<p>
They cover some of the basics - special characters and some examples using them (like $, d, and *) - before getting into the preg_* functions in PHP. They also include some handy examples to validate things like US zip codes, email format validation and removing duplicated words in a section of text.
</p>]]></description>
      <pubDate>Mon, 24 Aug 2009 07:59:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Search & replace in files using php]]></title>
      <guid>http://www.phpdeveloper.org/news/12496</guid>
      <link>http://www.phpdeveloper.org/news/12496</link>
      <description><![CDATA[<p>
On his blog today <i>Sameer Borate</i> has posted <a href="http://www.codediesel.com/php/search-replace-in-files-using-php/">a quick tutorial</a> on how to use a <a href="http://pear.php.net/package/File_SearchReplace/download">PEAR package</a> to do search and replace on your files from inside of PHP.
</p>
<blockquote>
Searching and replacing content in files is a common task all of us do regularly. [...] Search/replace is easier from a shell prompt or an editor, but what if you have to do the same programatically in php. <a href="http://pear.php.net/package/File_SearchReplace/download">File_SearchReplace</a> is a pear package that helps you search/replace in files through a nice object oriented interface.
</blockquote>
<p>
Installation is simple (via the "pear" command line tool) and using it is just as easy. He gives a few examples of how it can be used - everything from a simple find and replace out to a more complicated regular expression search to be replaced with a string.
</p>]]></description>
      <pubDate>Tue, 12 May 2009 09:30:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Fixing -- in WordPress]]></title>
      <guid>http://www.phpdeveloper.org/news/12183</guid>
      <link>http://www.phpdeveloper.org/news/12183</link>
      <description><![CDATA[<p>
After being frustrated that the <a href="http://wordpress.org">WordPress</a> blogging system was "eating" his double dashes (like in a ./configure string), <i>Rob Allen</i> <a href="http://akrabat.com/2009/03/21/fixing-in-wordpress/">went on the offensive</a> and dove into the WordPress code to fix things.
</p>
<blockquote>
One thing that I've noticed is that whenever I used -- in a post, such as <a href="http://akrabat.com/2009/03/05/setting-up-php-on-os-x-leopard/">this</a> one, WordPress converted the -- to &emdash; which whilst very pretty doesn't work so well for people trying to understand command line switches. [...] I tracked it down to the wptexturize function in the wp-includes/functions-formatting.php file.
</blockquote>
<p>
He found and used <a href="http://www.jasonlitka.com/2007/09/25/wordpress-plugin-disable-wptexturize/">this plugin</a> (disable_wptexturize) and the issue disappeared.
</p>]]></description>
      <pubDate>Mon, 23 Mar 2009 07:53:20 -0500</pubDate>
    </item>
  </channel>
</rss>
