Latest PEAR Releases:
Latest PEAR Releases:
Joeri Verdeyen has posted a tutorial showing you how to use a combination of CoreOS and Docker as a PHP development environment. This is an alternative to the more frequently used Vagrant VM provisioning popular among developers.
I’ve been using the Vagrant provisioned-with-Ansible-setup for a while now. But for the last month(s) I’ve been playing around with things like: Docker, boot2docker, CoreOS, etcd, .. I managed to setup a fast and easy way to develop my PHP applications. Symfony2 is my preferred weapon of choice, so I’ll explain how I’m developing a Symfony2 app.
He starts with the software you'll need installed to get his example up and running, all installable via "brew". He shows how to configure the CoreOS via Vagrant and bring the box up. He then sets up the Docker client to point to the newly created VM as its server. He then creates a
docker-compose.yml file to set up the necessary services including nginx, MySQL and (of course) PHP. He then shows the command to run the container, execute the configuration and ensure that all containers are configured correctly. Finally he runs the Composer installation command (Symfony2, remember) and clear the cache.
The Laravel Podcast, hosted by Matt Stauffer with guests Jeffrey Way and Taylor Otwell, has posted their latest episode - Episode #31: Public Speaking Preppers.
In this episode, the crew discusses preparing for conference talks, vacationing, and dreamy destinations!
You can listen to this latest post either through the in-page audio player or by downloading the mp3 directly. Be sure to subscribe to their feed or follow them on twitter for more information about the latest episodes as they're released.
Matthew Weier O'Phinney has a new post to his site talking about PSR-7 and HTTP headers and how they (headers) are handled in the structure of this PHP-FIG specification.
Yesterday, a question tagged #psr7 on Twitter caught my eye: "When I call $request->getHeader('Accept') for example, I was expected that I'll get [an array] but, in reality I got [a string]. Is this correct?" In this post, I'll explain why the behavior observed is correct, as well as shed a light on a few details of header handling in PSR-7.
He talks about the planning that went into PSR-7 and how they had to work around some of the "flexibility" (quirks) in the HTTP specification. This was especially true when it came to repeated headers. He also walks through their thoughts on multiple header handling and that custom header values are allowed. Because of these two things, they decided to treat all headers as collections and, despite there being separators already in the values. Instead they collected headers of the same types into these collections, some containing only one value while others could contain multiple. Back to the question - this explains why the "Accept" header they desired was still in its comma-separated form and not split into the array they expected.
The [...] example provides another good lesson: Complex values should have dedicated parsers. PSR-7 literally only deals with the low-level details of an HTTP message, and provides no interpretation of it. Some header values, such as the Accept header, require dedicated parsers to make sense of the value.
Cees-Jan Kiewiet has posted an article covering the
cache directive on The popular Travis-CI continuous integration service and how it can have an effect on your builds.
Ever since the Test lowest, current, and highest possible on Travis post I wanted to dive into caching composers cache and vendor on Travis. My experiments started the day after that post.
He starts with an example of a simple
.travis.yml build configuration that includes the
cache directive, showing the caching of entire directories. He points out that, while this can speed up builds, it also comes with a few problems - one being that cache inconsistencies could cause unintended side effects when major changes are made. He points out that most of these risks are worth the gain, though. He's seen a gain of around 40 seconds for a normally 50 second job.
The new PEAR installer release adds PHP 7 support while dropping support for PHP 4 - 5.3. It also fixes a nasty SSL issue that made it hard to use on PHP 5.6. With the update, strict warnings about static calls to a non-static PEAR::isError() are a thing of the past.
I've just published the first preview version: PEAR 1.10.0dev1.
Upgrading your version of the PEAR installer is as simple as a call to
pear upgrade specifying this dev1 release (command is included in the post). He also links to some pre-release versions of the
Host Cal Evans talks with the organizers of the conference, Rich Sage, Dave Baker and James Titcumb, about why they started the conference and what they hope to provide. Cal also asks about the bad side of things, what was the worst thing that happened as a part of planning the event. He also asks them about the speaker selection and how they handled the rejection letter. To counter, he also asks them about what the best part about planning and putting on the event was. Finally he asks each of them about their local user groups, when and where they meet and what their format looks like.
You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly for listening offline. Be sure to subscribe to their feed too if you enjoy the episode!
The SitePoint PHP blog has posted a tutorial that want to help you speed up your applications with Redis, adding in caching to help reduce the overall processing load your app has to expend.
The application in question, when executing a query, runs off to Diffbot’s API and makes it query the dataset. The subset is then returned and displayed. This can take up to 5 or so seconds, depending on the busyness of Diffbot’s servers. While the situation will undoubtedly improve as they expand their computational capacity, it would be nice if a query executed once were remembered and reused for 24 hours, seeing as the collection is only refreshed that often anyway.
Considering the fact that implementing this cache costs us literally nothing (and actually reduces costs by reducing strain on the servers), adding it in is an easy win, even if it weren’t used as often as one would hope. There is no reason not to add it – it can only benefit us.
He helps you get Redis up and running as a service on the local system and installing the Predis, the PHP library you'll use to talk with Redis for setting and getting the cached information. He includes a few code snippets showing how to send the search off to the DiffBot API, return the results and push them into the cache as serialized data with a day long timeout. He also mentions the phpiredis extension to reduce some of the overhead that could be cause by using a PHP library versus an extension.
Luciano Mammino has posted six tips for blazing fast web applications to his site. These tips aren't as much specific to the code (though they're related) as they are general good practices around architecture, development work and common issues.
In this post I will try to highlight some of the most common principles that you have to take under consideration when you want to achieve a great level of performance while building a web application (specifically on the backend part). I believe the concepts discussed here can be applied to any language and framework even if, due to my specific experience, I will mention some examples, design patterns, conventions and tools that are mostly used in the PHP world.
His post lists out six main rules along with some description and links to other tools for each:
There's lots of good tools mentioned here so find one that fits your needs and helps solve the issue. There's also some good articles mentioned, giving more information about a particular topic or other perspectives on how to solve it a different way.
Rob Allen has posted a guide showing you how to make your code PSR-2 compliant with the help of some handy tools, both in and out of your editor/IDE.
Most of the projects that I work on follow the PSR-2 coding style guidelines. I prefer to ensure that my PRs pass before Travis or Jenkins tells me, so let's look at how to run PSR-2 checks locally.
He looks at three different methods - not the only ones out there but three quick to implement ones:
There's links to the tools mentioned here and screenshots/configuration information showing how to get it set up too.