1: <?php
2:
3: 4: 5:
6: class Quform_ClassLoader
7: {
8: 9: 10:
11: public static function register()
12: {
13: spl_autoload_register(array('Quform_ClassLoader', 'loadClass'));
14: }
15:
16: 17: 18: 19: 20:
21: public static function loadClass($class)
22: {
23:
24: if (strpos($class, 'Quform') === 0) {
25: $directory = dirname(dirname(__FILE__));
26: $class = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
27: $path = $directory . DIRECTORY_SEPARATOR . $class;
28:
29: if (file_exists($path)) {
30: require_once $path;
31: }
32: }
33: }
34: }
35: