Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NetTuts.com:
Easy Package Management for CodeIgniter with Sparks
Nov 25, 2011 @ 17:00:51

On NetTuts.com today there's a new tutorial showing off a package management system for the CodeIgniter framework, Sparks, that makes installing and using packages similar to Ruby's gems.

Sparks is a new package-management system for CodeIgniter that extends the core with support for gem-like sparks. This tutorial interweaves an entry-level overview of the architecture and usage of the sparks system with the creation of dovecote—a simple spark for managing RSS data.

The tutorial introduces you to the Sparks system and helps you get it installed and configured to work with a first basic package - a dovecote example. He helps organize and write the first spark as well as set up any dependencies and autoloading it might need. He follows this by adding some functionality to the package to make pushing output to the view simpler.

You can download the source for the complete tutorial's code.

tagged: package management codeigniter sparks ruby gem

Link:

DZone.com:
Creating a virtual server with Vagrant: a practical walkthrough
Nov 18, 2011 @ 14:18:45

On DZone.com there's a new post from Giorgio Sironi looking at how to automate a build of a virtual server with Vagrant, setting up a LAMP-based development instance.

Vagrant ia a tool for building virtual machines (in VirtualBox's format) that conforms to a specification. It's written in Ruby, but it makes really no assumptions over the environments that you're gonna build; in this article, we will setup a virtual server for PHP applications running inside Apache.

The end result is a virtual machine based on VirtualBox images and can be built in a few easy steps:

  • install the vagrant gems on the build system
  • add a new virtual box instance pointed to a .box file
  • create the Vagrant config (including the commands to run post-create)
  • set up a little port forawrding
  • creating a phpinfo file and starting up Apache

One suggested place for grabbing images (some with pre-defined software) is Bitnami's "Stacks" repository.

tagged: vagrant ruby gem install tutorial virtualbox image build

Link:

Raphael Stolt's Blog:
Measuring & displaying Phing build times with buildhawk
Nov 22, 2010 @ 16:53:20

Raphael Stolt has a new blog post today looking at his method for measuing Phing build times with the help of a Ruby gem called buildhawk.

Recently I installed a Ruby gem called buildhawk which allows to measure and display the build times of Rake driven builds. As I like the idea behind this tool a lot but mostly use Phing for build orchestration, it was time to explore the possibility to interconnect them both. In this blog post I'll show an implementation of an apposite Phing Logger gathering the buildhawk compatible build times via git note(s) and how to put the interplay between those two tools to work.

He includes the script you'll need to get his example set up - a new logger for Phing that works directly with Buildhawk and stores the information directly into a git note. He includes an example of running the phing build with it enabled and some of the results as exported as an HTML document.

tagged: phing build buildhawk ruby gem statistics

Link:

Olek Janiszewski's Blog:
Autotest-like PHPUnit runner for a Zend Framework application
Aug 30, 2010 @ 18:25:43

On the Continuous Development blog there's a new post showing how Olek Janiszewski came up with a solution to integrate PHPUnit and the Zend Framework via the watchr Ruby gem.

Whenever working on a Ruby project, I'd run autotest with test_notifier to get immediate feedback on my code. Unfortunately, I don't know a similar utility integrated with Zend Framework and PHPUnit. [...] My solution is not as well designed and portable as test_notifier, and it doesn't play as nicely with my Zend application as autotest does with RSpec and Rails. It’s more of a quick hack to cover my needs 80% of the time.

The watchr gem changes to the correct directory and runs the usual PHPUnit command (to run all tests) and then captures the output to display back to the client. You end up with messages like these: success, warning and fatal errors.

tagged: phpunit unittest zendframework testing ruby gem watchr

Link:

SitePoint PHP Blog:
Introducing pearhub
Jan 08, 2010 @ 15:11:20

In this new post to the SitePoint PHP blog Troels Knak-Nielsen looking at a new PHP-centric service for creating a resource like the Ruby on Rails "gems" but for PHP software - pearhub.org.

I think services like these are an important reason why gems are so popular amongst Ruby developers, and I figured that PHP really needs something similar. So over the Christmas, I have been brewing on a service, which is now stable enough that I’ll make it available to the community at large. pearhub.org provides a place where you can register a project, that is hosted on Github, Google code or similar (Currently only git and subversion is supported). The service will generate a PEAR package and put it on a PEAR channel.

PEAR channels have been difficult to set up in the past but the pearhub.org service makes it simple and you get the added benefit of being able to use the PEAR installer application to do installations and upgrades. You can find out more about the service on their FAQ.

tagged: pearhub pear channel gem

Link:

Stefan Koopmanschap's Blog:
PHP Hidden Gem: similar_text()
Jul 13, 2009 @ 14:37:50

Stefan Koopmanschap has written about a hidden gem he discovered in PHP to help locate blocks of text that seem similar from one or more sources - similar_text.

I am working on a hobby project where I aggregate feeds from several different sources. With the blogs I work it right now, it often happens that an author posts the same post to a few different sites. However, because of site formats and sometimes also quick edits an author makes on one site but not on the author, the article contents are usually not identical strings. So I needed something that would help me figure out whether or not two strings are nearly identical.

After Googling around and finding things like the xdiff extension and soundex, he discovered the two functions he needed - levenshtein and similar_text.

I am still trying to figure out which percentage will catch the duplicates but not catch too many posts which are only similar but not actually duplicates, but with the above 75% I seem to catch quite a few duplicates so far.
tagged: similartext gem hidden

Link:

Content with Style Blog:
Deploying PHP applications with Vlad and SVN
May 11, 2009 @ 17:50:26

Matthias Willerich has posted a very complete guide to deploying PHP applications from a subversion repository with Vlad the Deployer (a Ruby-based deployment engine).

In my current day job I have to deploy a number of web apps every few weeks. The person I took over from did the whole thing in a manual and terribly cumbersome way. [...] In the following article, I'm going to describe how I went from there to deploying my Zend Framework-driven PHP apps with Vlad. To save yourself some time, feel free to skip the back story, the pre-requisite of installing ruby, gem and rake, or go straight to the deployment recipes.

He wanted a setup that would allow a "one-liner" for deployment, the ability to roll back and to have shares resources between releases. He walks you through the setup of all needed components, the configuration options and some example runs of his build/deploy process.

tagged: deploy application vlad vladthedeployer ruby gem rake tutorial

Link:

Johannes Schluter's Blog:
A hidden gem in PHP 5.3: fileinfo
Dec 17, 2008 @ 15:35:59

Johannes Schluter has pointed out a "hidden gem" for PHP 5.3 in his latest blog post - the fileinfo extension.

This series is not meant to be complete but some personal choice, these blog postings are also no replacement for documentation, but just pointers. My goal is that you try out 5.3 right now so we can fix bugs as soon as possible before releasing it The NEWS file has a quite short entry for my first subject: Added fileinfo extension as replacement for mime_magic extension. (Derick)

He looks at one situation where the extension could come in very handy - getting the content type of the file for a download push - as well as why its better than the older mime_content_type function.

tagged: php5 gem fileinfo mimecontenttype function extension hidden

Link:

Zend Developer Zone:
Zend Framework Hidden Gems: Zend_Db
Dec 18, 2006 @ 16:04:00

Aaron Wormus and the Zend Developer Zone have posted the latest edition of their "Hidden Gems" series looking at the lesser-known features of the Zend Framework. This time, it's a look at Zend_Db (database abstraction).

Zend_Db is a layer which sits above the native PDO database extension. Before PDO (pre-PHP5.1) all we had to connect to databases were libraries that were developed in individual cycles and development teams, with little regard to what other database extensions were doing.

Taking this speed benefit of using PDO to do a majority of the work, PDO wrapper libraries like Zend_Db can supplement PDO with their own wrapper code leaving you with a fairly lightweight yet feature-rich database abstraction layer.

Aaron looks at connecting to a database (using both the PDO and DSN connections) and some example code showing how to work with the database using them - including queries and using transactions.

tagged: hidden gem zend framework zenddb database abstraction hidden gem zend framework zenddb database abstraction

Link:

Zend Developer Zone:
Zend Framework Hidden Gems: Zend_Db
Dec 18, 2006 @ 16:04:00

Aaron Wormus and the Zend Developer Zone have posted the latest edition of their "Hidden Gems" series looking at the lesser-known features of the Zend Framework. This time, it's a look at Zend_Db (database abstraction).

Zend_Db is a layer which sits above the native PDO database extension. Before PDO (pre-PHP5.1) all we had to connect to databases were libraries that were developed in individual cycles and development teams, with little regard to what other database extensions were doing.

Taking this speed benefit of using PDO to do a majority of the work, PDO wrapper libraries like Zend_Db can supplement PDO with their own wrapper code leaving you with a fairly lightweight yet feature-rich database abstraction layer.

Aaron looks at connecting to a database (using both the PDO and DSN connections) and some example code showing how to work with the database using them - including queries and using transactions.

tagged: hidden gem zend framework zenddb database abstraction hidden gem zend framework zenddb database abstraction

Link:


Trending Topics: