Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
vendor
composer.lock
.env
.env
.vscode
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
},
"require": {
"vlucas/phpdotenv": "^5.0",
"thecodeholic/php-mvc-core": "^v1.0.4"
"thecodeholic/php-mvc-core": "^v1.0.5"
}
}
12 changes: 11 additions & 1 deletion controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function home()

public function login(Request $request)
{
echo '<pre>';
var_dump($request->getBody(), $request->getRouteParam('id'));
echo '</pre>';
$loginForm = new LoginForm();
if ($request->getMethod() === 'post') {
$loginForm->loadData($request->getBody());
Expand Down Expand Up @@ -85,4 +88,11 @@ public function profile()
{
return $this->render('profile');
}
}

public function profileWithId(Request $request)
{
echo '<pre>';
var_dump($request->getBody());
echo '</pre>';
}
}
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ services:
volumes:
# Mount source-code for development
- ./:/var/www
extra_hosts:
- host.docker.internal:host-gateway

db:
image: mysql:8
ports:
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ RUN apt-get update && \
# Install PHP Extensions
RUN docker-php-ext-install zip pdo_mysql

# RUN pecl install -o -f xdebug-3.1.3 \
RUN pecl install -o -f xdebug-3.1.5 \
&& docker-php-ext-enable xdebug
# && rm -rf /tmp/pear

# Copy composer installable
Expand Down
5 changes: 5 additions & 0 deletions docker/php.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
; General
upload_max_filesize = 200M
post_max_size = 220M

[xdebug]
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
11 changes: 10 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@
$app->router->get('/register', [SiteController::class, 'register']);
$app->router->post('/register', [SiteController::class, 'register']);
$app->router->get('/login', [SiteController::class, 'login']);
$app->router->get('/login/{id}', [SiteController::class, 'login']);
$app->router->post('/login', [SiteController::class, 'login']);
$app->router->get('/logout', [SiteController::class, 'logout']);
$app->router->get('/contact', [SiteController::class, 'contact']);
$app->router->get('/about', [AboutController::class, 'index']);
$app->router->get('/profile', [SiteController::class, 'profile']);
$app->router->get('/profile/{id:\d+}/{username}', [SiteController::class, 'login']);
// /profile/{id}
// /profile/13
// \/profile\/\w+

$app->run();
// /profile/{id}/zura
// /profile/12/zura

// /{id}
$app->run();