aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-12-23 21:34:47 +0100
committerpolo <ordipolo@gmx.fr>2025-12-23 21:34:47 +0100
commit4f734e0f374428be6424faee0a56458d4fa80396 (patch)
treea6fbc52f230a0f048be4ab2db8ac47cfa974f993 /bin
parent833edf6f21aab07dcd0a8d0de9e002c483deed0e (diff)
downloadcms-4f734e0f374428be6424faee0a56458d4fa80396.tar.gz
cms-4f734e0f374428be6424faee0a56458d4fa80396.tar.bz2
cms-4f734e0f374428be6424faee0a56458d4fa80396.zip
installation de fullcalendar avec composer et CDN au lieu de GIT
Diffstat (limited to 'bin')
-rw-r--r--bin/install_fullcalendar.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/install_fullcalendar.php b/bin/install_fullcalendar.php
new file mode 100644
index 0000000..aafce77
--- /dev/null
+++ b/bin/install_fullcalendar.php
@@ -0,0 +1,41 @@
1<?php
2// bin/install_fullcalendar.php
3function installFullCalendar(): void
4{
5 $path = 'public/js/fullcalendar';
6 $links = [
7 'index.global.min.js' => "https://cdn.jsdelivr.net/npm/fullcalendar/index.global.min.js",
8 'fr.global.min.js' => "https://cdn.jsdelivr.net/npm/@fullcalendar/core/locales/fr.global.min.js"
9 ];
10
11 foreach($links as $key => $link){
12 $curl = curl_init($link);
13 if(!$curl){ // lien non valide
14 echo "Erreur : Impossible d'initialiser cURL.\n";
15 return;
16 }
17
18 if(!is_dir($path)){
19 mkdir($path, 0755, true);
20 }
21
22 $file = @fopen($path . '/' . $key, 'w+'); // @masque l'erreur pour la traiter soi-même
23 if(!$file){ // erreur écriture fichier
24 echo "Erreur : Impossible d'ouvrir le fichier $path pour l'écriture.\n";
25 echo "Détails de l'erreur : " . error_get_last()['message'] . "\n";
26 return;
27 }
28
29 curl_setopt($curl, CURLOPT_FILE, $file);
30 curl_setopt($curl, CURLOPT_HEADER, 0);
31
32 $response = curl_exec($curl);
33 if(!$response){ // erreur téléchargement
34 echo "Erreur : Le téléchargement a échoué. cURL Error: " . curl_error($curl) . "\n";
35 }
36
37 fclose($file);
38 curl_close($curl);
39 }
40}
41installFullCalendar();