File tree Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 8
8
use Phalcon \Mvc \View ;
9
9
10
10
define ('BASE_PATH ' , dirname (__DIR__ ));
11
- define ('APP_PATH ' , BASE_PATH . '/app ' );
11
+ define ('APP_PATH ' , BASE_PATH . '/src ' );
12
12
13
13
// Register an autoloader
14
14
$ loader = new Loader ();
15
- $ loader ->setDirectories (
16
- [
17
- APP_PATH . '/controllers/ ' ,
18
- APP_PATH . '/models/ ' ,
19
- ]
20
- )
21
- ->register ()
15
+ $ loader
16
+ ->setDirectories (
17
+ [
18
+ APP_PATH . '/controllers/ ' ,
19
+ APP_PATH . '/models/ ' ,
20
+ ]
21
+ )
22
+ ->register ()
22
23
;
23
24
24
25
// Create a DI
40
41
41
42
// Set the database service
42
43
$ container ['db ' ] = function () {
43
- return new DbAdapter ([
44
- "host " => 'localhost ' ,
45
- "username " => 'your_db_user_name ' ,
46
- "password " => 'your_db_password ' ,
47
- "dbname " => 'tutorial ' ,
48
- ]);
44
+ return new DbAdapter (
45
+ [
46
+ "host " => 'tutorial-mysql ' ,
47
+ "username " => 'phalcon ' ,
48
+ "password " => 'secret ' ,
49
+ "dbname " => 'phalcon_tutorial ' ,
50
+ ]
51
+ );
49
52
};
50
53
51
54
// Handle the request
52
55
try {
53
- $ application = new Phalcon \ Mvc \ Application ($ container );
56
+ $ application = new Application ($ container );
54
57
$ response = $ application ->handle ($ _SERVER ["REQUEST_URI " ]);
55
58
$ response ->send ();
56
59
} catch (Exception $ e ) {
You can’t perform that action at this time.
0 commit comments