Atualizando Server.class.php

This commit is contained in:
Kenio 2025-08-25 17:17:14 -03:00
parent c654903e7e
commit 5f11c0b9bc
2 changed files with 11 additions and 4 deletions

View file

@ -252,7 +252,8 @@ try {
if(!$Database->Save($clientId,
$jsonLog->database->file_size_mb,
$jsonLog->database->last_modified,
$jsonLog->database->db_accessible)){
$jsonLog->database->db_accessible,
json_encode($jsonLog->database->partition))){
/** Informo */
throw new InvalidArgumentException('Não foi possível atualizar as informações de banco de dados', 0);

View file

@ -39,6 +39,7 @@ class Database
private $fileSize = null;
private $lastModified = null;
private $dbAccessible = null;
private $dbPartition = null;
/** Construtor da classe */
function __construct()
@ -112,7 +113,8 @@ class Database
public function Save(int $clientId,
? string $fileSize,
? string $lastModified,
? string $dbAccessible)
? string $dbAccessible,
? string $dbPartition)
{
@ -121,16 +123,19 @@ class Database
$this->fileSize = $fileSize;
$this->lastModified = $lastModified;
$this->dbAccessible = $dbAccessible;
$this->dbPartition = $dbPartition;
/** Consulta SQL */
$this->sql = 'insert into db(client_id,
file_size,
last_modified,
db_accessible
db_accessible,
db_partition
) values (:client_id,
:file_size,
:last_modified,
:db_accessible)';
:db_accessible,
:db_partition)';
try{
@ -145,6 +150,7 @@ class Database
$this->stmt->bindParam(':file_size', $this->fileSize);
$this->stmt->bindParam(':last_modified', $this->lastModified);
$this->stmt->bindParam(':db_accessible', $this->dbAccessible);
$this->stmt->bindParam(':db_partition', $this->dbPartition);
/** Executo o SQL */
$this->stmt->execute();