MikeHeuss.com - The eclectic repository of my life. Programming, writing, and other stuff.

phpFramework

phpFramework contains commonly used code organized in a way to quickly allow you to develop websites.

With this class and a few support classes, you can greatly cut down on the workload required to get a dynamic website up and running.

I started working on phpFramework in 2000, with the goal being having a collection of tools that I will use again and again in dynamic websites. As the language changed, and my understanding of PHP grew, phpFramework also grew.

In a nutshell, phpFramework is a wrapper class around a large set of commonly used tools. It has a configuration file that contains most necessary parameters that allow you to quickly customize the wrapper to each site.

All phpFramework objects and methods are accessed via a static interface. This means, once started, you can use the methods anywhere in your application.

This class can, depending on configuration, do the following:

  1. Start Sessions
    1. Save session data to a database
  2. Turn on Output Buffering
  3. Create a benchmark object (Pear::Benchmark)
  4. Safely provide interface to GETs and POSTs
  5. Start a logging object (Pear::Log)
  6. Start a database connection (Pear::DB & DBClass)
  7. Track users sessions & referrers
  8. Initialize templating (Savant)
  9. Dump Variable (Pear::Var_Dump);
  10. Send Rich Mail (Pear::mail & Pear::mail_mime)
  11. Secure directories
  12. Create and Validate forms.
    1. Save results of validated forms to database
  13. SQL Debugging
  14. Commonly Used Javascript
    1. Rich Text
    2. Select Box Navigation
    3. Pass values between windows
    4. Pop up windows
  15. Handle uploaded images and files
  16. Provide caching of dynamic pages
  17. Track clicks on links

For features to work, the following must be installed:

pear install http://phpsavant.com/Savant2-2.3.3.tgz Benchmark Log Var_Dump mail_mime http://mikeheuss.com/scripts/DBClass/DBClass.tgz

Likewise, these database tables are necessary:

CREATE TABLE `log_site_tracking` (`id` mediumint(9) NOT NULL default '0', `ts` timestamp(14) NOT NULL, `session_id` varchar(64) default NULL, `ip_address` varchar(25) NOT NULL default '', `path` varchar(100) NOT NULL default '', `domain` varchar(50) NOT NULL default '', `referer` varchar(100) default NULL, `user_agent` varchar(100) NOT NULL default '', PRIMARY KEY (`id`), KEY `referer` (`referer`)) TYPE=MyISAM;

CREATE TABLE log_table (id INT NOT NULL, logtime TIMESTAMP NOT NULL, ident CHAR(16) NOT NULL, priority INT NOT NULL, message VARCHAR(200), PRIMARY KEY (id));

CREATE TABLE `caching` (`path` varchar(255) NOT NULL default '', `ts` timestamp(14) NOT NULL, `num_pulled` mediumint(9) NOT NULL default '0', `id` mediumint(9) NOT NULL default '0', PRIMARY KEY (`id`), KEY `path` (`path`)) TYPE=MyISAM;

Click to download the php file: Tar.GZ or ZIP. The documentation can be found here.

A PDF overview is available here: phpFramework Overview

This class is released under the BSD license. Click Here to view.

© 1998 - 2010 Mike Heuss   |   mike@mikeheuss.com  |  386 418 0075  |  6823 NW 218th Street Alachua FL 32615