Rename soutien → support (English naming convention)
- getSoutenirContent() → getContent() - SOUTIEN_API_TOKEN → SUPPORT_API_TOKEN - API URL : api/soutien-content → api/support-content Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
322d9136b6
commit
1af076c3fd
6 changed files with 9 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/../includes/cache.php';
|
require_once __DIR__ . '/../includes/cache.php';
|
||||||
$data = getSoutenirContent('en');
|
$data = getContent('en');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once __DIR__ . '/config.php';
|
require_once __DIR__ . '/config.php';
|
||||||
|
|
||||||
function getSoutenirContent(string $lang = 'fr'): array {
|
function getContent(string $lang = 'fr'): array {
|
||||||
$cacheFile = CACHE_DIR . "/content.{$lang}.json";
|
$cacheFile = CACHE_DIR . "/content.{$lang}.json";
|
||||||
|
|
||||||
// Serve cache if fresh
|
// Serve cache if fresh
|
||||||
|
|
@ -12,8 +12,8 @@ function getSoutenirContent(string $lang = 'fr'): array {
|
||||||
|
|
||||||
// Fetch from Kirby API
|
// Fetch from Kirby API
|
||||||
$url = KIRBY_API_URL . '?lang=' . urlencode($lang);
|
$url = KIRBY_API_URL . '?lang=' . urlencode($lang);
|
||||||
if (SOUTIEN_API_TOKEN) {
|
if (SUPPORT_API_TOKEN) {
|
||||||
$url .= '&token=' . urlencode(SOUTIEN_API_TOKEN);
|
$url .= '&token=' . urlencode(SUPPORT_API_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
$context = stream_context_create([
|
$context = stream_context_create([
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('KIRBY_API_URL', 'https://www.index.ngo/api/soutien-content');
|
define('KIRBY_API_URL', 'https://www.index.ngo/api/support-content');
|
||||||
define('SOUTIEN_API_TOKEN', ''); // À remplir avec le même token que dans la config Kirby
|
define('SUPPORT_API_TOKEN', ''); // À remplir avec le même token que dans la config Kirby
|
||||||
define('CACHE_TTL', 300); // 5 minutes
|
define('CACHE_TTL', 300); // 5 minutes
|
||||||
define('CACHE_DIR', __DIR__ . '/../cache');
|
define('CACHE_DIR', __DIR__ . '/../cache');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/includes/cache.php';
|
require_once __DIR__ . '/includes/cache.php';
|
||||||
$data = getSoutenirContent('fr');
|
$data = getContent('fr');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/../includes/cache.php';
|
require_once __DIR__ . '/../includes/cache.php';
|
||||||
$data = getSoutenirContent('fr');
|
$data = getContent('fr');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/../includes/cache.php';
|
require_once __DIR__ . '/../includes/cache.php';
|
||||||
$data = getSoutenirContent('en');
|
$data = getContent('en');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue