The PHP app runs on Cafe24 shared web hosting -- calling it 'cloud' was misleading. Renames the directory, the edge client module, and every doc/script/identifier that used the term. - cloud/ -> server/ (incl. server/deploy/build_cafe24_package.sh paths) - edge/cloudclient.py -> edge/serverclient.py, CloudClient -> ServerClient - cloud/docs/cloud-deploy.md -> server/docs/server-deploy.md - CLOUD_* env/config keys -> SERVER_* - tests renamed to match Tests: PHP 109 pass (4 skipped), pytest 167 pass. dist/ regenerated.
27 lines
750 B
PHP
27 lines
750 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace App\Repository\Pdo;
|
|
|
|
use App\Repository\AuditRepository;
|
|
use PDO;
|
|
|
|
final class PdoAuditRepository implements AuditRepository
|
|
{
|
|
public function __construct(private PDO $pdo) {}
|
|
|
|
public function append(string $actor, string $action, string $target, array $before, array $after): void
|
|
{
|
|
$st = $this->pdo->prepare(
|
|
'INSERT INTO move_audit_log (actor, action, target, before_json, after_json, ts)
|
|
VALUES (?, ?, ?, ?, ?, ?)'
|
|
);
|
|
$st->execute([
|
|
$actor,
|
|
$action,
|
|
$target,
|
|
json_encode($before, JSON_THROW_ON_ERROR),
|
|
json_encode($after, JSON_THROW_ON_ERROR),
|
|
time(),
|
|
]);
|
|
}
|
|
}
|