- PHP.net: Release of PHP 5.4.41 & 5.5.25
- Product & Support: Interview with Taylor Otwell
- FogCreek.com: How to Find, Hire, and Retain Developers - Interview with Cal Evans
- BeMyCTO.com: Why Doctrine ORM is not suited for PHP
- Site News: Popular Posts for the Week of 05.15.2015
- Matthew Weier O'Phinney: PSR-7 Accepted!
- Acquia Blog: Web Accessibility Tips for Developers - Part 2
- Sound of Symfony: Episode 8 - Concerning command buses
- Ross Tuck: How I Use Traits
- Run Geek Radio: Episode 003 - OpenWest Namebadges, Overtraining, Dev Salary & Freelance Rates, [...]
2015年5月22日星期五
Site News: Popular Posts for the Week of 05.22.2015
Bigcommerce Engineering Blog: PHP Memory Optimization
On the Bigcommerce Engineering blog there's a new post sharing a few tips for memory optimization in your PHP applications. This includes tips you can implement at a code level without too many changes to the server or the need for external services.
Lately, I've been working on optimizing the memory of some of our backend PHP applications and wanted to share some of the tricks that I have come across, especially dealing with large set of data using PHP.
Each of their tips includes code to illustrate the technique:
- Always cap your internal in-memory caching
- Use layered caching
- (Freeing) DB Resources
- Free large blocks of memory
Some of the examples include output from the scripts showing the reduction (or non-growth) of the peak memory usage of the script.
Link: http://bigeng.io/post/119546277718/php-memory-optimization
NetTuts.com: Programming With Yii2: Timestamp Behavior
NetTuts.com has posted the next part of their "Programming with Yii2" tutorial series today. This new tutorial in the series focuses on the use of the timestamp behavior to assign the current date to an object (like for create or update dates).
In this tutorial, we'll explore Timestamp Behaviors, which reduce the amount of code you need to write with each new model for the common operation of creating timestamps for inserts and updates. We'll also dive into the Yii2 source code, examining how a behavior is implemented.
He starts with a brief look at what behaviors are (a reminder for those that may have already read about the sluggable and blameable behaviors). He then gets into the Timestamp behavior specifically and how to apply it to the sample project's "Status" instances. He shows the updates needed for the behavior configuration and rules. He also looks inside the component at the code that makes it up and the "touch" method it provides.
Link: http://code.tutsplus.com/tutorials/programming-with-yii2-timestamp-behavior--cms-23329
Nate Krantz: How I'm Writing Unit / Functional Tests
In a recent post Nate Krantz has shared some of his own methods around writing functional and unit tests.
So...testing. That thing that everyone says is so important but you don't really learn about it in school. I've had some trials and tribulations with testing so I'm going to just dump out some thoughts here.
He starts with a bit of background on his own experiences in development and how he finally decided that testing would "solve everything". He started with unit tests (for a CodeIgniter application) and how he got them up and running. He talks about issues he found around dependencies (and static methods) and how he made use of mocks to reduce some of the issues with dynamic loading, at least how CodeIgniter does it. Unfortunately, this didn't work out as planned so he fell back to a test database and create more effective and simpler functional tests. Code examples are sprinkled through out the post to show how he was trying to solve the problem at different points in the process.
Link: http://www.natekrantz.com/why-test-driven-development-rocks-sucks/
2015年5月21日星期四
Site News: Blast from the Past - One Year Ago in PHP
- Code Yellow Blog: What Your Framework Never Told You About SQL Injection Protection
- NetTuts.com: Refactoring Legacy Code: Part 4 - Our First Unit Tests
- Site News: Popular Posts for the Week of 05.23.2014
- LeaseWebLabs.com: How to use the "yield" keyword in PHP 5.5 and up
- Lorna Mitchell: PHP 5.6 Benchmarks
- Matthias Noback: Inject a repository instead of an entity manager
- Master Zend Framework: Creating Custom ZFTool Diagnostic Classes
- Community News: Latest PECL Releases for 05.20.2014
- HHVM Blog: Hack Community Roundup
- Community News: Latest PEAR Releases for 05.19.2014
- Community News: Packagist Latest Releases for 05.20.2014
- SitePoint PHP Blog: IronMQ and Laravel: Setup
- Three Devs & A Maybe Podcast: virtPHP with Jacques Woodcock and Ben Ramsey
- php[architect]: May 2014 Issue Released - Making a Difference
- Brandon Savage: The framework you learn doesn't really matter
PMG Blog: Symfony from Scratch
In the latest post to the PMG blog Chris Davis shows us how to create a Symfony application from scratch, that is without using the Symfony Standard repository/skeleton application.
The end goal here is to have an application that will send a simple Hello World message. So we're going to cover the core framework stuff, but save things like templating, database access, ORMs, and forms for later. The goal here to see how to scaffold a Symfony app to better understand why symfony standard does what it does and where to deviate. We'll end up with an app that uses the Symfony 3 directory structure.
Starting with the smallest "composer.json" he can (just symfony/symfony) he walks through the creation of the application one step at a time:
- The Application Kernel
- Handling Web Requests
- What's in a Bundle?
- Stepping into Configuration
- AppBundle
- Hello, World
The end result is a simple page outputting a "Hello, World" message, but it gives you a good foundation to work from and understanding of the simplest pieces needed to make a Symfony application.
Link: https://www.pmg.com/blog/symfony-from-scratch/