Initial import of current development status
[shipsimu.git] / ship-simu / inc / classes.php
1 <?php
2 /////// Load framework classes first ////////
3
4 /**
5  * Lower framework classes
6  */
7 $lowerClasses = array(
8         0 => "exceptions", // Exceptions
9         1 => "interfaces", // Interfaces
10         2 => "main",       // General main classes
11         3 => "middleware"  // The middleware
12 );
13
14 // Load all classes
15 foreach ($lowerClasses as $class) {
16         // Try to load the framework classes
17         try {
18                 ClassLoader::getInstance()->loadClasses(sprintf("inc/classes/%s/", $class));
19         } catch (PathIsNoDirectoryException $e) {
20                 ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Framework-Klassen im Pfad <strong>%s</strong> nicht laden. Reason: <strong>%s</strong>",
21                         $class
22                 ));
23         } catch (PathIsEmptyException $e) {
24                 ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Framework-Klassen im Pfad <strong>%s</strong> nicht laden. Reason: <strong>%s</strong>",
25                         $class
26                 ));
27         } catch (PathReadProtectedException $e) {
28                 ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Framework-Klassen im Pfad <strong>%s</strong> nicht laden. Reason: <strong>%s</strong>",
29                         $class
30                 ));
31         } catch (DirPointerNotOpenedException $e) {
32                 ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Framework-Klassen im Pfad <strong>%s</strong> nicht laden. Reason: <strong>%s</strong>",
33                         $class
34                 ));
35         }
36 }
37
38 // Include all classes
39 ClassLoader::getInstance()->includeAllClasses();
40
41 // Clean up the global namespace
42 unset($lowerClasses[3]); // Applications shall not have any middleware
43 unset($class);
44
45 ////// Until here the framework classes are loaded //////
46
47 // [EOF]
48 ?>