 | News Feed |
Sections
Community Events
|
| feed this: |  |
Stefan Priebsch's Blog: TDD in a self-experiment
posted Thursday June 26, 2008 @ 07:57:32
voice your opinion now!
BY CHRIS CORNUTT
Stefan Priebsch has posted an overview of some of his experiences with test-driven development in PHP. Specifically, he talks about it in the context of a small CMS he's been working up.
The CMS I am using is a small engine that puts together (potentially multi-lingual) page content, templates, and a site structure, and creates semi-static pages. It does not have a sleek GUI frontend, because by nature I am not afraid of a text editor, and most of the time get quicker results by just writing HTML than fighting with one of these what-you-see-is-what-you-might-get HTML editors.
He talks about the configuration files containing the app's settings (inspired by the YAML Symfony uses) and his work towards the "best matching pattern" algorithm. This is where the TDD came in - he cheated a little with some base classes (tests first!) and then came up with the tests for checking template names and more complex template interactions.
The post includes drops of code here and there as well - examples of the unit tests and of the configuration files.
tagged with: testdriven development tdd example cms template configuration file
Symfony Blog: YAML in symfony 1.1
posted Thursday June 19, 2008 @ 11:18:38
voice your opinion now!
BY CHRIS CORNUTT
This new post on the Symfony blog today looks at using the framework's built-in support for the YAML format. They include a few examples of the code to make the files and how to use them.
Here is a short tutorial about my discovery of the new YAML parsing library that comes with symfony 1.1. As you may know, YAML files are a place symfony developers spend time writing configuration, it is very important they have a good tool to manipulate data and debug files.
They include code showing how to pull in a sample file, access the properties inside of it and how to take a multi-dimensional PHP array and push it back out (automagically) into a new YAML formatted file.
tagged with: yaml symfony framework format configuration tutorial
Ibuildings Blog: Off-The-Shelf Server Setup
posted Friday May 30, 2008 @ 08:43:28
voice your opinion now!
BY CHRIS CORNUTT
On the Ibuildings blog, Ian Barber has a reminder to PHP developers out there used to their servers "just working" because of the popularity of LAMP. He recommends digging a little deeper to the "behind the scenes" of how the server is configured.
PHP programmers generally know what a good systems architecture should look like, but it is often a reality of development that they will have little input on the system itself until the last minute. In fact, it's far from uncommon for a developer to be faced with an off-the-shelf dedicated LAMP server, and left up to their own devices.
He recommends getting to know things like the package manager for your distribution (apt, yum, yast, etc), stripping down the modules your installation is using, check that all of the packages in use need to be enabled and ensure that the network connection is set up correctly and is what you need for the site.
tagged with: oftheshelf default installation configuration behindthescenes lamp server
Eirik Hoem's Blog: Simple config management for PHP
posted Friday May 30, 2008 @ 07:54:50
voice your opinion now!
BY CHRIS CORNUTT
In a new post to his blog today, Eirik Hoem gives an example of using the parse_ini_file function to work with .ini files as configuration for your application.
When doing complex applications it's often nice to have some sort of system for handling settings. PHP has a nice function called parse_ini_file which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a given key is all that's needed.
His example code gives a sample ini file with database connection information and a MyConfigClass that parses the file and can get or set values in it.
tagged with: parseinifile configuration management example code
Carsten Lucke's Blog: Configuration issues with Xdebug on Debian Etch
posted Friday February 01, 2008 @ 12:44:00
voice your opinion now!
BY CHRIS CORNUTT
For anyone that's had an issue with getting XDebug to work with the Debian linux distribution, you might want to check out this helpful hint Carsten Lucke has posted about.
This week I started to setup a Debian-based (Etch) web-server with PHP 5.2 in a virtual-machine with VMWare. Part of this setup was getting XDebug2 integrated. It's really awesome and my students definitely need to learn about it. [...] Building went well as usual but when I tried to integrate the extension inside php.ini it was all weird.
His system kept throwing him an error when he tried to load the shared module using the zend_extension directive, hand things happened. Loading it normally worked (so he knew it wasn't the module) and he finally figured out the problem:
But I need to enable it as Zend extension. Whatever. I finally used the full path to xdebug.so to load it [...] that worked.
tagged with: debian configuration issue xdebug linux zendextension
Developer Tutorials Blog: Why you should be using YAML for config
posted Friday January 25, 2008 @ 11:22:00
voice your opinion now!
BY CHRIS CORNUTT
The Developer Tutorials blog has a new post mentioning the use of YAML structure for creating configuration files in your application.
YAML, or YAML Ain't Markup Language, is a "human friendly data serialization standard". It's essentially a very basic format for storing data, and uses far less syntax than standard PHP. [...] It's almost like English; it's as basic as you want. Of course, that's not to say it doesn’t support complex structures - this example demonstrates the power of the format.
He also points out the spyc extension that makes working with the files in PHP a breeze.
tagged with: yaml config markup language configuration file spyc
|