root/tags/RELEASE_0_2_0/examples/ClassLoader.php

Revision 89, 0.8 kB (checked in by mikey, 2 years ago)

added integration tests using the existing examples

Line 
1 <?php
2 /**
3  * Basic example to show how the class loader may be used.
4  *
5  * @author  Frank Kleine <frank.kleine@schlund.de>
6  */
7 /**
8  * Basic example to show how the class loader may be used.
9  *
10  * @package     XJConf
11  * @subpackage  examples
12  */
13 class ClassLoader implements XJConfClassLoader
14 {
15     /**
16      * load the file with the given class
17      *
18      * @param  string  $fqClassName  the full qualified class name
19      */
20     public function loadClass($fqClassName)
21     {
22         require_once str_replace('.', '/', $fqClassName) . '.php';
23     }
24     
25     /**
26      * returns short class name
27      *
28      * @param  string  $fqClassName  the full qualified class name
29      */
30     public function getType($fqClassName)
31     {
32         $className = explode('.', $fqClassName);
33         return $className[count($className) - 1];
34     }
35 }
36 ?>
Note: See TracBrowser for help on using the browser.