mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-09-25 01:53:03 +02:00
a31e4ab3078e0c22bce6dddd005a89d5696f8f7b
Ajoute une fonction SQLite UDF accfold() (app/src/AccentFolding.php) qui plie les caractères accentués latin vers leur base ASCII (é→e, ç→c, …), et l'applique à chaque condition de recherche côté colonne ET côté terme (accfold(column) LIKE accfold(:term)). Comme le runtime n'a ni intl (Normalizer) ni iconv, le repli passe par une map de translitération manuelle (Western Latin-1 + Latin Extended-A, NULL-safe). Couvert : - recherche publique (searchTheses / countSearchResults) : titre, sous-titre, synopsis, auteurs, promoteurs, tags ; - popover étudiant (getThesesByAuthorName / getThesesForAuthors) : a.name ; - recherche backoffice (getThesesList / getThesesListCount) : titre, sous-titre, identifiant, auteur. L'UDF est enregistré dans Database::registerSqliteFunctions() (appelé par le constructeur et par le harnais de test TestDatabaseInstance). Évite aussi la dépréciation PHP 8.5 de PDO::sqliteCreateFunction() : la connexion est créée via \Pdo\Sqlite quand disponible (createFunction()) avec repli sur PDO (sqliteCreateFunction()) sur les anciens runtimes ; les tests passent de @dataProvider docblock à l'attribut #[DataProvider] (fin de la dépréciation PHPUnit). Détache .php-cs-fixer.cache (gitignoré) pour ne plus polluer le working copy. 294 tests PHPUnit verts sans dépréciation, phpstan niveau 5 OK.
XAMXAM
(Anciennement Posterg)
Répertoire des travaux de fin d'études de l'ERG (École de Recherche Graphique).
Requirements
- PHP ≥ 8.4 (with
ext-json,ext-openssl,ext-pdo,ext-sqlite3) - Composer
- Node.js / npm
- nginx (production)
Development
# one-time
composer install
npm ci
# run the dev server (builds assets, applies migrations, opens a browser)
just dev # http://127.0.0.1:8000 (public) and /admin/
just stop # stop it
Live CSS/JS rebuilds happen automatically via a chokidar watcher while just dev runs.
See docs/development.md for the full workflow.
Deployment
Files are pushed to the server with rsync — there is no repo on the remote.
just deploy # rsync app files → xamxam:/var/www/xamxam/
just deploy-db # push local xamxam.db → remote (only if remote DB is absent)
deploy-db refuses to run if a database already exists on the server, to avoid
accidental overwrites of production data.
First-time server setup
ssh xamxam
sudo mkdir -p /var/www/xamxam
sudo chown www-data:xamxam /var/www/xamxam
sudo chmod 775 /var/www/xamxam
exit
Then deploy once and apply nginx config:
just deploy
just deploy-nginx
Security notes
- Admin panel protected by PHP session (
AdminAuth) — password-only, no username - Uploads stored outside webroot, served via controlled
/media(MediaController) - Rate limiting on public search (
app/src/RateLimit.php) - See
nginx/docs/SECURITY_HEADERS.mdfor security headers reference
More docs
See docs/README.md for the full documentation index.
Languages
PHP
76%
CSS
10%
JavaScript
7.3%
Shell
4.3%
Just
1.6%
Other
0.8%