File tree 4 files changed +3
-4
lines changed
4 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,13 @@ class Application {
14
14
15
15
public function __construct () {
16
16
self ::$ app = $ this ;
17
+ self ::$ ROOT_DIR = dirname (__DIR__ );
17
18
18
19
$ this ->view = new View ();
19
20
$ this ->request = new Request ();
20
21
$ this ->response = new Response ();
21
22
$ this ->router = new Router ($ this ->request , $ this ->response );
22
23
$ this ->session = new Session ();
23
-
24
- self ::$ ROOT_DIR = dirname (__DIR__ );
25
24
}
26
25
27
26
public static function router (): Router {
Original file line number Diff line number Diff line change 6
6
class Serve extends Command {
7
7
public function handle (): void {
8
8
$ format = 'cd %s && php -S localhost:%d ' ;
9
- $ dir = ROOT . '/ ' . @ $ this ->flags [ ' --test ' ] ?? 'public ' ;
9
+ $ dir = ROOT . '/ ' . ( in_array ( ' --test ' , $ this ->flags ) ? ' tests ' : 'public ' ) ;
10
10
$ port = @$ this ->args [0 ] ?? 8080 ;
11
11
12
12
exec (sprintf ($ format , $ dir , $ port ));
Original file line number Diff line number Diff line change 11
11
12
12
$ app = new Application ();
13
13
14
- $ app ->router ()->get ('/ ' , 'app>index ' );
14
+ $ app ->router ()->get ('/ ' , 'layouts/ app>index ' );
15
15
16
16
$ app ->run ();
File renamed without changes.
You can’t perform that action at this time.
0 commit comments