$page = $this->request->getQuery('p', 'int', 1);
$ajax = $this->request->getQuery('ajax', 'int', 0);
$limit = 50;
$offset = ($page == 1) ? 0 : ($page - 1) * $limit;
$newsComments = NewsComment::find([
'conditions' => 'news_id = :id:',
'bind' => [
'id' => $item->id,
],
'limit' => $limit,
'offset' => $offset,
]);
$comments = [];
foreach ($newsComments as $newsComment) {
$comment = Comment::findFirstById($newsComment->comment_id);
if (isset($comment->user_id)) {
$user = User::findFirstById($comment->user_id);
if (null !== $user->avatar_id) {
$img = Image::findFirstById($user->avatar_id);
if (null !== $img) {
$user->avatar_link = '/storage/images/thumbnail/getUserAvatar/' . $img->path;
} else {
$user->avatar_link = '/img/avatar_empty.png';
}
} else {
$user->avatar_link = '/img/avatar_empty.png';
}
$date = new \DateTimeImmutable($comment->created_at);
$pub_date = $date->format('F d, Y');
$comments[] = [
'id' => $newsComment->comment_id,
'text' => $comment->text,
'created_at' => $comment->created_at,
'publishDate' => $pub_date,
'user' => [
'id' => $user->id,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
"Attempt to read property "avatar_id" on null"
$page = $this->request->getQuery('p', 'int', 1);
$ajax = $this->request->getQuery('ajax', 'int', 0);
$limit = 50;
$offset = ($page == 1) ? 0 : ($page - 1) * $limit;
$newsComments = NewsComment::find([
'conditions' => 'news_id = :id:',
'bind' => [
'id' => $item->id,
],
'limit' => $limit,
'offset' => $offset,
]);
$comments = [];
foreach ($newsComments as $newsComment) {
$comment = Comment::findFirstById($newsComment->comment_id);
if (isset($comment->user_id)) {
$user = User::findFirstById($comment->user_id);
if (null !== $user->avatar_id) {
$img = Image::findFirstById($user->avatar_id);
if (null !== $img) {
$user->avatar_link = '/storage/images/thumbnail/getUserAvatar/' . $img->path;
} else {
$user->avatar_link = '/img/avatar_empty.png';
}
} else {
$user->avatar_link = '/img/avatar_empty.png';
}
$date = new \DateTimeImmutable($comment->created_at);
$pub_date = $date->format('F d, Y');
$comments[] = [
'id' => $newsComment->comment_id,
'text' => $comment->text,
'created_at' => $comment->created_at,
'publishDate' => $pub_date,
'user' => [
'id' => $user->id,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
2
"Attempt to read property "avatar_id" on null"
"/app/src/Modules/App/src/Controllers/NewsController.php"
270
"ru"
"15584"
Modules\App\Controllers\NewsController {#208}
"viewAction"
array:2 [ "lang" => "ru" "id" => "15584" ]
*/
protected function loadModules(Builder $builder): void
{
$this->registerModules($builder->modules()->toArray());
}
/**
* Terminate application
* @throws Throwable
*/
public function terminate()
{
if ($this->debug() && class_exists(Run::class)) {
//new \Whoops\Provider\Phalcon\WhoopsServiceProvider();
$this->builder->whoops();
}
try {
$response = $this->handle(
$this->builder->urlPath()
);
} catch (Throwable $throwable) {
if ($this->debug()) {
if (class_exists(Run::class) && str_starts_with($this->request->getURI(), '/api/')) {
$this->builder->whoopsApi();
}
throw $throwable;
}
$response = $this->handle('/404');
}
//echo $response->getContent();
$response->send();
if (function_exists('\fastcgi_finish_request')) {
fastcgi_finish_request();
}
die;
"/ru/news/view/15584.html"
<?php
//var_dump($_REQUEST);exit();
error_reporting(E_ALL);
ini_set('display_errors', 1);
define('BASE_PATH', dirname(__DIR__));
define('PUBLIC_PATH', __DIR__);
include_once BASE_PATH . '/vendor/autoload.php';
$builder = new \Framework\Builder(BASE_PATH);
$builder->app()->terminate();
Key | Value |
LANG | "ru"
|
currentLanguage | "en"
|
viewed_news | "[15584]"
|
Key | Value |
SUPERVISOR_GROUP_NAME | "php-fpm"
|
WEB_DOCUMENT_INDEX | "index.php"
|
SUPERVISOR_SERVER_URL | "unix:///.supervisor.sock"
|
HOSTNAME | "86aeef471b64"
|
PHP_VERSION | "8.1.13"
|
PHP_SENDMAIL_PATH | "/usr/sbin/sendmail -t -i"
|
PHP_INI_DIR | "/usr/local/etc/php"
|
GPG_KEYS | "528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD"
|
PHP_LDFLAGS | "-Wl,-O1 -pie"
|
WEB_DOCUMENT_ROOT | "/app/web"
|
PWD | "/app/web"
|
WEB_ALIAS_DOMAIN | "*.vm"
|
WEB_PHP_TIMEOUT | "600"
|
SERVICE_NGINX_CLIENT_MAX_BODY_SIZE | "50m"
|
LD_PRELOAD | "/usr/lib/preloadable_libiconv.so"
|
HOME | "/home/application"
|
LANG | "C.UTF-8"
|
APPLICATION_GID | "1000"
|
DOCKER_CONF_HOME | "/opt/docker/"
|
PHP_SHA256 | "b15ef0ccdd6760825604b3c4e3e73558dcf87c75ef1d68ef4289d8fd261ac856"
|
PHPIZE_DEPS | "autoconf \t\tdpkg-dev dpkg \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkgconf \t\tre2c"
|
WEB_PHP_SOCKET | "127.0.0.1:9000"
|
TERM | "xterm"
|
PHP_URL | "https://www.php.net/distributions/php-8.1.13.tar.xz"
|
APPLICATION_GROUP | "application"
|
SHLVL | "0"
|
COMPOSER_VERSION | "2"
|
APPLICATION_USER | "application"
|
PHP_CFLAGS | "-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
|
LOCAL_DEV | "true"
|
PHP_DATE_TIMEZONE | "Europe/Moscow"
|
APPLICATION_UID | "1000"
|
LOG_STDOUT | "/proc/1/fd/1"
|
SUPERVISOR_PROCESS_NAME | "php-fpmd"
|
LC_ALL | "C.UTF-8"
|
PATH | "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
LOG_STDERR | "/proc/1/fd/2"
|
CONTAINER_UID | "application"
|
APPLICATION_PATH | "/app"
|
PHP_ASC_URL | "https://www.php.net/distributions/php-8.1.13.tar.xz.asc"
|
PHP_CPPFLAGS | "-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
|
SUPERVISOR_ENABLED | "1"
|
VIPSHOME | "/usr"
|
USER | "application"
|
HTTP_CF_IPCOUNTRY | "US"
|
HTTP_CDN_LOOP | "cloudflare"
|
HTTP_CF_CONNECTING_IP | "54.163.62.42"
|
HTTP_USER_AGENT | "claudebot"
|
HTTP_ACCEPT | "*/*"
|
HTTP_CF_VISITOR | "{"scheme":"https"}"
|
HTTP_CF_RAY | "86bbd6bc4af138fd-IAD"
|
HTTP_ACCEPT_ENCODING | "gzip, br"
|
HTTP_CONNECTION | "upgrade"
|
HTTP_X_NGINX_PROXY | "true"
|
HTTP_X_FORWARDED_PROTO | "https"
|
HTTP_X_FORWARDED_FOR | "54.163.62.42, 172.70.38.191"
|
HTTP_X_REAL_IP | "172.70.38.191"
|
HTTP_HOST | "www.formacar.com"
|
REDIRECT_STATUS | "200"
|
SERVER_NAME | "formacar.local"
|
SERVER_PORT | "80"
|
SERVER_ADDR | "172.23.0.2"
|
REMOTE_PORT | "47110"
|
REMOTE_ADDR | "91.230.54.46"
|
SERVER_SOFTWARE | "nginx/1.22.1"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
REQUEST_SCHEME | "http"
|
SERVER_PROTOCOL | "HTTP/1.1"
|
DOCUMENT_ROOT | "/app/web"
|
DOCUMENT_URI | "/index.php"
|
REQUEST_URI | "/ru/news/view/15584.html"
|
SCRIPT_NAME | "/index.php"
|
CONTENT_LENGTH | "" |
CONTENT_TYPE | "" |
REQUEST_METHOD | "GET"
|
QUERY_STRING | "" |
SCRIPT_FILENAME | "/app/web/index.php"
|
FCGI_ROLE | "RESPONDER"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1711673144.8555
|
REQUEST_TIME | 1711673144
|
argv | [] |
argc | 0
|