@@ -31,8 +31,6 @@ class App
31
31
//Default Method
32
32
protected $ methodName = 'index ' ;
33
33
34
- protected $ controllerPath = null ;
35
- protected $ indexPath = null ;
36
34
protected $ path = null ;
37
35
protected $ directed = false ;
38
36
protected $ params = [];
@@ -52,9 +50,8 @@ public function __construct($urlDirected = null)
52
50
Debug::group ('TPC Application ' );
53
51
Debug::log ("Class Initiated: " . __CLASS__ );
54
52
55
- // Set Default Controller Locations
56
- $ this ->controllerPath = Routes::getLocation ('controllers ' )->folder ;
57
- $ this ->indexPath = Routes::getFull ();
53
+ // Set Default Controller Location
54
+ $ this ->path = Routes::getLocation ('controllers ' )->folder ;
58
55
59
56
// Set the application url to be used
60
57
if (!empty ($ urlDirected )) {
@@ -128,34 +125,33 @@ private function getController()
128
125
{
129
126
if (empty ($ this ->url [0 ])) {
130
127
Debug::info ('No Controller Specified. ' );
131
- $ this ->path = $ this ->controllerPath ;
132
128
return $ this ->controllerName ;
133
129
}
134
130
if ($ this ->directed ) {
135
- if (file_exists ($ this -> indexPath . $ this ->url [0 ] . '.php ' )) {
131
+ if (file_exists (Routes:: getFull () . $ this ->url [0 ] . '.php ' )) {
136
132
Debug::log ("Modifying the controller from $ this ->controllerName to " . $ this ->url [0 ]);
137
133
$ out = array_shift ($ this ->url );
138
- $ this ->path = $ this -> indexPath ;
134
+ $ this ->path = Routes:: getFull () ;
139
135
return strtolower ($ out );
140
- } elseif (file_exists ($ this ->controllerPath . $ this ->url [0 ] . '.php ' )) {
136
+ } elseif (file_exists ($ this ->path . $ this ->url [0 ] . '.php ' )) {
141
137
Debug::log ("Modifying the controller from $ this ->controllerName to " . $ this ->url [0 ]);
142
138
$ out = array_shift ($ this ->url );
143
- $ this ->path = $ this ->controllerPath ;
144
139
return strtolower ($ out );
145
140
}
146
141
}
147
- if (!$ this ->directed && file_exists ($ this ->controllerPath . $ this ->url [0 ] . '.php ' )) {
142
+ if (!$ this ->directed && file_exists ($ this ->path . $ this ->url [0 ] . '.php ' )) {
148
143
Debug::log ("Modifying the controller from $ this ->controllerName to " . $ this ->url [0 ]);
149
144
$ out = array_shift ($ this ->url );
150
- $ this ->path = $ this ->controllerPath ;
151
145
return strtolower ($ out );
152
146
}
153
147
Debug::info ('Could not locate specified controller: ' . $ this ->url [0 ]);
154
- $ this ->path = $ this ->controllerPath ;
155
148
array_shift ($ this ->url );
156
149
return $ this ->controllerName ;
157
150
}
158
-
151
+ private function updateController ()
152
+ {
153
+ Debug::log ("Modifying the controller from $ this ->controllerName to " . $ this ->url [0 ]);
154
+ }
159
155
/**
160
156
* This function Initiates the specified controller and
161
157
* stores it as an object in controllerObject.
0 commit comments