Amélioration gestion des exceptions

This commit is contained in:
Boris 2022-11-03 23:58:00 +01:00
parent e7841d40de
commit 0926c2bdab
9 changed files with 615 additions and 263 deletions

View File

@ -2,9 +2,11 @@
require_once('config.php');
die($_SESSION['player_pubkey']);
$bodyIds = 'home';
include_once('header.php');
echo '
<nav>
<ul>

View File

@ -75,14 +75,14 @@ class DAO {
'duniter' => 2,
'cesiumplus' => 5,
'gchange' => 10,
'gchange' => 1,
];
private $nodeTimeoutIncrement = [
'duniter' => 2,
'cesiumplus' => 10,
'gchange' => 10
'gchange' => 3
];
private $node = NULL;
@ -489,7 +489,9 @@ class DAO {
$out[] = '<pre>'. print_r($queryParams, true) . '<pre>';
}
$this->decease($out);
// $this->decease($out);
throw new Exception(implode("\n", $out));
}
return $json;

View File

@ -0,0 +1,64 @@
<?php
class ErrorsHandler {
public function __construct () {
}
static public function kaput ($errorMsgs) {
ob_get_clean(); // to prevent error message to display inside an HTML container (case of error generated by get method calls)
if (!is_array($errorMsgs)) {
$errorMsgs = explode("\n", $errorMsgs);
}
echo '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>'. _('Erreur critique') . '</title>
<style>
div {
overflow: auto;
word-wrap: break-word;
background-color: hsl(0, 100%, 69%);
color: hsl(0, 100%, 19%);
margin: 1em;
padding: 1em;
border-radius: 1em;
position: fixed;
top: 0;
left: 0;
width: calc(100% - 4em);
max-height: calc(100vh - 4em);
}
</style>
</head>
<body>
<div>';
foreach ($errorMsgs as $msg) {
echo '<pre>' . print_r($msg, true) . '</pre>';
}
echo '
</div>
</body>
</html>';
die;
}
}

View File

@ -94,7 +94,7 @@ class Fred {
or die('<p>On a fait du sale.</p>');
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
preg_match("`url='([^']+)'`isU", $page1, $matches);
// die(

View File

@ -7,6 +7,7 @@ require_once('DAO.class.php');
require_once('GchangeUser.class.php');
require_once('GchangeRecord.class.php');
require_once('GchangeRating.class.php');
require_once('ErrorsHandler.class.php');
class Gchange {
@ -18,9 +19,13 @@ class Gchange {
private $cacheLongevity = array(
'placesNearby' => 604800, // 3 jours
'placeDetails' => 2116800, // 7 jours
'placeVisitors' => 2116800, // 7 jours
'usersNearby' => 43200, // 12 heures
'users' => 43200, // 12 heures
'records' => 900 // 15 min
'users' => 2116800, // 12 heures
'userRecords' => 900 // 15 min
);
public function __construct () {
@ -28,71 +33,21 @@ class Gchange {
$this->dao = DAO::getInstance();
}
public function getRecordsByIssuer ($issuer) {
public function fetchJson ($uri, $queryParams = null) {
try {
$recordsCacheDir = 'records/user/';
$recordsCacheFile = $issuer . '.json';
$json = $this->dao->fetchJson($uri, 'gchange', $queryParams);
$json = $this->getJsonFromCache($recordsCacheDir, $recordsCacheFile, $this->cacheLongevity['records']);
} catch (Exception $errorMsgs) {
if (empty($json)) {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'bool' => [
'filter' => [
'term' => [
'issuer' => $issuer
]
/*
, 'range' => [
'stock' => [
'gte' => 1
]
]
*/
]
/*
, 'filter' => [
]
*/
, 'must_not' => [
[ "term" => ["stock" => 0] ]
]
]
],
'sort' => [
['time' => 'desc']
]
];
$json = $this->dao->fetchJson('/market/record/_search', 'gchange', $queryParams);
$this->cacheJson($recordsCacheDir, $recordsCacheFile, $json);
throw $errorMsgs;
}
$result = json_decode($json);
$records = [];
foreach ($result->hits->hits as $hit) {
$records[] = new GchangeRecord($hit);
}
return $records;
return $json;
}
private function getJsonFromCache ($dir, $file, $cacheLongevity) {
private function getJsonFromCache ($dir, $file, $cacheLongevity = null) {
if (!$this->isActivatedCache) {
@ -103,13 +58,30 @@ class Gchange {
$json = null;
$jsonFullPath = $this->cacheDir . $dir . $file;
if (file_exists($jsonFullPath) and ((time() - filemtime($jsonFullPath)) < $cacheLongevity)) {
$json = file_get_contents($jsonFullPath);
if (!file_exists($jsonFullPath)) {
throw new Exception("Le fichier de cache suivant n'existe pas : " . $jsonFullPath);
}
return $json;
if ($cacheLongevity !== null and (time() - filemtime($jsonFullPath) > $cacheLongevity)) {
throw new Exception("Le fichier de cache est expiré.");
}
try {
$json = file_get_contents($jsonFullPath);
} catch (Exception $errorMsgs) {
throw new Exception($jsonFullPath . " n'a pas été trouvé");
} finally {
return $json;
}
}
private function cacheJson ($dir, $file, $json) {
@ -136,13 +108,30 @@ class Gchange {
$usersCacheDir = 'users/';
$usersCacheFile = $pubkey . '.json';
$json = $this->getJsonFromCache($usersCacheDir, $usersCacheFile, $this->cacheLongevity['users']);
try {
if (empty($json)) {
$json = $this->getJsonFromCache($usersCacheDir, $usersCacheFile, $this->cacheLongevity['users']);
$json = $this->dao->fetchJson(('/user/profile/'. $pubkey), 'gchange');
$this->cacheJson($usersCacheDir, $usersCacheFile, $json);
} catch (Exception $errorMsgs) {
try {
$json = $this->fetchJson('/user/profile/'. $pubkey);
$this->cacheJson($usersCacheDir, $usersCacheFile, $json);
} catch (Exception $errorMsgs) {
try {
$json = $this->getJsonFromCache($usersCacheDir, $usersCacheFile, null);
} catch (Exception $errorMsgs) {
throw new Exception("L'utilisateur " . $pubkey . " n'a été trouvé nulle part.");
}
}
}
$result = json_decode($json);
@ -150,90 +139,225 @@ class Gchange {
return new GchangeUser($result);
}
public function getPlacesNearUser ($user, $radius) {
public function getNearbyUsers ($lat, $lon, $maxDistance, $minDistance = NULL) {
$nearbyUsersCacheDir = 'users-nearby/geopoint/' . $maxDistance . 'km/';
$nearbyUsersCacheFile = $lat . ',' . $lon . '.json';
return $this->getNearbyPlaces($user->getLat(), $user->getLon(), $radius);
try {
/*
$placesCacheDir = 'places-nearby/user/';
$placesCacheFile = $user->getUserGchangeId() . '.json';
$json = $this->getJsonFromCache($nearbyUsersCacheDir, $nearbyUsersCacheFile, $this->cacheLongevity['usersNearby']);
$json = $this->getJsonFromCache($placesCacheDir, $placesCacheFile, $this->cacheLongevity['placesNearby']);
} catch (Exception $errorMsgs) {
if (empty($json)) {
$n = 20;
$json = $this->getNearbyPlacesJson($user->getLat(), $user->getLon(), $radius);
$queryParams = [
'size' => $n,
'query' => [
'bool' => [
'filter' => [
[
'geo_distance' => [
"distance" => $maxDistance . 'km',
"geoPoint"=> [
"lat" => $lat,
"lon" => $lon
]
]
]
]
]
]
];
$this->cacheJson($placesCacheDir, $placesCacheFile, $json);
try {
$json = $this->fetchJson('/users/record/_search', $queryParams);
$this->cacheJson($nearbyUsersCacheDir, $nearbyUsersCacheFile, $json);
} catch (Exception $errorMsgs) {
$json = $this->getJsonFromCache($nearbyUsersCacheDir, $nearbyUsersCacheFile, null);
}
}
$result = json_decode($json);
return $result->hits->hits;
}
public function getPlacesNearUser ($user, $radius) {
return $this->getNearbyPlaces($user->getLat(), $user->getLon(), $radius);
}
public function getPlaceDetails ($placeId) {
$placeDetailsCacheDir = 'place/details/';
$placeDetailsCacheFile = $placeId . '.json';
try {
$json = $this->getJsonFromCache($placeDetailsCacheDir, $placeDetailsCacheFile, $this->cacheLongevity['placeDetails']);
} catch (Exception $errorMsgs) {
try {
$json = $this->fetchJson('/page/record/' + $placeId);
$this->cacheJson($placeDetailsCacheDir, $placeDetailsCacheFile, $json);
} catch (Exception $errorMsgs) {
try {
$json = $this->getJsonFromCache($placeDetailsCacheDir, $placeDetailsCacheFile, null);
} catch (Exception $errorMsgs) {
throw new Exception('Pas pu trouver les détails pour la page ' . $placeId);
}
}
}
return json_decode($json);
*/
}
public function getNearbyPlaces ($lat, $lon, $maxDistance, $minDistance = NULL) {
$placesCacheDir = 'places-nearby/geopoint/';
$placesCacheDir = 'places-nearby/geopoint/' . $maxDistance . 'km/';
$placesCacheFile = $lat . ',' . $lon . '.json';
$json = $this->getJsonFromCache($placesCacheDir, $placesCacheFile, $this->cacheLongevity['placesNearby']);
$placeDetailsCacheDir = 'place/details/';
if (empty($json)) {
$json = $this->getNearbyPlacesJson($lat, $lon, $maxDistance, $minDistance);
$this->cacheJson($placesCacheDir, $placesCacheFile, $json);
$nearbyPlaces = [];
try {
$json = $this->getJsonFromCache($placesCacheDir, $placesCacheFile, $this->cacheLongevity['placesNearby']);
$places = json_decode($json);
foreach ($places->hits->hits as $place) {
try {
$p = $this->getPlaceDetails($place->_id);
$nearbyPlaces[] = $p;
} catch (Exception $errorMsgs) {
// place not found
}
}
} catch (Exception $errorMsgs) {
try {
$n = 50;
$queryParams = [
'size' => $n,
'fields' => ['_id'],
'query' => [
'bool' => [
'filter' => [
[
'geo_distance' => [
"distance" => $maxDistance . 'km',
"geoPoint"=> [
"lat" => $lat,
"lon" => $lon
]
]
]
]
]
]
];
$json = $this->fetchJson('/page/record/_search', $queryParams);
// cache nearby places index
$this->cacheJson($placesCacheDir, $placesCacheFile, $json);
// cache each nearby place details
$result = json_decode($json);
foreach ($result->hits->hits as $place) {
$nearbyPlaces[] = $place;
$placeDetailsCacheFile = $place->_id . '.json';
$this->cacheJson($placeDetailsCacheDir, $placeDetailsCacheFile, json_encode($place));
}
} catch (Exception $errorMsgs) {
try {
$json = $this->getJsonFromCache($placesCacheDir, $placesCacheFile, null);
$result = json_decode($json);
foreach ($result->hits->hits as $place) {
try {
$p = $this->getPlaceDetails($place->_id);
$nearbyPlaces[] = $p;
} catch (Exception $errorMsgs) {
// place not found
}
}
} catch (Exception $errorMsgs) {
throw new Exception('Pas pu récupérer la liste des lieux : ' . $errorMsgs);
}
}
}
$result = json_decode($json);
return $result->hits->hits;
}
public function getNearbyUsers ($lat, $lon, $maxDistance, $minDistance = NULL) {
$placesCacheDir = 'users-nearby/geopoint/';
$placesCacheFile = $lat . ',' . $lon . '.json';
$json = $this->getJsonFromCache($placesCacheDir, $placesCacheFile, $this->cacheLongevity['usersNearby']);
if (empty($json)) {
$json = $this->getNearbyPlacesJson($lat, $lon, $maxDistance, $minDistance);
$this->cacheJson($placesCacheDir, $placesCacheFile, $json);
}
$result = json_decode($json);
return $result->hits->hits;
return $nearbyPlaces;
}
public function getImmaterialRecords () {
/*
public function getNearbyRecords ($lat, $lon, $maxDistance, $minDistance = NULL) {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'nested' => [
'path' => 'category',
'query' => [
'bool' => [
'should' => [
[ 'term' => [ 'category.parent' => 'cat31' ] ],
[ 'term' => [ 'category.id' => 'cat31' ] ],
[ 'term' => [ 'category.parent' => 'cat74' ] ],
[ 'term' => [ 'category.id' => 'cat74' ] ]
],
'must_not' => [
[ "term" => ["category.id" => "cat65"] ]
'bool' => [
'must' => [
[
'geo_distance' => [
"distance" => $maxDistance . 'km',
"geoPoint"=> [
"lat" => $lat,
"lon" => $lon
]
]
], [
'range' => [
'stock' => [
'gte' => 1
]
]
]
]
@ -241,7 +365,7 @@ class Gchange {
]
];
$json = $this->dao->fetchJson('/market/record/_search?pretty', 'gchange', $queryParams);
$json = $this->fetchJson('/market/record/_search?pretty', $queryParams);
$result = json_decode($json);
@ -254,42 +378,190 @@ class Gchange {
return $records;
}
*/
public function getUsersInDaPlace ($placeId) {
$n = 20;
$users = [];
$cacheDir = 'place/visitors/';
$cacheFile = $placeId . '.json';
$usersCacheDir = 'users/';
try {
$json = $this->getJsonFromCache($cacheDir, $cacheFile, $this->cacheLongevity['placeVisitors']);
$result = json_decode($json);
foreach ($result->hits->hits as $hit) {
$user = null;
try {
$user = null;
$user = $this->getUser($hit->_id);
$users[] = $user;
} catch (Exception $errorMsgs) {
// Utilisateur non trouvé
}
}
$queryParams = [
'size' => $n,
'query' => [
'nested' => [
'path' => 'socials',
'query' => [
'bool' => [
'filter' => [
'term' => [
'socials.url' => 'https://www.gchange.fr/#/app/page/view/'. $placeId .'/'
} catch (Exception $errorMsgs) {
try {
$n = 20;
$queryParams = [
'size' => $n
,'fields' => ['_id']
,'query' => [
'nested' => [
'path' => 'socials',
'query' => [
'bool' => [
'filter' => [
'term' => [
'socials.url' => 'https://www.gchange.fr/#/app/page/view/'. $placeId .'/'
]
]
]
]
]
]
]
]
];
];
$json = $this->dao->fetchJson('/user/profile/_search', 'gchange', $queryParams);
$json = $this->fetchJson('/user/profile/_search', $queryParams);
$result = json_decode($json);
foreach ($result->hits->hits as $hit) {
$user = new GchangeUser($hit);
$users[] = $user;
$this->cacheJson($usersCacheDir, $hit->_id . '.json', $user->jsonify());
}
} catch (Exception $errorMsgs) {
try {
$json = $this->getJsonFromCache($cacheDir, $cacheFile, null);
$result = json_decode($json);
foreach ($result->hits->hits as $hit) {
$user = null;
try {
$user = null;
$user = $this->getUser($hit->_id);
$users[] = $user;
} catch (Exception $errorMsgs) {
// Utilisateur non trouvé
}
}
} catch (Exception $errorMsgs) {
throw new Exception('Visiteurs trouvés nulle part.');
}
}
}
return $users;
}
public function getRecordsByIssuer ($issuer) {
$recordsCacheDir = 'records/user/';
$recordsCacheFile = $issuer . '.json';
try {
$json = $this->getJsonFromCache($recordsCacheDir, $recordsCacheFile, $this->cacheLongevity['userRecords']);
} catch (Exception $errorMsgs) {
try {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'bool' => [
'filter' => [
'term' => [
'issuer' => $issuer
]
/*
, 'range' => [
'stock' => [
'gte' => 1
]
]
*/
]
/*
, 'filter' => [
]
*/
, 'must_not' => [
[ "term" => ["stock" => 0] ]
]
]
],
'sort' => [
['time' => 'desc']
]
];
$json = $this->fetchJson('/market/record/_search', $queryParams);
$this->cacheJson($recordsCacheDir, $recordsCacheFile, $json);
} catch (Exception $errorMsgs) {
try {
$json = $this->getJsonFromCache($recordsCacheDir, $recordsCacheFile, null);
} catch (Exception $errorMsgs) {
throw new Exception ("Aucune annonce trouvée pour l'utilisateur " . $issuer);
}
}
}
$result = json_decode($json);
$users = [];
$records = [];
foreach ($result->hits->hits as $hit) {
$users[] = new GchangeUser($hit);
$records[] = new GchangeRecord($hit);
}
return $users;
return $records;
}
public function getRatingsSentBy ($issuer) {
@ -310,7 +582,7 @@ class Gchange {
]
];
$json = $this->dao->fetchJson('/like/record/_search', 'gchange', $queryParams);
$json = $this->fetchJson('/like/record/_search', $queryParams);
$result = json_decode($json);
@ -342,7 +614,7 @@ class Gchange {
]
];
$json = $this->dao->fetchJson('/like/record/_search', 'gchange', $queryParams);
$json = $this->fetchJson('/like/record/_search', $queryParams);
$result = json_decode($json);
@ -355,79 +627,6 @@ class Gchange {
return $ratings;
}
public function getNearbyPlacesJson ($lat, $lon, $maxDistance, $minDistance = NULL) {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'bool' => [
'filter' => [
[
'geo_distance' => [
"distance" => $maxDistance . 'km',
"geoPoint"=> [
"lat" => $lat,
"lon" => $lon
]
]
]
]
]
]
];
$json = $this->dao->fetchJson('/page/record/_search', 'gchange', $queryParams);
return $json;
}
public function getNearbyRecords ($lat, $lon, $maxDistance, $minDistance = NULL) {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'bool' => [
'must' => [
[
'geo_distance' => [
"distance" => $maxDistance . 'km',
"geoPoint"=> [
"lat" => $lat,
"lon" => $lon
]
]
], [
'range' => [
'stock' => [
'gte' => 1
]
]
]
]
]
]
];
$json = $this->dao->fetchJson('/market/record/_search?pretty', 'gchange', $queryParams);
$result = json_decode($json);
$records = [];
foreach ($result->hits->hits as $hit) {
$records[] = new GchangeRecord($hit);
}
return $records;
}
public function getShippable () {
@ -442,7 +641,47 @@ class Gchange {
]
];
$json = $this->dao->fetchJson('/market/record/_search?pretty', 'gchange', $queryParams);
$json = $this->fetchJson('/market/record/_search?pretty', $queryParams);
$result = json_decode($json);
$records = [];
foreach ($result->hits->hits as $hit) {
$records[] = new GchangeRecord($hit);
}
return $records;
}
public function getImmaterialRecords () {
$n = 20;
$queryParams = [
'size' => $n,
'query' => [
'nested' => [
'path' => 'category',
'query' => [
'bool' => [
'should' => [
[ 'term' => [ 'category.parent' => 'cat31' ] ],
[ 'term' => [ 'category.id' => 'cat31' ] ],
[ 'term' => [ 'category.parent' => 'cat74' ] ],
[ 'term' => [ 'category.id' => 'cat74' ] ]
],
'must_not' => [
[ "term" => ["category.id" => "cat65"] ]
]
]
]
]
]
];
$json = $this->fetchJson('/market/record/_search?pretty', $queryParams);
$result = json_decode($json);
@ -460,9 +699,4 @@ class Gchange {
}
public function getShippableOffers () {
}
}

View File

@ -2,9 +2,9 @@
class GchangeUser {
private $userGchangeId;
public $userGchangeId;
private $userName;
public $userName;
private $lat = null;
@ -15,6 +15,8 @@ class GchangeUser {
public function __construct ($gchangeObject) {
$this->gchangeObject = $gchangeObject;
$this->userGchangeId = $gchangeObject->_id;
if (isset($gchangeObject->found) and $gchangeObject->found == false) {
@ -68,4 +70,9 @@ class GchangeUser {
return $this->avatarImgSrc;
}
public function jsonify () {
return $this->gchangeObject;
}
}

View File

@ -166,7 +166,12 @@ function storeAtFreds (json) {
var fetchOpts = {
method: 'GET',
headers: {
// 'Accept': 'txt/html'
'Accept': 'text/html'
// ,'Content-Type': 'text/html'
// // ,'Access-Control-Allow-Origin': '*',
// ,'Origin': 'la-bureautique'
// ,'Referrer-Policy': 'unsafe-url'
// ,'Redirect': 'manual'
},
signal: controller.signal
}
@ -192,15 +197,18 @@ function storeAtFreds (json) {
}, 15000)
var fetchOpts2 = {
method: 'GET',
headers: {
'Accept': 'text/html',
'Content-Type': 'text/html',
// 'Access-Control-Allow-Origin': '*',
'Origin': 'la-bureautique',
'Referrer-Policy': 'unsafe-url'
'Accept': 'text/html'
,'Content-Type': 'text/html'
// ,'Access-Control-Allow-Origin': '*',
,'Origin': 'la-bureautique'
,'Referrer-Policy': 'unsafe-url'
,'Redirect': 'manual'
},
mode: 'cors',
redirect: 'follow',
redirect: 'manual',
signal: controller2.signal
}
fetch(url, fetchOpts2)
@ -239,7 +247,7 @@ function displayImmaterial (records) {
}
}
fetchImmaterial(5)
fetchImmaterial(30)
.then(records => {
displayImmaterial(records.hits.hits)
@ -251,7 +259,7 @@ fetchImmaterial(5)
console.error(error)
})
fetchShippable(5)
fetchShippable(30)
.then(records => {
displayShippable(records.hits.hits)

View File

@ -9,7 +9,11 @@ if (isset($_POST['salt'], $_POST['pepper'])) {
$fred = new Fred();
$keygen = new Keygen();
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
// $playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
$toto = 'QP1VkfaFUMdHZmHgPMi7q5wJJHaQhZcEqs5A86NigKr';
$boris = '25zB1gSC7Qhwnx463cuDLDCKLRVieLAgFiPbYq6jVHG9';
$playerG1Id = $toto;
$_SESSION['player_pubkey'] = $playerG1Id;

83
map.php
View File

@ -3,6 +3,7 @@
require_once('config.php');
require_once('lib/Gchange.class.php');
require_once('lib/Location.class.php');
require_once('lib/ErrorsHandler.class.php');
if (!isset($_SESSION['player_pubkey'])) {
@ -213,43 +214,73 @@ if (isset($selectedPlace)) {
';
$visitors = $gchange->getUsersInDaPlace($place->_id);
$records_visitors = [];
$records_placeCreator = [];
if (!empty($visitors)) {
try {
echo '
<h4>Visiteurs</h4>
<ul class="visitors">';
$records_placeCreator = $gchange->getRecordsByIssuer($place->_source->issuer);
foreach ($visitors as $visitor) {
} catch (Exception $errorMsgs) {
$records_visitors = array_merge($records_visitors, $gchange->getRecordsByIssuer($visitor->getUserGchangeId()));
echo '
<li class="visitor">';
$avatarSrc = $visitor->getAvatarImgSrc();
$src = !empty($avatarSrc) ? $avatarSrc : $games[$_SESSION['gameId']]['default_avatar'];
echo '
<img src="'. $src . '"
alt="'. $visitor->getUserName() .'"
title="'. $visitor->getUserName() .'"
width="64"
height="64" />
</li>';
}
echo '
</ul>';
// Pas d'annonce pour le créateur du lieu
}
$records_placeCreator = $gchange->getRecordsByIssuer($place->_source->issuer);
try {
$visitors = $gchange->getUsersInDaPlace($place->_id);
if (!empty($visitors)) {
echo '
<h4>Visiteurs</h4>
<ul class="visitors">';
foreach ($visitors as $visitor) {
try {
$records_visitor = $gchange->getRecordsByIssuer($visitor->getUserGchangeId());
$records_visitors = array_merge($records_visitors, $records_visitor);
echo '
<li class="visitor">';
$avatarSrc = $visitor->getAvatarImgSrc();
$src = !empty($avatarSrc) ? $avatarSrc : $games[$_SESSION['gameId']]['default_avatar'];
echo '
<img src="'. $src . '"
alt="'. $visitor->getUserName() .'"
title="'. $visitor->getUserName() .'"
width="64"
height="64" />
</li>';
} catch (Exception $errorMsgs) {
// Pas d'annonce pour cet utilisateur
}
}
echo '
</ul>';
}
} catch (Exception $errorMsgs) {
// Visiteurs trouvés nulle part
}
$records = array_merge($records_placeCreator, $records_visitors);
$offers = [];
$needs = [];
$crowdfundings = [];