<?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>Sun, 26 May 2013 02:53:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Debugging PHP Code with FirePHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18673</guid>
      <link>http://www.phpdeveloper.org/news/18673</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you a different method for debugging your code than the usual <a href="http://php.net/print_r">print_r</a> or <a href="http://php.net/var_dump">var_dump</a> - <a href="http://phpmaster.com/debugging-php-code-with-firephp/">using FirePHP</a>, a tool that uses messaging to relay information back to your browser.
</p>
<blockquote>
As the technical manager of a suite of software projects, one of my duties is doing code reviews. One of the things I see far more often than I'd like when doing reviews is debugging PHP code committed and pushed up the chain. [...] The safest method of debugging requires configuring your IDE to use a tool like Xdebug or Zend Debugger to trace currently executing code. This isn't always practical. In the absence of using a fully configured debug environment, I turn to FirePHP.
</blockquote>
<p>
He shows how to set up and configure <a href="http://www.firephp.org">FirePHP</a> to work with your debugging and some suggestions on browser extensions you can install to view the messages. Sample code is included showing you how to use the tool to send messages back to the browser including grouping messages, building tables and something that shows a conditional caching report message.
</p>]]></description>
      <pubDate>Tue, 30 Oct 2012 08:36:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Setting Custom Error Messages for Zend_Form_Element]]></title>
      <guid>http://www.phpdeveloper.org/news/18589</guid>
      <link>http://www.phpdeveloper.org/news/18589</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post for all the Zend Framework (v1) users out there. In it, <i>Aurelio De Rosa</i> shows you how to <a href="http://phpmaster.com/setting-custom-error-messages-for-zend_form_element/">set custom error messages</a> for elements in a Zend_Form.
</p>
<blockquote>
In this article I'll show the solution to a common problem which arises when a developer has to create a non-English website or application that is based on the Zend Framework. How do we mark a field of a Zend_Form which is a Zend_Form_Element as invalid, showing one or more custom error messages? The problem is mainly caused by the native counter-intuitive methods of the Zend_Form_Element class which I'll explain in more details.
</blockquote>
<p>
He's included a basic example showing the creation of a form and the setup of a text element and some validators to match. He makes a controller and view to handle the output and submission then shows how to use "setErrors" (and "setErrorMessages") of the Zend_Form elements to setup that custom error. This only lets you set one message, though, regardless of the point of failure. To stop things when there's an error, you have to set the "breakChainOnFailure" parameter on the validator to false - then the message will make more sense.
</p>]]></description>
      <pubDate>Thu, 11 Oct 2012 08:58:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[LearnComputer.com: Sending Text Messages with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18515</guid>
      <link>http://www.phpdeveloper.org/news/18515</link>
      <description><![CDATA[<p>
In <a href="http://www.learncomputer.com/text-messages-with-php/">this new tutorial</a> on LearnComputer.com, they show you how to, using a simple call to PHP's <a href="http://php.net/mail">mail</a> function, you can send a text message to anyone.
</p>
<blockquote>
Text messaging seems more convenient than making phone calls and creating your own PHP script to send these messages is a very easy thing to set up. Get on board with these other companies that have found how convenient text messages are for their customer and start integrating text messaging into your PHP applications. In this article, I will show you two ways to accomplish this and you will be surprised at how simple this is to do.
</blockquote>
<p>
Once you've found the <a href="http://www.venture-ware.com/kevin/web-development/email-to-sms/">right email address for the provider</a>, sending the message is pretty simple using <a href="http://php.net/mail">mail</a>. As an alternative, they recommend a service like <a href="http://www.textmagic.com/">TextMagic</a> to send the messages. It's a bit more reliable and uses SMS instead of email to get your message out.
</p>]]></description>
      <pubDate>Tue, 25 Sep 2012 09:15:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dean Clatworthy: Theming/styling error messages in Symfony 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18424</guid>
      <link>http://www.phpdeveloper.org/news/18424</link>
      <description><![CDATA[<p>
For the Symfony2 users out there, <i>Dean Clatworthy</i> has a handy tip to help you customize the output of your application a bit more - a method for <a href="http://www.deanclatworthy.com/2012/08/theming-error-messages-in-symfony-2/">styling the error messages coming from forms</a> using a custom template.
</p>
<blockquote>
I spent a large portion of my day today trying to customize the HTML produced by Symfony 2 for form errors. The documentation has a section on how to do this, but for the life of me, I could not make it work. Here is a working, re-usable solution.
</blockquote>
<p>
His solution involves the creation of a template in your "/Resources/views/Form/" directory that contains a Twig template for the error set output. This is then applied in your view using an additional parameter on the error output tag, including this new template from the "Form" directory. This sort of styling could also be applied if you needed custom elements with their own layouts in your forms as well.
</p>]]></description>
      <pubDate>Thu, 30 Aug 2012 11:40:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Message Brokering with RabbitMQ]]></title>
      <guid>http://www.phpdeveloper.org/news/18385</guid>
      <link>http://www.phpdeveloper.org/news/18385</link>
      <description><![CDATA[<p>
On PHPMaster.com today they've posted a new tutorial that helps you get started adding queuing to your application <a href="http://phpmaster.com/message-brokering-with-rabbitmq/">with PHP and RabbitMQ</a>.
</p>
<blockquote>
RabbitMQ is open-source message brokering software written in Erlang. The MQ in its name refers to a standard known as Advanced Message Queuing Protocol.  For our purposes, and most others, it acts as a middleman between producer (sending) and consumer (receiving) programs - it simply accepts and forwards messages. [...] Both producers and consumers can be written in any language that has an available RabbitMQ or AMQP client library. In this article, I'll demo a producer program written in PHP and a consuming program in Python.
</blockquote>
<p>
He walks you through the installation for both <a href="http://www.rabbitmq.com/download.html">RabbitMQ</a> itself and the PHP (<a href="https://github.com/videlalvaro/php-amqplib">php-amqlib</a>) and Python (pika) tools to use for the interfaces. There's some details on how the queuing system works and the code for the sample clients is included as well as commands to use the two clients to send/receive messages.
</p>]]></description>
      <pubDate>Tue, 21 Aug 2012 11:04:07 -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[Court Ewing's Blog: Common, Cryptic PHP Errors]]></title>
      <guid>http://www.phpdeveloper.org/news/17892</guid>
      <link>http://www.phpdeveloper.org/news/17892</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has a new post to his blog describing some of the most <a href="http://epixa.com/2012/04/common-cryptic-php-errors.html">common cryptic errors</a> that you might come across in your day-to-day development.
</p>
<blockquote>
If you've been programming for awhile, then you've probably experienced your fair share of cryptic error messages. It's understandable that building in detailed error messages that are clear to even novice developers is not always a high priority for programming languages when there are so many other features to create and issues to address. The PHP language has decent error messages, but it is by no means an exception to this rule.
</blockquote>
<p>
The three errors he covers are probably familiar to anyone that's been working with PHP for any length of time:
</p>
<ul>
<li>Fatal error: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
<li>Fatal error: Can't use function return value in write context
<li>Fatal error: Exception thrown without a stack frame in Unknown on line 0
</ul>]]></description>
      <pubDate>Tue, 01 May 2012 13:09:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Artur Ejsmont's Blog: Publishing queue messages from PHP using different backends]]></title>
      <guid>http://www.phpdeveloper.org/news/17729</guid>
      <link>http://www.phpdeveloper.org/news/17729</link>
      <description><![CDATA[<p>
<i>Artur Ejsmont</i> has <a href="http://artur.ejsmont.org/blog/content/publishing-messages-from-php-to-different-message-queue-backends">a new post</a> sharing some benchmarks he put together about the "messages per second" and "time to execute" when using PHP to pull from various messaging backends.
</p>
<blockquote>
I have looked at the state of different messaging backends recently and i ran a little benchmark to see what is the rough comparison of message publishing throughput. Results that i got are quite surprising. What i wanted to achieve is some sort of reassurance before choosing a messaging bus for my PHP project. 
</blockquote>
<p>
Running both the PHP and the messaging test scripts on the same server, he pulled from a few different backend systems - RabbitMQ, MySQL, MongoDb, Memcached and ActiveMQ. The results were interesting, showing an interesting result in the time it took to execute versus the number of messages per second pushed in. 
</p>]]></description>
      <pubDate>Mon, 26 Mar 2012 11:31:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mfana Ronald Conco's Blog: RabbitMQ and PHP Part 2 - Durable Queues and Persistent Messages]]></title>
      <guid>http://www.phpdeveloper.org/news/17717</guid>
      <link>http://www.phpdeveloper.org/news/17717</link>
      <description><![CDATA[<p>
<i>Mfana Ronald Conco</i> has posted the second part of his RabbitMQ and PHP series to his blog today. This time he looks at <a href="http://www.theprogrammer.co.za/2012/03/19/rabbitmq-and-php-part-2-durable-queues-and-persistent-messages/">durable queues and persistent messages</a>
</p>
<blockquote>
You now have a queuing system that works and generates pdfs which are sent to users as per <a href="http://www.theprogrammer.co.za/2012/03/14/rabbitmq-and-php-part-1/">RabbitMQ and PHP Part 1</a> of this article. A week later after launching the queuing system you get one or two queries from users who claim to have made a request to get the pdf report but it never arrived. Okay, what could have happened ? well you go through the application log files and as suspected  - An Exception was thrown by one your classes as the consumer was trying to create the pdf and that is why it was never sent. Now this compromises the queuing system Totally, But wait there is a way to help prevent such.
</blockquote>
<p>
He shows how to make your queues "durable", meaning they'll survive a broker restart and they require a response from the consumer before being removed. He shows how (via the <a href="http://www.php.net/manual/en/book.amqp.php">php-ampq</a> functionality) to add the "AMPQ_DURABLE" flag to the queue definition. He also includes some code showing how to send back the acknowledgement so the entry can be removed from the queue. He also includes an update to the code that calls "publish" to make the messages persistent too.
</p>]]></description>
      <pubDate>Thu, 22 Mar 2012 13:39:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Understanding the Command Design Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/17335</guid>
      <link>http://www.phpdeveloper.org/news/17335</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new article introducing you to the Command design pattern and looking to help you <a href="http://phpmaster.com/understanding-the-command-design-pattern">understand its use a bit better</a>.
</p>
<blockquote>
The majority of [cell phone] users have opted to receive an email, but a significant number are now opting to receive the notifications via SMS. Here's the problem: How do you send a message via two different channels to both groups of users? The logical approach would be to split the users into 2 groups, email recipients and SMS recipients, which would involve running 2 different queries and sending the codeword to each group separately. Using the Command Pattern, which I will introduce you to in this article, you can send the message to both groups of users in a single process.
</blockquote>
<p>
He uses the message queue he mentioned as an example - showing how you can can queue up different kinds of objects (actions) based on a common interface into the same process. He creates a "DailyAlertEmail" and "DailyAlertSMS" classes, both with a "send" method. The settings for these are then pulled from a database and the "execute" method on the "MessageQueue" class is called to loop through them, calling "send" to do that work.
</p>]]></description>
      <pubDate>Tue, 03 Jan 2012 08:25:29 -0600</pubDate>
    </item>
  </channel>
</rss>
