2011年11月17日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

SitePoint.com: Software Development? We're Doing it Wrong.


On SitePoint today there's a new post from Eran Galperin (of Binpress) about how, if you're jumping immediately to custom software development, you're probably doing it wrong.



Code reuse is largely accepted as "best practice" in our industry. Code reuse has many advantages, such as a smaller code-base which is easier to grok for developers. It's easier to maintain and optimize, since you can make less changes in order to achieve the desired results. Many modern techniques and tools were created in order to better reuse and modularize code. But while we're reusing code, we're duplicating effort. The same code is being written over and over in different places, wasting time and money.


He suggests that custom development should always be a last resort for software development, that there's plenty of other (open source) software out there that meets many of the needs businesses have. In his opinion, component-based development is the future of the industry - pieces that fit together with common interfaces and are larger than the sum of their parts. He sees a "commercial open source" model emerging from the current state of things. This model could result in more well maintained OS projects and more functionality being released as a part of it.



What we have currently is increasing noise, as more and more people have easier access to start programming and publishing their projects. We need to streamline the process and add that missing financial element that makes it sustainable and repeatable.

Symfony Blog: SensioLabs Connect, a week later


On the Symfony Blog today they have an update on their latest community offering, SensioLabs Connect, a service connecting Symfony developers all around the world. It's been one week since the release and there's already some changes happening.



To celebrate our 1000th user on SensioLabs Connect in a week, we have just rolled out a new version that takes into account some of the feedback we had from the community after the launch.


Changes include updates to use Gravatar images if you choose not to upload a photo, fixes for a bug with email confirmations and a few new badges added to the system - "first 100 users", "attendees of SymfonyLive" and ones based on seniority in the community. A public API is in the works, but you can grab a profile in json by adding ".json" to the end of a profile URL (like Fabien's).

2011年11月16日星期三

Community News: Latest Releases from PHPClasses.org

Kevin Schroeder's Blog: Connecting to PHPCloud.com through Zend Studio 9


If you're a Zend Studio user and have been wondering how to hook it directly into the phpcloud service from Zend, Kevin Schroeder has posted complete instructions in a new post today (complete with screenshots).



PHPCloud.com is the landing page for our new cloud offering. Using the Zend Application Fabric you can build your applications in the same environment as you will be deploying your apps to. The application is built on my.phpcloud.com and you can then deploy it onto any platform where the Fabric is supported. But how do you get started? Phpcloud.com has been built in a way where you can connect with any IDE. With Zend Studio 9 that connectivity has been built directly in to the IDE.


It's a simple six (well, technically seven) step process that involves setting up a new project, configuring some deployment options and hitting "deploy". Zend Studio makes it super simple to launch your application as many times as you need - a one-click deploy once things are all set up.

Lorna Mitchell's Blog: Handling SQL Errors in PDO


Lorna Mitchell has a quick new post showing one way to handle SQL errors in PDO that could pop up because of badly written/generated SQL statements.



I love PHP's PDO (PHP Data Objects) extension; it gives a consistent, object-oriented interface to handling all kinds of relational database backends. One thing that annoys me is that the MySQL driver for PDO defaults to a silent error mode which can make SQL errors tricky to spot!


In her two code snippets she shows a failing PDO request (that fails silently) and a method for catching this issue - checking the result of the "errorCode" method to see if it equals "0" (zero). If there were errors, you can use the "errorInfo" function to get to them. This will return the SQL error code, the driver-specific error code and a driver-specific error message.