<?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, 06 Sep 2008 23:16:44 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Matthew Turland's Blog: Environmental Awareness Quickie]]></title>
      <guid>http://www.phpdeveloper.org/news/10691</guid>
      <link>http://www.phpdeveloper.org/news/10691</link>
      <description><![CDATA[<p>
<i>Matthew Turland</i> <a href="http://ishouldbecoding.com/2008/07/26/environmental-awareness-quickie">came across</a> someone having an issue running his PHP-based IRC bot (<a href="http://phergie.org/">Phergie</a>) an an environment where the <a href="http://www.php.net/exec">exec function</a> wasn't allowed:
</p>
<blockquote>
This causes a warning in the <a href="http://trac2.assembla.com/phergie/browser/trunk/Phergie/Plugin/Quit.php">Quit</a> plugin, which uses exec to automatically detection of the full path to the PHP CLI binary on non-Windows systems that it will later use that path to initiate a new PHP CLI process to "restart" the bot.
</blockquote>
<p>
It check this setting for the future, it was recommended that he look at the <a href="http://us3.php.net/manual/en/language.oop5.reflection.php#language.oop5.reflection.reflectionfunction">SPL ReflectionFunction class</a> (a part of the Standard PHP Library) that would let him check the disabled status of any PHP function (looking at the result of the isDisabled call).
</p>]]></description>
      <pubDate>Mon, 28 Jul 2008 07:57:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-GTK Community Site: Enabling code completion for PHP-GTK in your PHP IDE]]></title>
      <guid>http://www.phpdeveloper.org/news/10390</guid>
      <link>http://www.phpdeveloper.org/news/10390</link>
      <description><![CDATA[<p>
The PHP-GTK Community Site has <a href="http://php-gtk.eu/enabling-code-completion-for-phpgtk-in-your-php-ide">posted some information</a> (and some files) to help make your editor of choice a bit more "PHP-GTK aware" when it comes to code completion.
</p>
<blockquote>
These IDEs are able to provide code completion not only for prebuilt extension code, but also for user-level PHP code. This gives us a way to provide it to PHP-GTK developers : all it takes is a "stub" file containing PHP declarations equivalent to the PHP-GTK2 classes, interfaces, and their methods and constants.
</blockquote>
<p>
Making it by hand would be slow (and not efficient at all) so they opted to let the <a href="http://www.php.net/manual/en/language.oop5.reflection.php#language.oop5.reflection.reflector">Reflection</a> API do the heavy lifting for them and generate a Gtk_Dumper output file to hand to your editor and let it parse. The file is <a href="http://php-gtk.eu/sites/php-gtk.eu/files/Gtk_Dumper.php.txt">available for download</a>.
</p>]]></description>
      <pubDate>Wed, 11 Jun 2008 12:04:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tobias Schlitt's Blog: Reflecting private properties]]></title>
      <guid>http://www.phpdeveloper.org/news/9645</guid>
      <link>http://www.phpdeveloper.org/news/9645</link>
      <description><![CDATA[<p>
<i>Tobias Schlitt</i> has <a href="http://schlitt.info/applications/blog/index.php?/archives/581-Reflecting-private-properties.html">posted a handy tip</a> about using the Reflection API in PHP5 - specifically its accessing of private properties in a class.
</p>
<blockquote>
I recently stumbled over reflecting private properties in PHP again. As you might know, this was not possible until now and if you tried this [code] PHP thanked it to you with this [error that is cannot access a non-public member].
</blockquote>
<p>
He notes that, while the <a href="http://schlitt.info/applications/blog/index.php?/archives/581-Reflecting-private-properties.html">behaviour is correct</a>, it still makes things like <a href="http://schlitt.info/applications/blog/exit.php?url_id=4456&entry_id=581">metaprogramming</a> impossible. So, what's a developer to do? Patch it of course! <i>Tobias</i> and <i>Derick Rethans</i> persuaded two other developers  (<i>Derick</i> and <i>Marcus Borger</i>) to include a patch that allows the Reflection API to see these private variables.
</p>
<p>
To make it work, you have to use the setAccessible method on the Reflection object to set which of the properties you want to be able to get at.
</p>]]></description>
      <pubDate>Fri, 15 Feb 2008 12:02:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: Do not trust the reflection API]]></title>
      <guid>http://www.phpdeveloper.org/news/9507</guid>
      <link>http://www.phpdeveloper.org/news/9507</link>
      <description><![CDATA[<p>
On the Stubbles blog, <i>Frank Kleine</i> <a href="http://www.stubbles.org/archives/40-Do-not-trust-the-reflection-API.html">offers some advice</a> to developers looking to use the Reflection API - "don't trust it".
</p>
<blockquote>
If you try to get informations about parameters from methods of internal classes - forget that. Examining several internal classes my key findings are: either there is no information about parameters available and the reflection API says the method does not have any parameters, or the information about the parameter is wrong.
</blockquote>
<p>
He <a href="http://www.stubbles.org/archives/40-Do-not-trust-the-reflection-API.html">includes code examples</a> along side the output from the script to illustrate his point. 
</p>]]></description>
      <pubDate>Mon, 28 Jan 2008 13:07:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mikko Koppanen's Blog: Creating a reflection]]></title>
      <guid>http://www.phpdeveloper.org/news/9079</guid>
      <link>http://www.phpdeveloper.org/news/9079</link>
      <description><![CDATA[<p>
<i>Mikko Koppanen</i> has <a href="http://valokuva.org/?p=82">another example</a> of using the Imagick functionality to create an advanced image - this time, it's about adding a reflection (similar to some of the effects Apple uses in their designs).
</p>
<blockquote>
Here is a simple example of creating a reflection of an image. The reflection is created by flipping the image and overlaying a gradient on it. Then both, the original image and the reflection is overlayed on a canvas.
</blockquote>
<p>
Both the code and an example image are <a href="http://valokuva.org/?p=82">included in the post</a>.
</p>]]></description>
      <pubDate>Tue, 20 Nov 2007 10:20:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sara Golemon's Blog: create_function() is not your friend]]></title>
      <guid>http://www.phpdeveloper.org/news/7880</guid>
      <link>http://www.phpdeveloper.org/news/7880</link>
      <description><![CDATA[<p>
In response to <a href="http://www.phpdeveloper.org/news/7874">this previous post</a> from <i>Felix Geisendorfer</i>, <i>Sara Golemon</i> <a href="http://blog.libssh2.org/index.php?/archives/60-create_function-is-not-your-friend.html">shares a few thoughts</a> on why she thinks it's just the other way around - create_function is not your friend.
</p>
<p>
In the <a href="http://blog.libssh2.org/index.php?/archives/60-create_function-is-not-your-friend.html">short post</a> she lists just a few of the issues surrounding the use of the function including that it:
<ul>
<li>is prone to critical abuse by user-supplied code
<li>skips opcode cache optimizations
<li>encourages not using comments (evil)
<li>100% blind to reflection or PHPDoc style documentation generation
</ul>
</p>]]></description>
      <pubDate>Mon, 21 May 2007 09:31:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: An interesting bug in ReflectionParameter object in PHP 5.2.1]]></title>
      <guid>http://www.phpdeveloper.org/news/7834</guid>
      <link>http://www.phpdeveloper.org/news/7834</link>
      <description><![CDATA[<p>
In a <a href="http://hasin.wordpress.com/2007/05/13/an-interesting-bug-in-reflectionparameter-object-in-php-521/">new blog post</a> today, <i>Hasin Hayder</i> points out an interesting bug he found in the Reflection functionality that's offered in one of the latest PHP5 series release, version 5.2.1 (also found in 5.2.2). It deals with an issue in the ReflectionParameter object.
</p>
<blockquote>
[Despite the closing of <a href="http://bugs.php.net/bug.php?id=33312&edit=1">this bug</a>] there is still the following bug alive in ReflectionParameter object, I tested it against the PHP version 5.2.1 . So what is this bug? The reflection parameter cannot retrieve the default value of a parameter if the next parameter has no default value. PHP simply omits all the variables before that variable and return only values after that variable.
</blockquote>
<p>
He illustrates with a <a href="http://hasin.wordpress.com/2007/05/13/an-interesting-bug-in-reflectionparameter-object-in-php-521/">test class</a> that uses reflection to get the parameters for the constructor. Unfortunately, the object only comes back with the last attribute. This is solved later in the comments, however, when it's discovered that the parameters, some of which are optional, are not in the "correct order" - optional parameters should always follow the required.
</p>]]></description>
      <pubDate>Mon, 14 May 2007 10:11:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: Stubbles 0.1.0 released]]></title>
      <guid>http://www.phpdeveloper.org/news/7735</guid>
      <link>http://www.phpdeveloper.org/news/7735</link>
      <description><![CDATA[<p>
The Stubbles framework team has <a href="http://www.stubbles.org/archives/17-Stubbles-0.1.0-released.html">released the latest version</a> of their framework today - Stubbles 0.1.0:
</p>
<blockquote>
The Stubbles team is proud to announce the release of Stubbles 0.1.0. This release is a first alpha version and contains the basic features of Stubbles like the <a href="http://stubbles.net/wiki/Docs/Reflection">Extended Reflection API</a>, XML handling with <a href="http://stubbles.net/wiki/Docs/XMLStreamWriter">XMLStreamWriter</a> and <a href="http://stubbles.net/wiki/Docs/XMLSerializer">XMLSerializer</a>, <a href="http://stubbles.net/wiki/Docs/Logging">Logging</a>, <a href="http://stubbles.net/wiki/Docs/EventHandling">Event handling</a>, <a href="http://stubbles.net/wiki/Docs/Validators">support for filtering and validating user input</a> and <a href="http://stubbles.net/wiki/Docs/Session">session handling</a>. The release additionally contains parts of packages that we announced to be in the next milestone 0.2.0. 
</blockquote>
<p>
The <a href="http://stubbles.net/">Stubbles framework</a> is one that seeks to "combine your favorite features from other programming languages and frameworks" and is flexible enough to allow for easy interfacing with other frameworks/components like <a href="http://pear.php.net">PEAR</a> or the <a href="http://framework.zend.com">Zend Framework</a>.
</p>]]></description>
      <pubDate>Mon, 30 Apr 2007 13:07:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[O'Reilly: Code As Data: Reflection in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7717</guid>
      <link>http://www.phpdeveloper.org/news/7717</link>
      <description><![CDATA[<p>
On O'Reilly's ONLamp.com website today, there's <a href="http://www.onlamp.com/pub/a/php/2007/04/26/code-as-data-reflection-in-php.html?CMP=OTC-6YE827253101&ATT=Code+As+Data+Reflection+in+PHP">a new tutorial</a> that focuses on something new to PHP's functionality as of the PHP 5 releases - the Reflection API - and examples of using "code as data".
</p>
<blockquote>
However, this can get difficult very quickly, as modern "P" languages often are quite complex, and creating a solid set of regular expressions to describe PHP or Perl would be very difficult. Many syntax highlighters have problems relating to here documents and other special cases. It would be better to let the language's own parser take care of the hard part, as it already knows how to parse itself. In PHP (version 5 and later), we can use the Reflection API to do this.
</blockquote>
<p>
As <a href="http://www.onlamp.com/pub/a/php/2007/04/26/code-as-data-reflection-in-php.html?CMP=OTC-6YE827253101&ATT=Code+As+Data+Reflection+in+PHP">they explain</a>, the Reflection API allows PHP code to look at other PHP code and find out things about it - things like function information, where and what objects are made and much more. In their code example, they create a class to parse a class, grabbing what type each of the methods are, their names, what parameters they take in, and finally, outputting the results as an XML document.
</p>
<p>
Then, using an Ajax frontend to call some backend scripts (corresponding to grabbing various data about a file) to perform some tests on their sample class, including the creation of a class to build the tests themselves.
</p>]]></description>
      <pubDate>Thu, 26 Apr 2007 13:19:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jan Kneschke's Blog: typesafe objects in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7307</guid>
      <link>http://www.phpdeveloper.org/news/7307</link>
      <description><![CDATA[<p>
<i>Manfred Weber</i> <a href="http://manfred.dschini.org/2007/02/19/typesafe-objects-in-php/">points out</a> a <a href="http://jan.kneschke.de/2007/2/19/typesafe-objects-in-php">new blog post</a> from <i>Jan Kneschke</i> concerning the creation of and the idea of typesafe objects in PHP via doc-comments and the Reflection API.
</p>
<p>
From <i>Jan</i>:
</p>
<blockquote>
I always disliked the way PHP handles Objects. There is no way to assign a type to properties. Validators have to be glued against the fields externally and you can't just generate a Object-Description (like WSDL) from a object either.
</blockquote>
<p>
Because of this he's looked into an alternate solution - the typesafe objects. Since, by defauly, PHP's addition of object properties is pretty freeform, making things typesafe is a little difficult. His suggestion, though, uses a combination of comments in the code (declaring what the type of the property should be) and the Reflection API built in to PHP to "look back" at the comments and ensure the type of the property is correct. He even includes examples - a simple one about throwing an error, generating XML this way, and making safe encoded SQL statements.
</p>]]></description>
      <pubDate>Tue, 20 Feb 2007 07:29:00 -0600</pubDate>
    </item>
  </channel>
</rss>
