1: <?php
2:
3: /**
4: * Pry Framework
5: *
6: * LICENSE
7: *
8: * This source file is subject to the new BSD license that is bundled
9: * with this package in the file LICENSE.txt.
10: *
11: */
12: /**
13: *
14: * @category Pry
15: * @version 1.2.2
16: * @author Olivier ROGER <oroger.fr>
17: */
18: define('ROOT_LIB', dirname(__DIR__ . '../') . DIRECTORY_SEPARATOR);
19:
20: class Pry
21: {
22:
23: private static $version = '1.0.0 alpa1';
24:
25: /**
26: * Retourne la revision du framework
27: *
28: * @return int
29: */
30: public static function getVersion()
31: {
32: return self::$version;
33: }
34:
35: /**
36: * Enregistre une fonction dans la pile autoload
37: *
38: */
39: static public function register()
40: {
41: spl_autoload_register(array(new self, 'pryLoader'));
42: }
43:
44: /**
45: * Fonction d'autoload
46: *
47: * @param string $class_name
48: */
49: static public function pryLoader($class_name)
50: {
51: $include = '';
52: $include = ROOT_LIB . str_replace('\\', DIRECTORY_SEPARATOR, $class_name) . '.class.php';
53:
54: if (is_readable($include))
55: {
56: require($include);
57: return true;
58: }
59: }
60:
61: }
62:
63: ?>