Ломаем всё, отсоединяя класс UserInfo от User.

This commit is contained in:
lopar
2020-08-30 13:44:57 +03:00
parent 555a32ce55
commit 7717d01f8f
5 changed files with 196 additions and 193 deletions

View File

@@ -3,10 +3,10 @@ session_start();
include_once 'config.php';
$login = urldecode($_SERVER['QUERY_STRING']) ?? '';
$user = new User($login);
$presentsModel = new PresentsModel($user->id);
$userInfo = new UserInfo($login);
$presentsModel = new PresentsModel($userInfo->id);
$presentsList = $presentsModel->getAllPresents();
$user->watcher_id = $_SESSION['uid'] ?? null;
$userInfo->watcher_id = $userInfo->id ?? null;
if (empty($user->id)): ?>
<!doctype html>
<html lang="ru">
@@ -31,7 +31,8 @@ if (empty($user->id)): ?>
<?php
try {
$user->showUserInfo();
$userInfo->showUserInfo();
} catch (Exception $e_showUserInfo) {
echo "<div class='debug'>Ошибка генератора showUserInfo() в User.php: {$e_showUserInfo}</div>";
}