Posts

Showing posts with the label PHP

Z-Ray Standalone Tech Preview for Linux/OSX available for download

Z-Ray Technology Preview The most advanced debugging & productivity technology for PHP developers - now on your own PHP stack! In just a few steps, you can start introspecting the insides of your code and apps using Z-Ray. Currently supported on Linux and Mac OS X. Z-Ray Standalone Tech Preview for Linux/OSX available for download https://t.co/x4HolzbJJS #PHP #Zend #ZRay #OSX #Linux #debug #technology — Jaan Paljasma (@jpaljasma) October 22, 2015

PHP Developer Cloud to be Closed on September 7, 2014

Image
I received today email notification from Zend Developer Cloud stating that the PHP Developer Cloud (phpcloud.com) will be closed on 09/07/14 for good. Quite surprise (and not so much) from a company as great as Zend. Just FYI - I tried their service only once and after 48 hours of waiting for my virtual instance to become available, I gave up. For your reference, here's the copy of whole email sent today:   Hi Jaan, You are receiving this email because you have created PHP containers on the  phpcloud.com  - Zend Developer Cloud.   When we launched Zend Developer Cloud in 2011, there were few options for PHP developers to experience Cloud development. We set out to deliver a development-only Cloud environment that could provide you a simple and frictionless way to experience development in the Cloud. In parallel, we began working with the leading cloud providers to define Zend Server-based environments that could run your projects at scale once th...

OpsWorks: Deploying your PHP Application Without Restarting Apache

Image
For quite a while now I have been trying to exploit AWS OpsWorks to deploy software updates to our MetaSearch Gateway with less manual work. Before using OpsWorks, I built AWS servers from custom AMI, deployed app using git push to remote, and remote deployment hook pulled latest code updates to a folder; and if there were any secondary servers, these were updated with rsync. Now, AWS OpsWorks is great set of tools, based on famous Chef (currently 11.4 is supported). With little efforts I was able to include and configure necessary PHP extensions to a default PHP Web app: APC memcached Mongo Geoip Since AWS supports also elastic load balancer, I have two 24/7 instances running behind ELB, and third server (load-based) waiting for load to increase. Deployments are quite easy, with a push of a button, code is pulled from remote git and symlinks are updated. Sounds good? Well, too good to be true. By default, after deploying your app, Apache restarts itself; and naturally this c...

Stubbing and Mocking Static Methods with PHPUnit

Image
PHPUnit has ability to stub and mock static methods. Consider the class Foo : <?php class Foo { public static function doSomething() { return static::helper(); } public static function helper() { return 'foo'; } } ?> To test the static helper() function with PHPUnit, you can write you test like that: <?php class FooTest extends PHPUnit_Framework_TestCase { public function testDoSomething() { $class = $this->getMockClass( 'Foo', /* name of class to mock */ array('helper') /* list of methods to mock */ ); $class::staticExpects($this->any()) ->method('helper') ->will($this->returnValue('bar')); $this->assertEquals( 'bar', $class::doSomething() ); } } ?> The new staticExpects() method works similar to the non-static expects...