tz-tools.php 903 Bytes
<?php
/*
Plugin Name: Tenzing Tools
Version: 0.1
Description: Various classes to help out with stuff
Author: Tenzing
*/

    if (phpversion() < '5.2.2') {
        die('PHP version 5.2.2 or greater is required');
    }

    new TzTools();

class TzTools {
    public function __construct() {
        set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__));
        spl_autoload_register(Array('TzTools', 'loader'));

        require_once(dirname(__FILE__) . '/wp_functions.php');

        add_action('wp_print_scripts', Array('TzTools', 'registerScripts'));
    }

    public static function registerScripts() {
        _register_script('xmlhttpHandler', plugins_url('xmlhttpHandler.js', __FILE__));
    }

    public static function loader($class) {
      $file = dirname(__FILE__) . '/' . $class . '.php';
        if (is_file($file)) {
            require($file);
        }
    }
}
?>