Source Control is an essential part of the development system that any and every programmer needs to utilize. Simply put it is a repository of source code that keeps track of revisions and is a system that allows multiple programmers to work on one copy of code without issues. There are numerous version control systems (VCS) out there including Subversion, Mercurial and Bazaar. Everyone has their preference, today we will be focusing on git, a VCS that has become more popular in the latest months.
Git
A typical programmer’s workflow would be to:
- pull (download) the latest copy of code from the git respository.
- Make neccessary changes, modify code etc.
- commit the changed files
- push (upload) the files back to the git repository.
If multiple programmers were working on the same project they would all use the same git repository. It’s good practice to always pull the latest copy before you push any of your changes to make sure your using the most update-to-date copy of the code (Someone may have pushed another change while you were editing your code). You can also branch (fork) a git repository. For example two programmers might be working on the same…
February 1, 2009 Comments Off
Introduction
RSS Feed consumption has always been a stick point in PHP. Simple Pie is a library that works with both PHP4 and PHP5 that enables you to easily parse and save RSS feeds. Today I’ll show you some common uses of Simple Pie and explain how it runs.
Simple Pie requires:
- PHP 4.3.0 or higher
- cURL Enabled.
- zLib (Caching?)
As well as a few other PHP modules that will be enabled in a vanilla PHP install. To run the compatibility test, upload the un-compressed archive to your server and navigate to www.yourname.com/pathtosimplepie/compatibility_test/sp_compatibility_test.php .
Finding the RSS Feed
The first thing we need to do is include SimplePie and then make a new SimplePie feed.
include('path/to/simplepie.inc');
$feed = new SimplePie('lastkarrde.com');
Simple Pie has a very useful ‘auto feed discovery’ feature. If you give it a plain URL, such as Query7.com, it will automatically find the RSS feed. Of course you can specify the path to the .xml file or Feed Burner page if you wanted to. Although the feed has been pulled we need to do call on another function, handle_content_type, to ensure that the feed has the correct mime type and encoding.
$feed->handle_content_type();
Parsing the RSS Feed
…