<?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 03:49:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Maarten Balliauw: Running unit tests when deploying to Windows Azure Web Sites]]></title>
      <guid>http://www.phpdeveloper.org/news/19110</guid>
      <link>http://www.phpdeveloper.org/news/19110</link>
      <description><![CDATA[<p>
<i>Maarten Balliauw</i> has a new post to his site showing you how to <a href="http://blog.maartenballiauw.be/post/2013/01/30/Running-unit-tests-when-deploying-to-Windows-Azure-Web-Sites.aspx">execute your unit tests</a> (in this case PHPUnit) when you deploy your instance out to the Windows Azure platform.
</p>
<blockquote>
When deploying an application to Windows Azure Web Sites, a number of deployment steps are executed. For .NET projects, msbuild is triggered. For node.js applications, a list of dependencies is restored. For PHP applications, files are copied from source control to the actual web root which is served publicly. Wouldn't it be cool if Windows Azure Web Sites refused to deploy fresh source code whenever unit tests fail? In this post, I'll show you how.
</blockquote>
<p>
He creates a super basic script using <a href="http://silex.sensiolabs.org/">Silex</a> and writes up a test with some dummy assertions, checking if true equals true. He then steps you through updating the current "deploy.sh" script to add in a call to execute PHPUnit and an "exitWithMessageOnError" statement. This statement kicks it back and causes the deployment to fail when tests don't pass (as seen <a href="http://blog.maartenballiauw.be/image.axd?picture=image_257.png">here</a>).
</p>]]></description>
      <pubDate>Wed, 30 Jan 2013 10:25:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann: Using PHPUnit from a PHP Archive (PHAR)]]></title>
      <guid>http://www.phpdeveloper.org/news/18568</guid>
      <link>http://www.phpdeveloper.org/news/18568</link>
      <description><![CDATA[<p>
<a href="http://phpunit.de">PHPUnit</a>, the popular PHP unit testing tool, has undergone some changes in its methods of deployment. First it was integrated into the <a href="https://packagist.org/packages/phpunit/phpunit">Composer/Packagist</a> dependency management system and now it's <a href="http://sebastian-bergmann.de/archives/924-Using-PHPUnit-from-a-PHP-Archive-PHAR.html">been implemented as a <a href="http://php.net/phar">phar</a> archive. <i>Sebastian Bergmann</i> explains how to use it in his latest post.
</p>
<blockquote>
Downloading a single file to use PHPUnit? Not an idea that is too phar out anymore! Starting with version 3.7.5, PHPUnit seems to finally work correctly when packaged as a PHP Archive (PHAR).
</blockquote>
<p>
He includes a list of steps you can follow to pull down the latest code and use the phar branch that executes with the archive file instead of the local "phpunit" executable. Of course, you can still (as always) install PHPUnit via the <a href="http://pear.phpunit.de/">PEAR process</a> as well.
</p>]]></description>
      <pubDate>Mon, 08 Oct 2012 10:18:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Automatic Testing for TDD with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18400</guid>
      <link>http://www.phpdeveloper.org/news/18400</link>
      <description><![CDATA[<p>
If you practice the TDD (test-driven development) methodology in your work, you know that sometimes switching back and forth between a terminal and your IDE can be distracting. In <a href="http://net.tutsplus.com/tutorials/php/automatic-testing-for-tdd-with-php/">this new tutorial</a> from NetTuts.com, they show you how to streamline things a bit with a simple Ruby script.
</p>
<blockquote>
Traditional test-driven development can, at times, be cumbersome. You have to stop writing code in order to run your tests. Luckily, there are solutions, which provide the ability to automatically run your tests as you code. In this tutorial, you will learn how to use a Ruby gem, called watchr, to monitor your code and automatically run the appropriate tests whenever you save your work.
</blockquote>
<p>
The IDE doesn't matter in this case because the "watchr" tool keeps an eye on when things change in the watched directory and automatically fires off a script when it sees an update. They include the few short lines of Ruby to make it all happen and even have the "notify-send" command built in to give you a popup about the pass/fail status.
</p>]]></description>
      <pubDate>Fri, 24 Aug 2012 09:09:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed.com: PHP: Best Methods for Running Scheduled Jobs]]></title>
      <guid>http://www.phpdeveloper.org/news/18152</guid>
      <link>http://www.phpdeveloper.org/news/18152</link>
      <description><![CDATA[<p>
On DevShed.com today there's a new article posted looking at <a href="http://www.devshed.com/c/a/PHP/PHP-Best-Methods-for-Running-Scheduled-Jobs-20103/">methods for running scheduled jobs</a> based on responses to <a href="http://forums.devshed.com/php-development-5/what-is-the-best-method-for-running-scheduled-jobs-in-916361.html">this forum post</a>.
</p>
<blockquote>
I have a webpage form that requires a date and time to be submitted. When it's submitted I need the back-end to run a script at the time and date specified. Have you ever needed to do something like this? 
</blockquote>
<p>Some recommendations already posted include:</p>
<ul>
<li>The UNIX <a href="http://en.wikipedia.org/wiki/At_(Unix)">"at" command</a>
<li>Setting up a queue system to manage the processes (using something similar to <a href="http://gearman.org/">Gearman</a>
<li>Setting up a <a href="http://en.wikipedia.org/wiki/Cron">cron job</a> to handle the periodic execution of the script.
<li>
</ul>]]></description>
      <pubDate>Thu, 28 Jun 2012 11:01:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Where can I find a free place to edit PHP code and see the results?]]></title>
      <guid>http://www.phpdeveloper.org/news/18099</guid>
      <link>http://www.phpdeveloper.org/news/18099</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/v1i2t/where_can_i_find_a_free_place_to_edit_php_code/">this recent post</a> to Reddit.com, the question is asked "Where can I find a free place to edit PHP code and see the results?"
</p>
<blockquote>
Hey everyone,
Recently I was tasked with coming up with some code for an possible job opportunity. I'm wondering if anyone could point me to a place where I can easily write and edit PHP code and see the actual program run.
</blockquote>
<p>Suggestions from the comments include:</p>
<ul>
<li><a href="http://codepad.org/">Codepad.org</a>
<li><a href="http://ideone.com/">Ideone.com</a>
<li>The <a href="http://www.php.net/archive/2012.php">built-in webserver</a> for PHP 5.4.x
<li><a href="http://ignite.io/">Ignite.io</a>
</ul>]]></description>
      <pubDate>Fri, 15 Jun 2012 09:13:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: How to use eval() without using eval() in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17665</guid>
      <link>http://www.phpdeveloper.org/news/17665</link>
      <description><![CDATA[<p>
In <a href="http://gonzalo123.wordpress.com/2012/03/12/how-to-use-eval-without-using-eval-in-php/">this new post</a> <i>Gonzalo Ayuso</i> talks about "using eval without using eval" in PHP applications - executing PHP code without having to use the <a href="http://php.net/eval">eval</a> function to do it.
</p>
<blockquote>
Yes I know. Eval() is evil. If our answer is to use <a href="http://php.net/manual/en/function.eval.php">eval()</a> function, we are probably asking the wrong question. When we see an eval() function all our coding smell's red lights start flashing inside our mind. Definitely it's a bad practice. But last week I was thinking about it. How can I eval raw PHP code without using the eval function, and I will show you my outcomes.
</blockquote>
<p>
He includes some sample code showing a basic script with a class and a loop executing normally, then an "eval version" that puts it all in a string and executes it. He offers a different method - not an ideal one since it requires being able to write to the local file system, but prevents the need for eval - writing the PHP code to a temporary file and using a "fake eval" to <a href="htttp://php.net/include">pull it in</a>.
</p>]]></description>
      <pubDate>Tue, 13 Mar 2012 10:09:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Running JavaScript inside PHP code]]></title>
      <guid>http://www.phpdeveloper.org/news/17609</guid>
      <link>http://www.phpdeveloper.org/news/17609</link>
      <description><![CDATA[<p>
On DZone.com <i>Giorgio Sironi</i> has a new post about an interesting new PHP extension that <a href="http://css.dzone.com/articles/running-javascript-inside-php">lets you run javascript inside PHP</a> - v8js (VERY alpha right now).
</p>
<blockquote>
v8js is a new PHP extension able to run JavaScript code inside V8, Google's JavaScript interpreter that powers for example Chrome and NodeJS. This extension is highly alpha - and its API would probably change in the months ahead. Since documentation is lacking, I invite you to repeat the discovering process I follow in this post in case you find some differences in a new version of v8js.
</blockquote>
<p>
He gives you the (PECL-based) commands to get the extension and it's needed dependencies installed and enabled. He uses PHP's own Reflection features to look at the extension and find its methods including: "executeString", "getPendingException" and "getExtensions". 
 To show it in action, he implements an old standby to test new languages - the <a href="http://www.codinghorror.com/blog/2007/02/fizzbuzz-the-programmers-stairway-to-heaven.html">FizzBuzz</a> example - in Javascript, executed inside the PHP. He also includes a quick example of how to load in an external Javascript file and execute the results.
</p>]]></description>
      <pubDate>Thu, 01 Mar 2012 09:56:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Pavel Shevaev's Blog: Make php-fpm execute arbitrary PHP scripts via socket]]></title>
      <guid>http://www.phpdeveloper.org/news/17045</guid>
      <link>http://www.phpdeveloper.org/news/17045</link>
      <description><![CDATA[<p>
<i>Pavel Shevaev</i> has a quick new post to his blog showing how to get PHP-FPM to <a href="http://efiquest.org/2011-10-22/55/">execute PHP scripts</a> via a socket request.
</p>
<blockquote>
We are using <a href="http://pecl.php.net/APC">APC cache</a> very heavily in our projects and during project deployment the cache must be flushed and warmed up. A common solution to warmup the APC cache is to fetch some special page via HTTP which does the job. The problem with this approach is that it's not reliable enough when PHP is served via several fastcgi back-ends.
</blockquote>
<p>
To solve the problem, he uses a <a href="https://github.com/pachanga/phpfpm">PHP-FPM module</a> to work with the FastCGI socket and execute any file (as permissions allow, of course). In his case, he uses it to "warm up" his APC cache for the user. A code snippet is provided as an example.
</p>
]]></description>
      <pubDate>Wed, 26 Oct 2011 11:19:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Avoiding EVAL()]]></title>
      <guid>http://www.phpdeveloper.org/news/11857</guid>
      <link>http://www.phpdeveloper.org/news/11857</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has a <a href="http://pixelated-dreams.com/archives/232-avoiding-eval.html">helpful hint</a> for avoiding one of the worst functions to use in PHP - <a href="http://php.net/eval">eval</a>.
</p>
<blockquote>
There are a shed-load of ways to "eval()" code without actually calling the eval() function '" usually done simply to avoid the use of the dreaded "evil()" function, but often times because the system has eval() disabled using "disable_functions" in php.ini. Here is another simple way to avoid eval() without writing out files to the filesystem
</blockquote>
<p>
His example uses the streams wrapper to natively execute the code from a string variable as a data element, base64 decoded. It's more of a proof-of-concept than anything else, but its an interesting solution to a tough problem to solve at times.
</p>]]></description>
      <pubDate>Mon, 02 Feb 2009 11:15:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stuart Herbert's Blog: Can You Secure A Shared Server With PHP + FastCGI?]]></title>
      <guid>http://www.phpdeveloper.org/news/11159</guid>
      <link>http://www.phpdeveloper.org/news/11159</link>
      <description><![CDATA[<p>
In a <a href="http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/">new post today</a> <i>Stuart Herbert</i> asks the question "is it possible to secure a shared server with PHP and FastCGI installed on it?" His answer follows...
</p>
<blockquote>
<a href="http://blog.stuartherbert.com/php/2008/10/07/2007/11/21/the-challenge-with-securing-shared-hosting/">The challenge with securing a shared hosting server</a> is how to secure the website from attack both from the outside and from the inside. <A href="http://blog.stuartherbert.com/php/2008/10/07/2007/11/27/phps-built-in-solutions-for-shared-hosting/">PHP has built-in features to help</a>, but ultimately it's the wrong place to address the problem. [...] Before we can look at performance, the first question is: how exactly do we get PHP and FastCGI running as different users on the one web server in the first place?
</blockquote>
<p>
He follows through on this, giving a little mini-tutorial on getting the environment installed on an Apache web server. He includes some benchmarks on the difference between using the Apache 1.3.x series and Apache 2 (generated using the ab benchmarking tool).
</p>]]></description>
      <pubDate>Tue, 07 Oct 2008 10:27:09 -0500</pubDate>
    </item>
  </channel>
</rss>
