CMDE_VERBOSE
public
mixed
CMDE_VERBOSE
= 1
public
mixed
CMDE_VERBOSE
= 1
nom du cookie utilisé pour le login
public
mixed
COOKIE_NAME
= 'shomusrpwd'
cartes exclues du service en V0 car incompatible avec sgupdt v0.6
public
mixed
EXCLUDED_MAPS_IN_V0
= ['8523']
liste de qqs codes d'erreur Http avec leur label
public
mixed
HTTP_ERROR_CODES
= [
204 => 'No Content',
// Requête traitée avec succès mais pas d’information à renvoyer.
400 => 'Bad Request',
// paramètres en entrée incorrects
401 => 'Unauthorized',
// Une authentification est nécessaire pour accéder à la ressource.
403 => 'Forbidden',
// accès interdit
404 => 'File Not Found',
// ressource demandée non disponible
410 => 'Gone',
// La ressource n'est plus disponible et aucune adresse de redirection n’est connue
500 => 'Internal Server Error',
]
Enregistrements test pour tester la méthode validatesAgainstSchema()
public
mixed
JEUX_TESTS
= ["Cas ok sans cartouche, ni mapsFrance" => ['yaml' => <<<EOT
title: "De Port-Barcarès à l'embouchure de l'Aude"
scaleDenominator: '50.200'
spatial:
SW: "42°43,64'N - 002°56,73'E"
NE: "43°13,44'N - 003°24,43'E"
EOT
], "Cas ok avec cartouches, sans pp, ni mapsFrance" => ['yaml' => <<<EOT
title: 'Port Phaeton (Teauaa) - Tapuaeraha'
insetMaps:
- title: 'A - Port Phaeton (Teauaa)'
scaleDenominator: '10.000'
spatial: { SW: '17°46,45''S - 149°20,54''W', NE: '17°43,66''S - 149°18,45''W' }
- title: 'B - Tapuaeraha'
scaleDenominator: '10.000'
spatial: { SW: '17°49,06''S - 149°19,56''W', NE: '17°46,28''S - 149°17,47''W' }
EOT
], "Cas ok sans cartouche, ni mapsFrance, avec scaleDenominator flottant" => ['yaml' => <<<EOT
title: "De Port-Barcarès à l'embouchure de l'Aude"
scaleDenominator: 50.200
spatial:
SW: "42°43,64'N - 002°56,73'E"
NE: "43°13,44'N - 003°24,43'E"
EOT
], "Cas ok sans cartouche, ni mapsFrance, avec scaleDenominator >= 1M" => ['yaml' => <<<EOT
title: 'Des îles Baléares à la Corse et à la Sardaigne'
scaleDenominator: 1.000.000
spatial:
SW: '35°30,00''N - 002°00,00''E'
NE: '45°23,00''N - 010°12,00''E'
EOT
], "Cas KO sans cartouche, ni spatial, ni mapsFrance" => ['yaml' => <<<EOT
title: "De Port-Barcarès à l'embouchure de l'Aude"
scaleDenominator: '50.200'
EOT
], "Cas yaml KO" => ['yaml' => <<<EOT
title 'Port Phaeton (Teauaa) - Tapuaeraha'
insetMaps:
- title: 'A - Port Phaeton (Teauaa)'
scaleDenominator: '10.000'
spatial: { SW: '17°46,45''S - 149°20,54''W', NE: '17°43,66''S - 149°18,45''W' }
- title: 'B - Tapuaeraha'
scaleDenominator: '10.000'
spatial: { SW: '17°49,06''S - 149°19,56''W', NE: '17°46,28''S - 149°17,47''W' }
EOT
]]
public
mixed
JSON_OPTIONS
= JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR
public
mixed
JSON_OPTIONS
= JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR
public
mixed
JSON_OPTIONS
= \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE | \JSON_THROW_ON_ERROR
public
mixed
JSON_OPTIONS
= JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR
public
mixed
LGEOJSON_STYLE
= ['color' => 'blue', 'weight' => 2, 'opacity' => 0.3]
public
mixed
MIME_TYPES
= ['.png' => 'image/png', '.jpg' => 'image/jpeg', '.tif' => 'image/tiff', '.pdf' => 'application/pdf', '.xml' => 'text/xml; charset="utf-8"', '.7z' => 'application/x-7z-compressed', '.txt' => 'text/plain; charset="utf-8"', '.json' => 'application/json; charset="utf-8"']
nb secondes en cache pour le navigateur si <> 0
public
mixed
NB_SECONDS_IN_CACHE
= 0.5 * 24 * 60 * 60
mise en cache des tuiles sur le serveur
public
mixed
SERVER_TILECACHE
= \true
public
mixed
SGSERVER_VERSION
= '4'
public
mixed
SHOMGEOTIFF
= '/var/www/html/shomgeotiff'
cartes spéciales traitées spécialement en version < 4
public
mixed
SPECIAL_MAPS
= ['7330', '7344', '7360', '8101', '8502', '8509', '8510', '8517', '8523']
liste limitée de cartes pour tests
public
mixed
TEST_MAPS
= []
menu() : void
test d'envoi d'un mail
sendMail(string $action, string $email, string $secret[, string|null $passwd = null ]) : void
Contrairement à ce qu'indique la doc Php, il ne faut pas rajouter de champ To car GMail considère que c'est une erreur
menu() : void
pour un entier fournit une représentation avec un '_' comme séparateur des milliers
addUndescoreForThousand(int|null $val) : string
config(string $rubrique) : string|array<string, mixed>
en cas d'erreur dans la génération
error(string $message) : never
Création et affichage d'une image d'erreur
sendErrorTile(string $tileid, string $message[, string $symbol = 'undef' ][, string $color = 'FF0000' ][, int $width = 128 ][, int $height = 128 ]) : never
execCmde - exécute une commande Linux - enrobage de exec()
execCmde(string $cmde, int $verbose) : array<string, string|int>
retourne [] ssi tout est ok, cad le retour d'exec() !== false && $result_code == 0 sinon retourne ['result_code'=> {result_code}, 'output'=> {output}]
téléchargement d'un fichier en utilisant la commande wget
download(string $url, string $outputFile, int $verbose) : int
effectue un wget sur l'url et stocke le résultat dans $outputFile ; retourne le code http ; si code<>200 le fichier est vide Utilise les variables d'environnement http_proxy: et https_proxy si elles sont définies ainsi que le login/passwd défini dans l'URL du serveur
liste des GeoTiffs
geotiffs() : array<int, string>
retourne la commande SQL de création de la table
log_table_schema() : string
enregistrement d'un log
write_log(bool $access) : bool
extrait du fichier MD ISO dont le path est fourni la version de la carte et la date dateStamp
readMapVersion(string $path) : array{version: string, dateStamp: string}
La version est fournie sous la forme d'une chaine "${anneeEdition}c${lastUpdate}"
enregistrement d'un log temporaire pour aider au déverminage
logRecord(array<string|int, mixed> $log) : void
Génère une erreur Http et un message utilisateur avec un content-type text ; enregistre un log avec un éventuel message sys
sendHttpCode(int $httpErrorCode, string $mesUti[, string $mesSys = '' ]) : void
Lecture dans maps.json de la liste des nums des cartes obsolètes.
obsoleteMaps() : array<int, string>
Renvoit le libellé de la version courante de la carte $mapnum ou '' si la carte n'existe pas
findCurrentMapVersion(string $MAPS_DIR_PATH, string $mapnum) : string
expanse une carte téléchargée comme 7z au path indiqué
expand(string $map7zpath) : void
télécharge la carte, l'expanse et l'installe dans le répertoire courant, retourne le libellé du code http
dlExpandInstallMap(string $SERVER_URL, string $MAPS_DIR_PATH, string $TEMP, string $mapnum) : string
affiche le message d'erreur puis met fin au script avec un code 1
error(string $message) : never
menu() : void
test d'appel.
execCmdeTest(string $cmde) : int
Vérifier que l'on sait récupérer un code d'erreur depuis une exécution d'un script Php
affiche un message et termine le script avec un code retour de 1
error(string $message) : never
affichage en degrés minutes décimales avec 2 chiffres significatifs
coordDM(float $coord) : string
affichage lat,lon dans le format de l'exemple
latLonDM(TPos $pos) : string
extraction des coins des rectangles englobants définis dans un array de Features GeoJSON, renvoit un array de Features
cornersOfRects(string $lyrname, array<int, TGeoJsonFeature> $rects) : array<int, TGeoJsonFeature>
indique la version ShomGT
shomGTVersion() : int
Retourne le libellé de la version courante de la carte $mapnum (Code en ShomGT V4).
findCurrentMapVersionV4(string $MAPS_DIR_PATH, string $mapnum) : string
Retourne '' si la carte n'existe pas ou 'undefined' si aucun fichier de MD n'est trouvé
Retourne le libellé de la version courante de la carte $mapnum (Code en ShomGT V3).
findCurrentMapVersionV3(string $MAPS_DIR_PATH, string $mapnum) : string
Retourne '' si la carte n'existe pas ou 'undefined' si aucun fichier de MD n'est trouvé
Retourne le libellé de la version courante de la carte $mapnum (Code en ShomGT V3 ou V4).
findCurrentMapVersion(string $MAPS_DIR_PATH, string $mapnum) : string
Retourne '' si la carte n'existe pas ou 'undefined' si aucun fichier de MD n'est trouvé
enregistrement d'un log temporaire pour afficher des infos, par ex. estimer les performances
logRecord(array<string|int, mixed> $log) : void