Engine Yard Blog: Composer & Continuous Integration

In a new post to the Engine Yard blog Nils Adermann provides an overview of using Composer with continuous integration, its role in the overall process and some good practices to follow in its use.

Continous Integration (CI) is the practice of continuously (and automatically) testing every change a developer makes. So automated tests become an integral part of the development process providing direct feedback on changes made. […] Davey Shafik’s article on Composer’s Lock File explains the typical usage of composer install and update. The key takeaway is that developers should run composer update manually to explicitly update individual dependencies while composer install should be used in automated processes. This principle includes automated test environments.

He points out that using the lock file method reproduces the vendor directory exactly as it is in production and what it means for failures in your automated tests. He also talks about methods to improve the build performance to reduce time spent during the generation of the environment, including the use of the Composer cache data. He includes a few flags you can pass to Composer to reduce not only the libraries it installs but also how it fetches their contents.

Link: https://blog.engineyard.com/2015/composer-continuous-integration
PHPDeveloper.org

DigitalOcean Community Blog: Horizontally Scaling PHP Applications: A Practical Overview

On the Digital Ocean blog there’s a new post with a „practical overview“ of how to effectively scale PHP applications, specifically as it relates to horizontal scaling not vertical.

Shipping a website or application to production has its own challenges, but when it gets the right traction, it’s a great accomplishment. It always feels good to see the visitor numbers going up, doesn’t it? Except, of course, when your traffic increases so much that it crashes your little LAMP stack. […] But fear not! There are ways to make your PHP application much more reliable and consistent. If the term scalability crossed your mind, you’ve got the right idea.

The article starts with a brief overview of what scalability is and the main difference between horizontal and vertical scaling (scaling out vs scaling up). They then get into a bit more detail about what horizontal scaling is and how it commonly works in relation to the average PHP application (complete with diagrams). They also talk about some things you can do inside your code to help make things flow a bit more smoothly including decoupling between services and user session/file consistency measures. There’s also a bit at the end about load balancing but as that depends a good bit on what technology you’re using and the actual load, they just provide an overview and some links to other articles and tutorials with more information.

Link: https://www.digitalocean.com/company/blog/horizontally-scaling-php-applications/
PHPDeveloper.org

PHP.net: PHP 5.6.8, 5.5.24 & 5.4.40 Released (Security Fixes)

The PHP development group has released several different versions of PHP for the 5.5.x, 5.6.x and 5.4.x series with a long list of security issues fixed in each one (fourteen in total):

The PHP development team announces the immediate availability of PHP [5.4.40, 5.6.8, 5.5.24]. 14 security-related bugs were fixed in this release, including CVE-2014-9709, CVE-2015-2301, CVE-2015-2783, CVE-2015-1352. All PHP 5.4 users are encouraged to upgrade to this version.

Other items were fixed besides the security issues, so check out the Changelog to see those few other fixes. It’s highly recommended that you update your installations to these latest versions. You can grab the latest either from the downloads page (source) or Windows users can go to winodws.php.net.

Link: http://php.net/archive/2015.php#id2015-04-16-3
PHPDeveloper.org

Made With Love Blog: Tilde and caret version constraints in Composer

The Made With Love blog has posted a great introduction to version handling in Composer today. They focus in on two characters that can be confusing if you’re not exactly sure what they mean – the carat (^) and tilde (~).

A dependency that uses semantic versioning allows you to predict wether it is still going to work or not when you upgrade it to a new version. Basically when the x in a x.y.z version number changes, you might need to do some changes to be able to work with this new version without problems. […] Depending on your dependency manager you can define version constraints using wildcards (*), comparators like < =, logical operators (, often means AND and | means OR), etc. [...] There are also some syntactic sugar operators like ~ (tilde) and ^ (caret)

They include some examples of both characters in use defining the required install versions, showing how one allows for approximate matches and the version ranges they apply to.

Link: http://blog.madewithlove.be/post/tilde-and-caret-constraints/
PHPDeveloper.org

Phillip Shipley: Creating a PHP Nexmo API Client using Guzzle Web Service Client – Part 2

Phillip Shipley has posted the second part of his series (first part is here) about creating a PHP client for the Nexmo API with Guzzle, the popular PHP HTTP client.

In Part 1 of this series we laid a foundation for consuming the Nexmo SMS API and covered a few ways to interact with it. In this part we’ll create the actual Guzzle Web Service Client to interact with it to demonstrate how simple it can be.

He starts by getting Guzzle installed via Composer including a few extra components: guzzle-services, retry-subscriber and log-subscriber. He defines the structure (code) for the message to send to the Nexmo service. Next up is the creation of the actual client that takes in configuration settings and extracts the HTTP location and applies the provided credentials to the connection. Finally he makes a simple SMS client that extends this base client and puts it to use with a simple message defined in an array (to, from and text contents). The client then reports back the results in a simple nested array with response information from the Nexmo API.

Link: http://www.phillipshipley.com/2015/04/creating-a-php-nexmo-api-client-using-guzzle-web-service-client-part-2/
PHPDeveloper.org

PHP Roundtable: 016: Contributing To PHP 7

The PHP Roundtable podcast has released their latest episode – 016: Contributing To PHP 7 with guests Joe Watkins, Paul Dragoonis, Lorna Mitchell and Joe Ferguson.

You don’t need to be a C programmer in order to contribute to PHP internals. We’ll be discussing how you can get involved with PHP internals, the GoPHP7-ext project and how you can help get PHP 7 ready for release.

You can catch this latest episode through the in-page video player showing the live recording of the show. If you enjoy the episode, be sure to subscribe to their feed too!

Link: https://www.phproundtable.com/episode/contributing-to-php-7-with-the-gophp7-ext-project
PHPDeveloper.org

Laravel Podcast: Episode 24 – Dog At The Keyboard

The Laravel Podcast has released their latest episode (#24) – Dog at the Keyboard.

In this episode, the crew discusses PHP 7, Browserify, and their favorite Mac applications.

A brief description but the show runs about 30 minutes and is hosted by Matt Stauffer and guests Taylor Otwell and Jeffrey Way. You can listen to this latest episode either through the in-page audio player or by downloading the mp3. If you enjoy the show, be sure to subscribe to their feed and get the latest shows as they’re released.

Link: http://www.laravelpodcast.com/episodes/9718-episode-24-dog-at-the-keyboard
PHPDeveloper.org