<?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, 23 May 2013 00:10:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Master Dynamic Content with WordPress Shortcodes]]></title>
      <guid>http://www.phpdeveloper.org/news/18200</guid>
      <link>http://www.phpdeveloper.org/news/18200</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial for the WordPress users out there looking to <a href="http://phpmaster.com/master-dynamic-content-with-wordpress-shortcodes/">work with dynamic content and shortcodes</a> to make your site easier to use and to bring more content to user's attention.
</p>
<blockquote>
The advantages to using shortcodes are obvious. First and foremost, it allows page designs to become far more unique. It also relieves the website administrator from having to create a large list of custom fields in order to perform basic content insertion. [...] And, finally, shortcodes allow a design to come alive and be truly dynamic and interesting to the end user. Too many WordPress blogs and magazine websites have adhered to the format of a big title, a standard block of text, and comments. That no longer has to be case.
</blockquote>
<p>
They talk about using the "functions.php" file for the custom functionality, who to use them in your posts and how to use them in the theme-specific instances. Using the "add_shortcode" you can relate these custom functions to their codes for both simple and more advanced calls (code included). 
</p>]]></description>
      <pubDate>Mon, 09 Jul 2012 11:47:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Generating Invoices with Zend_Pdf]]></title>
      <guid>http://www.phpdeveloper.org/news/16970</guid>
      <link>http://www.phpdeveloper.org/news/16970</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial about using the Zend_Pdf component of the Zend Framework to <a href="http://phpmaster.com/generating-invoices-with-zend_pdf/">generate invoices</a> from the billing data in your application.
</p>
<blockquote>
The PDF format is currently the most used format to exchange documents. If you provide your website users with printable versions of invoices, event tickets and other similar documents, you'll most likely want to generate them as PDFs on the fly. In this article you will see how you can use Zend_Pdf to auto-generate PDF invoices.
</blockquote>
<p>
The concept is pretty simple - take the rows of invoice data from your system and inject them into a new PDF document. They show you how to create an invoice layout that includes that data, a header with your company name, invoice-related information and the total/amount due at the bottom. The full code is included to help you create the Zend_Pdf object, apply the text to it (based on location in the document) and working with the default font. You can download the full source <a href="https://github.com/phpmasterdotcom/GeneratingInvoicesWithZendPdf">from github</a>.
</p>]]></description>
      <pubDate>Mon, 10 Oct 2011 09:07:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Court Ewing's Blog: Create and Validate a Choice List in a Symfony 2 Form]]></title>
      <guid>http://www.phpdeveloper.org/news/16728</guid>
      <link>http://www.phpdeveloper.org/news/16728</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has written up a new post to his blog about <a href="http://epixa.com/2011/08/create-and-validate-a-choice-list-in-a-symfony-2-form">creating a "choice" list</a> (a select list as defined by Symfony 2) with dynamic options and validating the resulting submission. His example uses Doctrine 2 entities to work with most of the data handling.
</p>
<blockquote>
A standard select list can be created using Symfony's choice field type; it is pretty clear how to create a new <a href="http://symfony.com/doc/current/reference/forms/types/choice.html">choice</a> field with simple, non-dynamic options (e.g. gender), but it gets a little more complicated when you want to create and validate a dynamically generated choice list.
</blockquote>
<p>
He includes the code for a simple entity, a Post model to fetch the category information and the set up of the form element - a select list of post types/categories. He also includes a bonus section showing how you can achieve the same thing without a model to bind to. 
 The code's a little bit more complex than the previous example, but it's basically just reproducing some of the validation and fetching logic manually.
</p>]]></description>
      <pubDate>Wed, 17 Aug 2011 08:28:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[RandomBugs.com: Apache Dynamic Virtual Hosting and PHP security]]></title>
      <guid>http://www.phpdeveloper.org/news/16435</guid>
      <link>http://www.phpdeveloper.org/news/16435</link>
      <description><![CDATA[<p>
On the RandomBugs blog today there's a new post looking at some of the considerations made when <a href="http://www.randombugs.com/php/apache-dynamic-virtual-hosting-php-security.html">setting up Apache and PHP for dynamic virtual hosting</a>.
</p>
<blockquote>
It's been a while since I configured the latest Dynamic Mass Virtual Hosting Server. Last time I used mod_vhost_alias to create a dynamic virtual hosting and it worked without any problem for what we need in that time. [...]  Now, the problem is a little bit changed: We need a secure sever which should support ftp virtual users with quota and we don't have permission to change the packages, apply patches or recompile sources, because we need to be able to upgrade without to much stress. 
</blockquote>
<p>
Their biggest problem was dealing with the virtual users and handling the security for them to work with the files and hosts set up for them and only them. They tried both suPHP and a combination of mod_vhost_alias/php safe_mode/openbasedir but neither fit their needs. In the end it was <a href="http://www.cri.ensmp.fr/~coelho/mod_macro/">mod_macro</a> that did the trick with one caveat - you had to be more careful when adding the host to use the correct syntax in the configuration. It's split between multiple files and settings have to match across them.
</p>]]></description>
      <pubDate>Tue, 07 Jun 2011 10:09:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Leonid Mamchenkov's Blog: Disable and enable CakePHP plugins on the fly]]></title>
      <guid>http://www.phpdeveloper.org/news/16243</guid>
      <link>http://www.phpdeveloper.org/news/16243</link>
      <description><![CDATA[<p>
<i>Leonid Mamchenkov</i> has a quick post to his blog showing how to <a href="http://mamchenkov.net/wordpress/2011/04/23/disable-and-enable-cakephp-plugins-on-the-fly/">enable and disable (well, restrict from enabling) CakePHP plugins</a> on the fly - no need to modify config files if you only need it for a certain request.
</p>
<blockquote>
I am currently working on a rather large project which is based on CakePHP framework.  In order to simplify the task, I've broken down the whole application into a number of CakePHP plugins.  Now, however, I want to enable/disable plugins on the fly.  After a brief search around I couldn't find how to do that.  Asking a question at #cakephp IRC channel did it.  RabidFire instantly replied with <a href="http://groups.google.com/group/cake-php/browse_thread/thread/9370aac4a0d80488?fwc=1&pli=1">the link that gave me an idea</a>. 30 seconds later I had a working solution.
</blockquote>
<p>
Since the plugins extend the main AppController, all it took was a beforeFilter() method call that looks at a request parameter for the plugin name, checks against an "allowed" array and throws an exception of it's not found or can't load it.
</p>]]></description>
      <pubDate>Mon, 25 Apr 2011 11:45:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Wojciech Sznapka's Blog: Dynamic LAMP setup for localhost development]]></title>
      <guid>http://www.phpdeveloper.org/news/16093</guid>
      <link>http://www.phpdeveloper.org/news/16093</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Wojciech Sznapka</i> shows you how to <a href="http://blog.sznapka.pl/dynamic-lamp-setup-for-localhost-development/">set up your local development environment</a> so that you're not having to configure a VirtualHost (assuming you're using Apache, of course) each time you want to work on a new project.
</p>
<blockquote>
If you are developing PHP application on your own PC, you probably have some vhost based configuration of your Apache. With some tricks, you can turn your Linux box into powerful development server without configuring vhost for every app. [..] We can ommit two lasts steps [of a typical setup process], limiting preparation of the environment only to place source code somewhere in filesystem. To achieve this we need mod_vhost_alias module for Apache2 and simple DNS server which will resolve local domain names for us.
</blockquote>
<p>
His tip uses the mod_vhost_alias module for Apache and the dnsmasq tool to make the basic DNS server to resolve these custom domains. A few configuration changes later (included) and you're set to restart apache and be on your way.
</p>]]></description>
      <pubDate>Thu, 24 Mar 2011 09:55:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Watermarks in our images with PHP and mod_rewrite]]></title>
      <guid>http://www.phpdeveloper.org/news/15975</guid>
      <link>http://www.phpdeveloper.org/news/15975</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new tutorial posted to his site today showing how to use mod_rewrite and a little bit of PHP magic to <a href="http://gonzalo123.wordpress.com/2011/02/28/watermarks-in-our-images-with-php-and-mod_rewrite/">watermark images</a> without having to apply it to each one manually.
</p>
<blockquote>
he idea is simple. Instead of opening directly the image, we are going to open a PHP script. This PHP script will open the original image file with <a href="http://www.php.net/manual/en/function.imagecreatefromjpeg.php">imagecreatefromjpeg</a>, add the footer and flush the new image to the browser with the properly headers.
</blockquote>
<p>
Since it would be a lot of trouble (especially on a larger site) to have to rewrite all of the &lt;img> tags to point to this new PHP script for adding the watermark, he opts for the .htaccess instead. It catches and rewrites the request to the "watermark.php" file which pulls in that image, watermarks it and pushes the result back out.
</p>]]></description>
      <pubDate>Tue, 01 Mar 2011 08:36:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Objections to dynamic typing]]></title>
      <guid>http://www.phpdeveloper.org/news/15873</guid>
      <link>http://www.phpdeveloper.org/news/15873</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a new post to his blog today about dynamic typing (a big part of PHP's variable handling) and how it has <a href="http://www.eschrade.com/page/objections-dynamic-typing-4d5038ad">nothing to do with scalability</a> in reply to some comments about how using them can hinder the performance of an application.
</p>
<blockquote>
Every once in a while I inject my opinions into places where they are not welcome.  I have heard from people in the staticly-typed realm of how amateur dynamic typing is.  Some people are interested in understanding how to use dynamic typing, others, not so much. So what I would like to do is talk about some of the arguements made against dynamic typing.  Clearly PHP will be my reference point, but many of my points will be salient across many dynamically typed languages.
</blockquote>
<p>
He dispels some of the myths surrounding PHP's dynamic typing. He points out that PHP isn't always dynamically typed, that bad things can happen with compiled code too and that bad or missing validation of data isn't a reason to jump all over variables that could shift types.
</p>]]></description>
      <pubDate>Tue, 08 Feb 2011 11:22:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Adding Multiple Axis Labels to a Google Chart]]></title>
      <guid>http://www.phpdeveloper.org/news/15692</guid>
      <link>http://www.phpdeveloper.org/news/15692</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a tip for those using the <a href="http://code.google.com/apis/chart/">Google Charts API</a> to plot the data from their applications - a simple way to <a href="http://www.lornajane.net/posts/2011/Adding-Multiple-Axis-Labels-to-a-Google-Chart">add multiple axis labels</a> to the chart's output.
</p>
<blockquote>
The axes in Google Charts are a bit interesting, because what they display bears absolutely no resemblance to what data is there - you label the axes separately, even if they are numbers. To label multiple things - in this example a scale and some units, you simply specify the axis more than once.
</blockquote>
<p>
In <a href="http://chart.apis.google.com/chart?chxl=1:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|2:||Week+37&chxr=0,0,20&chxs=0,676767,11.5,0,lt,676767&chxt=y,x,x&chbh=a&chs=360x240&cht=bvg&chco=CC0057CC,3D7930&chds=0,20&chd=t1:10.059,12.578,13.6,11.135,11.018,7.104,6.92|50,60,100,40,20,40,30">her example</a> it creates a bar graph that puts the values for "chxr" and "chxl" on the axis. The <a href="http://code.google.com/apis/chart/">Google Charts API</a> can be used to generate other sorts of dynamic graphs too including the traditional pie, line or scatter charts. It can also create things like QR codes and formula images, all on the fly.
</p>]]></description>
      <pubDate>Thu, 06 Jan 2011 10:32:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: Dependency Injection for static methods]]></title>
      <guid>http://www.phpdeveloper.org/news/15398</guid>
      <link>http://www.phpdeveloper.org/news/15398</link>
      <description><![CDATA[<p>
On the Stubbles blog today there's <a href="http://www.stubbles.org/archives/85-Dependency-Injection-for-static-methods.html">a new post</a> from <i>Frank Kleine</i> showing how you can use a new feature of PHP 5.3 to perform dependency injection on  static method - calling static methods with dynamic class names.
</p>
<blockquote>
Developers who are familiar with the topic of clean code know that static methods are a problem, especially if it comes to testability. Static makes the code global, and if there is some kind of state involved it is even more a problem because this is global state then - both a maintenance and testability nightmare. [...] How can we keep our code clean and testable, at best without having a strongly coupled dependency to the class hosting the static method? Enter dependency injection for static methods.
</blockquote>
<p>
He gives an example of how to use this to create a simple class that can change the name of the object an inner static function call is made to.
</p>]]></description>
      <pubDate>Mon, 08 Nov 2010 12:38:31 -0600</pubDate>
    </item>
  </channel>
</rss>
