About

CodeXplorer is a project repository - everything that I build for the world is released for free here under the GPL v3. PHP Systems, XHTML Themes, and other web related creations have their home here where I can easily control Subverion updates.

To browse my projects click on a tab below. If you use windows I recommend the Tortoise SVN client to keep track of my commits. If you use Linux I don't need to recommend anything to you.

Please be aware that my SVN repository is more up-to-date than any of the file downloads.

If you have code suggestions or comments, please drop me a line at David .= '@' . $this->site;. I like to know that people are using my creations. Other than that you can ask for help in the Forum.

Akismet API

After looking over the current PHP Akismet API classes I couldn't help but notice they all used fopen() to talk with akismet. Which (besides being slow) is disabled on some hosts that have "safe mode" on. This class solves that problem by using the fast cURL php extension available on most web hosts. This class is simply the smallest and easiest Akismet Class there is.

Requirements

Download

CodeIgniter Hooks

The core CI_Hooks class of the CodeIgniter Framework only gives 8 hooks for developers to use. With this update to the class you can extend it to provide your own hooks anywhere you want within your own controllers, models, libraries, helpers, or views. In all truth, I think it is the one thing that has been missing from CI.

This Class gives team projects what they need to allow different things to "plugin" to the system in the same way the core hooks allows developers to alter the way CI runs. One example would be to design a comment system and then call a hook to format the comment. Then BBCode, Markdown, HTML, or anything else could be added at a whim without need for altering the code.

Requirements

  • PHP 4 or 5

Downloads

MicroMVC Framework
MicroMVC now has a new home! Check it out at MicroMVC.com
CXPDO Database

This class extends the PDO object to provide DB abstraction - a simple way to query different types of databases without needing to change your code.

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility. - php.net

However PDO does not cover DB query-abstraction - for that you have to use some huge class like ADOdb or PEAR:DB. Which of course will slow your site to a crawl if you are using shared hosting.

This class fills this gap and provides DB query-abstraction for common functions like SELECT, REPLACE, INSERT, UPDATE, and DELETE queries. The actual PDO object is not changed in anyway - each of these functions still returns a PDO Statement Object.

The total package size is only 18kb! And that is with LOTS of comments explaining the code! It is the missing link for people who love the DATA abstraction PDO provides but also need QUERY abstraction.

Currently it only works on SQLite2-3 and MySQL. However because it is built for the SQL langauge - it will be supper simple to add PostgreSQL or MSSQL support as well (copy mysql class and change 3-5 functions). I just don't have a copy of either DB up and running to test it.

Requirements

Downloads

Twitter API

I needed a twitter class for a project I was doing. There were several out there - but none of them were complete or even coded properly.

As an avid OO Designer I built a new class from the ground up to perfectly match the Twitter API using PHP 5. I am a perfectionist so I couldn't stand excess code, the lack of comments, and missing API functionality.

This class is the best API class out there - it can handle XML and JSON requests/responses from the standard API and the new Trends and Search API's as well. Calls are made with the powerful cURL library. Results are returned as an easy to use object.

Requirements

  • PHP 5
  • SimpleXML or JSON

Downloads

CodeIgniter Tags

This class allows any table, and any type of system, to add, edit, and delete tags from any object/row without interfering with other tables that are also using tags. For example, say you have 58 articles on your blog and each have 2-4 tags attached to them. Now you add a "Image Gallery" to your site to showoff your photos. You want to "tag" each photo with some key words (city, dark, night) that will help people sort through all the images. With this class both your blog articles and your images (and any other tables you add) can use the same "tags" table without interfering with each other.

Just because blog article 23 has the tag "sports" doesn't mean that image 23 will return the tag "sports".

Variables Used in this class

The fictitious tables "posts" and "images" used for examples

  • TABLE The name of a table using tags (i.e. "posts", "images", etc..) this allows us to tell the difference between a tag for row 23 of the "images" table and row 23 of the "posts" table.
  • ROW_ID The row_id is the unique ID of a row from the table set in TABLE. This id corasponds to a some row like "row 23" of the "posts" table.
  • USER_ID The ID of the user that created the tag. (for use with a "users" table) This means that multiple users can each tag a TABLE row with their own tags. This is optional so if you don't plan on starting another social site you don't even need to use this variable.
  • SAFE_TAG This is a URL/file/etc. safe version of the TAG. (only [a-z0-9])
  • TAG A cleaned (alphanumeric and spaces) catialized tag (only for display)
  • TAG_ID The Unique Id of the tag
  • DATE The date the tag was attached to a row

Note: the bottom of the CITags Model has the SQL for the tables you will need to add to your DB.

Requirements

  • PHP 5
  • CodeIgniter

Downloads

Using Subversion (Help)

Subversion is just another way to make simple file downloading complex -right? I know, that is what I thought, "just give me the stupid zip". I didn't want or need to figure out yet another protocol just to access files. However, if you don't know how to use SVN you really need to learn.

Subversion (SVN) is a version control system ... used to maintain current and historical versions of files such as source code, web pages, and documentation. - Wikipedia

Having an understanding of how to download files from a SVN system will allow you to watch and track each and every change that takes place. Every time I capitalize a letter or add a new function you will know. You will be able to see (side-by-side) the changed code from one reversion to another.

Getcha self some!

Example

$ svn checkout http://svn.codexplorer.com/
CodeXplorer.com is the project repository for David Pennington