Skip to content

Commit caebb00

Browse files
committed
reformatting code
1 parent fbf9aa4 commit caebb00

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

public/.htaccess

100755100644
File mode changed.

public/index.php

100755100644
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
use Phalcon\Mvc\View;
99

1010
define('BASE_PATH', dirname(__DIR__));
11-
define('APP_PATH', BASE_PATH . '/app');
11+
define('APP_PATH', BASE_PATH . '/src');
1212

1313
// Register an autoloader
1414
$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()
2223
;
2324

2425
// Create a DI
@@ -40,17 +41,19 @@
4041

4142
// Set the database service
4243
$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+
);
4952
};
5053

5154
// Handle the request
5255
try {
53-
$application = new Phalcon\Mvc\Application($container);
56+
$application = new Application($container);
5457
$response = $application->handle($_SERVER["REQUEST_URI"]);
5558
$response->send();
5659
} catch (Exception $e) {

0 commit comments

Comments
 (0)