PHPDeveloper.orghttp://www.phpdeveloper.org
Up-to-the Minute PHP News, views and communityen-usTue, 03 Mar 2015 13:02:25 -060030http://www.phpdeveloper.org/news/21781http://www.phpdeveloper.org/news/21781
On the SitePoint PHP blog today there's a post introducing you to the concept of building a framework with Symfony components, using only the ones you need from the Symfony framework ecosystem to create a customized framework to fit your needs.

You've probably met Symfony in your PHP career - or have at least heard of it. What you may not know is that Symfony is, at its core, composed of separate libraries called components, which can be reused in any PHP application. For example, the popular PHP framework Laravel was developed using several Symfony components we will also be using in this tutorial. The next version of the popular CMS Drupal is also being built on top of some of the main Symfony components. We'll see how to build a minimal PHP framework using these components, and how they can interact to create a basic structure for any web application.

He covers some of the main parts of the framework, how to grab the components that will help with some of the common functionality and integrating them to work together. He uses the HttpFoundation, HttpKernel, Routing and EventDispatcher (along with their own dependencies) to create a simple example that will respond to a few different route requests.

Link: http://www.sitepoint.com/build-php-framework-symfony-components/]]>Fri, 03 Oct 2014 09:12:05 -0500http://www.phpdeveloper.org/news/19424http://www.phpdeveloper.org/news/19424
On the QaFoo blog today the company is introducing a new tool to help PHP developers write better, more optimized code - the PHP Refactoring
Browser (written in PHP too).

Without continuous refactoring, code maintainability and extensibility will start to decrease fast, even if it has tests. Until now, only IDEs contained functionality to perform automated refactorings. And then even only PHPStorm contains the most important refactorings such as "extract method". Today we release the PHP Refactoring Browser, a refactoring tool written completely in PHP. It is based on several outstanding open-source libraries.

The browser currently supports multiple refactoring methods including the extract method, renaming of local variables and converting a local variable to an instance. They include some example code and the result from the execution of the tool. The output shows where refactoring would work best with some color coding and formatting.

Link: http://qafoo.com/blog/041_refactoring_browser.html]]>Mon, 08 Apr 2013 09:49:33 -0500http://www.phpdeveloper.org/news/18202http://www.phpdeveloper.org/news/18202
On the Symfony blog there's a recent post talking about the availability of the SF2 packages as standalone components available for separate downloads.

Each Symfony Component has been available as a standalone "package" for a very long time, but this is the first time I post something about this on this blog. That's because the way it was done was quite experimental... until recently. Why is it useful? Let's say you have a project that does not use Symfony, the full-stack framework, but you still want to rely on a few Symfony Components like YAML, Console, and Process for instance. In that case, instead of depending on the main symfony/symfony code, your project can just depend on these specific components.

An example of the composer.json configuration needed to grab individual components and define a "minimum stability" for the sources.

The new version has been online for the last week and the Components are now updated 1 or 2 minutes after some changes are pushed to the Symfony component. Unfortunately, we have had one force push during that time due to a bug in the Git subtree command (I haven't found the time to submit a bug report yet).

Some watchful readers pointed out some subtle but nonetheless important bugs in the framework we have built yesterday. When creating a framework, you must be sure that it behaves as advertised. If not, all the applications based on it will exhibit the same bugs. The good news is that whenever you fix a bug, you are fixing a bunch of applications too. Today's mission is to write unit tests for the framework we have created by using PHPUnit.

He includes the XML for a basic phpunit.xml configuration file and uses a UrlMatcher and ControllerResolver in a "Framework" class and makes the test check for "not found" URLs and for checking for a correct Response.

]]>Tue, 17 Jan 2012 09:39:26 -0600http://www.phpdeveloper.org/news/17396http://www.phpdeveloper.org/news/17396
Fabien Potencier has posted the seventh part of his series looking at how to make a custom framework on top of the components from the Symfony2 framework. In this part of the series he improves his basic framework by adding some namespacing to organize the application a bit more.

If you have a closer look at the code, front.php has one input, the Request, and one output, the Response. Our framework class will follow this simple principle: the logic is about creating the Response associated with a Request. As the Symfony2 components requires PHP 5.3, let's create our very own namespace for our framework: Simplex.

He puts the main front controller in just the "Simplex" namespace but adds in others for the controllers and models. He also updates his Composer configuration to create some PSR-0 autoloading.

]]>Mon, 16 Jan 2012 08:46:22 -0600http://www.phpdeveloper.org/news/17362http://www.phpdeveloper.org/news/17362
Fabien Potencier has posted the third and fourth parts of his "Build a framework on top of Symfony2 components series to his blog:

Part three adds on another page to the sample site, creating a front controller and changing the output to use "setContent()" instead of just echoing the data.

In part four he refactors the code to be a bit more readable, adds in the Symfony2 Routing component to correctly get the requests to the right controller and an example of how to generate routes based on route definitions.

]]>Mon, 09 Jan 2012 09:31:55 -0600http://www.phpdeveloper.org/news/17348http://www.phpdeveloper.org/news/17348
Fabien Potencier is back with the next installment of his "Building a framework on top of Symfony2" tutorial series with this look at using the HttpFoundation component to use the Request and Response classes to handle HTTP interaction. (Part one is here.)

The first step towards better code is probably to use an Object-Oriented approach; that's the main goal of the Symfony2 HttpFoundation component: replacing the default PHP global variables and functions by an Object-Oriented layer.

He shows how using this component not only makes OOP handling of requests/responses simpler, but also helps to make your application more secure through features already included in the HttpFoundation component. Sample code is included showing how to fetch the current request, get filtered values from the superglobals (GET/SERVER/etc) and how to respond with a refactored version of the "Hello world" message from the previous example.

]]>Thu, 05 Jan 2012 08:11:27 -0600http://www.phpdeveloper.org/news/16524http://www.phpdeveloper.org/news/16524
Fabien Potencier has a new post to the Symfony blog today - an announcement about the setup of a PEAR channel to make it easier to grab the various Symfony components individually.

One of the strengths of Symfony2 lies in its components; they define the building blocks of the framework and they can be used as standalone libraries. [...] The Symfony2 components have been available on Git for quite some time now, and as of today, I'm really excited to announce that they are also installable via the brand new Symfony2 PEAR channel, powered by Pirum of course.

Packages included in the list installable on the PEAR channel include:

]]>Mon, 27 Jun 2011 14:16:20 -0500http://www.phpdeveloper.org/news/11573http://www.phpdeveloper.org/news/11573
eZ Components, the enterprise-ready library of PHP components (that can be used together or separately for PHP applications has made a new release candidate available for download:

The eZ Components team just released a release candidate of the new
2008.2 release. This release candidate resolves a couple of issues that
where found during the testing and review process. The release candidate
can be installed by running the following command: pear upgrade ezc/ezcomponents

]]>Mon, 15 Dec 2008 12:07:15 -0600http://www.phpdeveloper.org/news/11420http://www.phpdeveloper.org/news/11420
The latest version of the Zend Framework, 1.7.0, has officially been released:

The Zend Framework team would like to thank everyone who made this release possible. As always, our generous ZF community has provided countless new features, bug fixes, documentation translations, etc. We'd also like to thank Adobe Systems and Wade Arnold for contributing the new Zend_Amf component. A big thanks to PHP Belgium and everyone who participated in bug hunt day and/or the Zend Framework bug hunt week.

This update includes lots of new components and features such as: an update to Dojo, Zend_Service_Twitter, support for Open Office Documents in the Zend_Search_Lucene component, Zend_ProgressBar, I18N improvements and much, much more. Check out the full list on this post on the Zend Developer Zone or just head over the download the latest edition.

You can also check out some of Matthew Weier O'Phinney's comments over on his blog as well as thoughts from Zend's own Andi Gutmanson his blog.