The Overseer Framework

Basic Functions

The Overseer CMS, created a little over six years ago, was a quick to setup database scheme driven content management system based on a library of useful PHP functions. The project progressed through many different variations before eventually being retired, replaced by the library of PHP functions and renamed to the Overseer Framework. This article will cover a few of these functions and how to implement them in your own projects.

Functions

print_array

One of the basic functions of the framework, print_array, does exactly what you would think. By passing it any number of variables (not just arrays), the function will echo them on the page surrounded by pre tags.

print_array(array('Moe', 'Larry', 'Curly'));
<pre>Array
(
    [0] => Moe
    [1] => Larry
    [2] => Curly
)</pre>

mysql_fetch_results

This function is a combination of mysql_query and mysql_fetch_assoc. Passing it a MySQL query string, or the result of one, will return an array of the results.

print_array(mysql_fetch_results('SELECT `user_id`, `username` FROM `user` LIMIT 1'));
<pre>Array
(
    [0] => Array
        (
            [user_id] => 1
            [username] => neogeek
        )
)</pre>

path_info

This function takes the server variable PATH_INFO and breaks it into an array for easy reference to each of the different sections. This is useful for sites that utilize the RewriteEngine in Apache to format URLs.

http://neo-geek.net/articles/the-overseer-framework-basic-functions/
echo path_info();
articles

Conclusion

These are a few simple functions available in the framework. While the rest of the functions are slightly more complex, they all accomplish one thing: they combine simple, yet lengthy tasks in to one easy to use function.

For more information, visit The Overseer Framework at GitHub.