-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
1288 lines (1192 loc) · 54.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*
* http://www.mondepot.com/index.php?plugin=xxxxxx renvoie le numéro de version au format texte
* http://www.mondepot.com/index.php?plugin=xxxxxx&infos renvoie les infos du plugin au format XML
* xxxxxx est le nom de l'archive Zip du plugin, stocké dans le dossier PLUGINS_FOLDER défini ci-dessous.
* L'archive et le plugin ont le même nom par convention.
*
* Ajustez la constante PLUGINS_FOLDER selon vos désirs.
*
* @author Jean-Pierre Pourrez, Thomas Ingles
* @version 2018-12-27 - gère les multiples versions des plugins et génére un cache
* @license GNU General Public License, version 3
* @see http://www.pluxml.org
*
* Les catalogues des plugins, themes, scripts sont stockés dans le dossier WORKDIR au format JSON.
* Les icônes des plugins et les aperçus (preview) des thêmes sont stockés dans les dossiers WORKDIR/ASSETS/plugins
* et WORKDIR/ASSETS/thêmes repscativement dans leurs formats natifs
*
* Les collections des archives zip d'extensions pour PluXml sont classés en pages : plugins, thêmes et scripts
*
* */
// Customize these constants for your site
const SITE_STATIC = false; // Générer des pages pour un site statique (pages Github)
const SITE_TITLE = 'Kazimentou';
const SITE_OWNER = 'Bazooka07';
const SITE_AUTHOR = 'Jean-Pierre Pourrez';
const SITE_DESCRIPTION = 'Plugins, thèmes, scripts pour le C.M.S. PluXml';
if(!class_exists('ZipArchive')) {
$message = 'Class ZipArchive is missing in PHP library';
header('HTTP/1.0 500 '.$message);
header('Content-type: text/plain');
echo $message;
exit;
}
// CORS support
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Server-Side_Access_Control
if(isset($_SERVER['HTTP_ORIGIN'])) {
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header('Access-Control-Allow-Credentials: false');
header('Access-Control-Max-Age: 7200'); // cache for two hours
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
header('Access-Control-Allow-Methods: GET, OPTIONS'); //Make sure you remove those you do not want to support
}
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
}
exit(0);
}
}
define('VERSION', date('Y-m-d', filemtime(__FILE__)));
const PLUGINS_FOLDER = 'plugins';
const THEMES_FOLDER = 'themes';
const SCRIPTS_FOLDER = 'scripts';
const WORKDIR = 'workdir/';
const ASSETS = 'assets/';
const LAST_RELEASES = 'latest/';
const STYLESHEET_FILENAME = ASSETS.'style.css';
$ALL_PAGES = array(PLUGINS_FOLDER, THEMES_FOLDER, SCRIPTS_FOLDER);
const LIFETIME = 7 * 24 * 3600; // in seconds (Unix time) for rebuilding $cache and $cache_icons
define('MAX_FILESIZE', (preg_match('#\.free\.fr$#', $_SERVER['SERVER_NAME'])) ? 1048576 : 2097152 /*4194304 */); // 1 mega-bytes : 2 mega-bytes 4 mega-bytes
const INFOS_FILE = 'infos.xml';
define('INFOS_FILE_LEN', strlen(INFOS_FILE));
const EXT_RSS = '-rss.xml';
$pageInfos = array(
'plugins' => array('imgSize' => 48, 'imgAlt' => 'Icon', 'titleSingle' => 'plugin'),
'themes' => array('imgSize' => 300, 'imgAlt' => 'Thème', 'titleSingle' => 'thème'),
'scripts' => array('imgSize' => 48, 'imgAlt' => 'Icon', 'titleSingle' => 'script')
);
# some icons in base64
const DEFAULT_ICON = 'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAMT0lEQVR42tVaeXRU1R3+3jJvJrNmhyxkIRBISEIQCKChKmvYBQFBQbCV2lakB6tIlYpUjywqhaD9QwElgHUXPVVRXAFFFFHRgAKiIBRCkIQkM5N5a3/35c0wCdgGHXvoy7lz73vvvnu/77fd330vHP7PD+7nPDzs6c6OYFNomdysXKMqWqoma1Bl/YCh4c7qhQ3PXfQEKp7vulaV1RtUAi4HFMiNCpSQBt3QdU7EpD13nnnhoiUw8a2Srrqm7yPAQtOJIARBQEZeGsq7DYFHT8L7X7ytvP/51tG75/3wxkVJYM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M4AERzHYTIxhzFZBYHsFHjGjGNjD4ClK0cxvloC4F5ZzTu0uuIGsOxeeOfQgnvZ9d9+ABtblsTZgILxAAAAAElFTkSuQmCC';
const STYLESHEET = <<< STYLESHEET
* {margin:0; padding: 0; box-sizing: border-box;}
body {font-family: 'Noto Sans',Droid,Arial,Georgia,Sans-Serif; color: #000; background-color: #ebeff2; background-image: url('background.png');
}
header .cell-border {margin-top: 0.7rem;}
.cell-border.logo {margin-top: 2rem;}
.logo a {display: block;}
.logo img {max-width:100%;}
.nowrap > * { margin: 0 0.3rem; white-space: nowrap;}
#bandeau {display: grid; grid-template-columns: 60px auto 60px; padding: 0.3rem 0.7rem 0 0; background-color: #ddd; line-height: 1.2; font-size: 82%;}
#bandeau h2 {grid-column: span 3;}
#bandeau span {white-space: nowrap;}
#bandeau > div:first-of-type > div:last-of-type {margin-top: 2.2rem;}
#menu {position: fixed; top: 0; left: 0;}
#nav-toggle {display: none;}
#nav-toggle + ul {
position: absolute;
top: 3rem;
width: 7rem;
left: -7rem;
background-color: #eee;
text-align: center;
list-style: none;
transition: left 0.3s ease;
}
#nav-toggle:checked + ul {left: 0;}
#menu label {
font-size: 150%;
padding: 0.3rem;
background-color: #ddd;
}
#menu a { display: block; padding: 0.3rem 0.5rem; text-decoration: none; color: inherit;}
#menu a:hover { color: #fff;}
h1, h2, h3, h4, h5 {text-align: center;}
h3 {margin: 0.5em 0;}
h3 + p {margin:0; padding:0; text-align: center; font-style: italic;}
h3 + p a {padding: 0 10px;}
.txt-center { text-align: center; text-indent: 0;}
#bandeau a {text-decoration: none;}
#bandeau div {padding: 0; text-align: center;}
#bandeau label {cursor: pointer;}
/* p:last-of-type, #detail + p {text-align: center;} */
h1 {margin-top: 0;}
h1 + p {margin-bottom: 0;}
label, a {padding: 0 4px;}
label:hover, a:hover {color: #FFF; background-color: green;}
.url-help {margin: 0.5rem;}
.url-help ul {padding-left: 1.5rem; margin: 0;}
#detail {width: 99%; background-color: #FFF; border: 1px solid #A99; margin: 5px auto; border-spacing: 0;}
#detail thead {background-color: #C2C2A6; }
#detail th {padding: 5px 2px;}
#detail tr {vertical-align: top;}
#detail tbody tr:nth-of-type(even) {background-color: #DAE7E6;}
#detail tbody tr:hover {background-color: #EDD780;}
#detail tbody td:nth-of-type(3) {text-align: right; padding-right: 5px;}
#detail tbody td:nth-of-type(7) {text-align: justify; padding: 0 5px; white-space: normal; min-width: 20rem;}
#detail tbody td:nth-of-type(8) {white-space: normal; }
#detail tbody td:last-of-type {text-align: center;}
#detail + p {font-style: italic; font-size: 80%;}
#detail td:first-of-type a:hover {background-color: initial;}
#bandeau a img, #detail a img, #detail td:first-of-type span {border: 2px solid transparent;}
#bandeau a img:hover, #detail a img:hover, #detail td:first-of-type span:hover {border-color: green;}
#help_nav {display: none;}
#help_nav + div {display:none; position: fixed; top: 10em; right: 10%; width: 400px; margin:0; padding: 10px; background-color: #DFF5F1; border: 1px solid #4B7A9C; border-radius: 5px; text-align: justify; z-index: 10;}
#help_nav:checked + div {display: block;}
#help_nav + div ul {padding-left: 1em;}
#help_nav + div + table #help::before {display: inline-block; width: 75px; text-align: right; content: 'Afficher'}
#help_nav:checked + div + table #help::before {content: 'Masquer';}
#help_nav:checked + div + table #help {color: #FFF; background-color: green;}
#help_nav + div ul {margin: 0.5em 0;}
th[title]:hover {background-color: yellow; cursor: help;}
td {border-left: 1px solid #A99;}
td:first-of-type, td:nth-of-type(2) {border-left: inherit;}
td:nth-of-type(2) {padding-left: 5px;}
#help {margin:0; padding:3px; cursor: pointer; white-space: nowrap;}
.alert {padding: 1em 0; text-align: center; color: red;}
.first td {border-top: 2px solid #A99;}
.rss:hover {background-color: inherit;}
#catalogue {padding-right: 0.7rem;}
#catalogue article {
display: flex;
flex-direction: column;
max-width: 23rem;
margin: 0.5rem auto;
padding: 0;
background-color: #fff;
border: none;
box-shadow: 4px 4px 3px #aaa;
border-radius: 0.5rem;
}
#catalogue article header {
margin: 0;
padding: 0;
background-color: #556;
color: orange;
text-align: center;
letter-spacing: 0.2rem;
}
#catalogue article header a {
display: inline-block;
width: 100%;
margin: 0;
padding: 0.3rem 0;
color: inherit;
text-decoration: none;
}
#catalogue article header a:hover {
color: #fff;
}
#catalogue article section {
flex-grow: 1;
}
#catalogue article footer {
margin: 0;
background-color: orange;
text-align: center;
}
#catalogue article p { margin: 0.3rem 0; }
#catalogue article section span {
display: inline-block;
width: 4rem;
text-align: right;
margin-right: 0.5rem;
font-style: italic;
color: #aaa;
}
#catalogue article footer span {
white-space: nowrap;
}
#catalogue .descr {
padding: 0 0.5rem;
font-family: "Skolar Regular","Roboto Slab","Droid Serif",Cambria,Georgia,"Times New Roman",Times,serif;
font-size: 120%;
overflow: auto;
}
body.page-themes #catalogue .descr {
text-align: center;
}
#catalogue .descr > a {
text-decoration: none;
}
body.page-plugins #catalogue .descr > a {
float: left;
margin-right: 0.5rem;
padding: 0;
}
div.scrollable-table { overflow: auto; white-space: nowrap; padding-bottom: 0.8rem;}
div.nothing { padding: 2rem 0; color: red; font-size: 250%; font-weight: bold;}
@media screen and (min-width: 41rem) {
#catalogue {display: flex; justify-content: space-around; flex-wrap: wrap;}
#catalogue article {width: 48%; margin: 0.5rem 0.3rem;}
}
@media screen and (min-width: 46rem) {
#bandeau {position: sticky; top:0; padding: 0.3rem 2rem 0; font-size: 100%;}
#bandeau h1, #bandeau h2 { padding: 0 1rem; }
.logo { margin-top: 0;
}
@media screen and (min-width: 63rem) {
#bandeau {position: static; padding-bottom: 0.5rem; padding: 0.3rem 2% 0.5rem;}
#bandeau > div:first-of-type {padding: 0 1.5%;}
#bandeau h1 {margin-top: 1rem; lline-height: 1.6;}
#menu {position: sticky;}
#menu label[for="nav-toggle"] {display: none;}
#nav-toggle + ul {position: initial; width: 100%; display: flex; justify-content: center; padding-top: 0.5rem; background-color: transparent;}
#menu li {margin: 0 1rem;}
#menu li a {display: block; padding: 0.2rem 1rem; background-color: #888; color: #fff; border-radius: 0.5rem; letter-spacing: 0.1rem;}
#menu li a:hover {background-color: green;}
#catalogue article {width: 31.8%;}
#catalogue.count-2 {justify-content: center;}
#catalogue.count-2 article { margin: 0.5rem 1rem;}
.url-help {max-width: 64rem; margin: 0.5rem auto;}
}
@media screen and (min-width: 86rem) {
#catalogue article {width: 25.5%;}
#catalogue.count-3 {justify-content: center;}
#catalogue.count-3 article { margin: 0.5rem 1rem;}
}
@media screen and (min-width: 96rem) {
#catalogue article {width: 19.3%;}
#catalogue.count-4 {justify-content: center;}
#catalogue.count-4 article { margin: 0.5rem 1rem;}
}
STYLESHEET;
$root = htmlspecialchars($_SERVER['PHP_SELF']);
// Only used if $page == 'plugins'
$specialHTMLPages = array('index', 'all');
function singlePage($page) {
return rtrim($page, "sx \t\n\r\0\x0B");
}
function getPage($key=false) {
if(empty($key)) {
if(empty($_GET)) { return 'plugins'; } // Here is the homepage
$key = 'page';
} elseif(!in_array($key, array('json', 'latest', 'rss', 'xml', 'cat', 'lastUpdated'))) {
// this parameter is not allowed
return false;
}
if(!empty($_GET[$key])) {
$page = htmlspecialchars($_GET[$key]);
if(!empty($page) and in_array($page, $GLOBALS['ALL_PAGES'])) {
return $page;
} else {
// Anti-hacking
exit('What did you expect ?');
}
} else {
// Choice by default
return 'plugins';
}
}
function getBaseUrl1() {
$proto = (!empty($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) == 'on') ? 'https' : 'http';
$path = preg_replace('@'.basename(__FILE__).'$@', '', $_SERVER['PHP_SELF']);
return "${proto}://${_SERVER['HTTP_HOST']}${path}";
}
/*
* Recherche dans l'archive Zip, une entrée finissant par infos.xml
* */
function searchInfosFile(ZipArchive $zipFile) {
for ($i=0; $i<$zipFile->numFiles; $i++) {
$filename = $zipFile->getNameIndex($i);
if(substr($filename, - INFOS_FILE_LEN) == INFOS_FILE) {
return $filename;
break;
}
}
return false;
}
function buildCatalogue(&$zipsList, $page) {
$cache = array();
$imgsFolder = WORKDIR."assets/$page";
$result = true;
$zip = new ZipArchive();
foreach($zipsList as $filename) {
if($res = $zip->open($filename)) {
if($infoFile = searchInfosFile($zip)) {
$infosXML = $zip->getFromName($infoFile);
try {
$infos = array(
'download' => $filename
);
# On parse le fichier infos.xml
@$doc = new SimpleXMLElement($infosXML);
foreach($doc as $key=>$value) {
$infos[$key] = $value->__toString();
}
# On récupère la date du fichier infos.xml
$infosStats = $zip->statName($infoFile);
$filedateEpoc = $infosStats['mtime'];
$infos['filedate'] = date('Y-m-d', $filedateEpoc);
switch($page) {
case PLUGINS_FOLDER:
$keyName = getPluginName($zip);
$imgPattern = '@^'.$keyName.'/icon\.(jpe?g|png|gif)$@i';
break;
case THEMES_FOLDER:
$keyName = getThemeName($zip);
$imgPattern = '@^'.$keyName.'/preview\.(jpe?g|png|gif)$@i';
break;
case SCRIPTS_FOLDER:
// $keyName = getThemeName($zip);
break;
default:
}
// look for an image
$imgPath = false;
if(!empty($imgPattern)) {
for ($i=0; $i<$zip->numFiles; $i++) {
$filename = $zip->getNameIndex($i);
if(preg_match($imgPattern, $filename, $matches)) {
$img = "$imgsFolder/${keyName}.$matches[1]";
if(!file_exists($img) or filemtime($img) < $filedateEpoc) {
if($zip->extractTo($imgsFolder, $filename)) {
$from = $imgsFolder.'/'.$filename;
rename($from, $img);
touch($img, $filedateEpoc);
}
}
if(empty($imgPath)) {
$imgPath = $img;
}
break;
}
}
}
// on vérifie si le plugin est déjà référencé dans le cache
if(! array_key_exists($keyName, $cache)) {
$cache[$keyName] = array(
'img' => $imgPath,
'versions' => array()
);
}
$cache[$keyName]['versions'][$infos['version']] = $infos;
if(!empty($imgPath)) {
$cache[$keyName]['img'] = $imgPath;
}
} catch (Exception $e) {
error_log(date('Y-m-d H:i').' - fichier infos.xml incorrect pour le plugin '.$f.' - Ligne n°'.$e->getLine().': '.$e->getMessage()."\n", 3, dirname(__FILE__).'/errors.log');
$result = false;
}
}
$zip->close();
}
}
// supprime les dossiers créés par l'extraction des iĉones ou des previews
foreach(glob($imgsFolder.'/*', GLOB_ONLYDIR) as $folder) {
rmdir($folder);
}
// tri et sauvegarde du cache sur le disque dur
$lastReleases = array();
if(!empty($cache)) {
ksort($cache);
// tri décroissant des versions
foreach(array_keys($cache) as $k) {
uksort($cache[$k]['versions'], function($a, $b) {
return -version_compare($a, $b);
});
$lastVersion = array_keys($cache[$k]['versions'])[0];
$lastReleases[$k] = $cache[$k]['versions'][$lastVersion];
$lastReleases[$k]['img'] = $cache[$k]['img'];
}
}
// encodage et sauvegarde au format JSON
$filename = WORKDIR.$page.'.json';
if(file_put_contents($filename, json_encode($cache, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), LOCK_EX) === false) {
$error = "No rights for writing in the $filename file.\nFeel free for calling the webmaster.";
}
if(!empty($lastReleases)) {
// build parameter for the callback request (JSONP)
$hostname = ((isset($_SERVER['HTTPS']) and !empty($_SERVER['HTTPS'])) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'];
$url_base = preg_replace('@'.basename(__FILE__).'$@', '', htmlspecialchars($_SERVER['PHP_SELF']));
$callbacks = array(
'hostname' => $hostname,
'urlBase' => $url_base,
'page' => $page,
'lastUpdate' => date('c', filemtime($filename)),
'items' => $lastReleases
);
$filename = WORKDIR.LAST_RELEASES.$page.'.json';
if(file_put_contents($filename, json_encode($callbacks, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), LOCK_EX) === false) {
$error = "No rights for writing in the $filename file.\nFeel free for calling the webmaster.";
}
}
return $result;
}
/*
* Vérifie si le cache a besoin d'une mise à jour
* On ne fait la mise à jour que toutes les LIFETIME minutes
* */
function checkCatalogue($page) {
$catalogue = WORKDIR.$page.'.json';
$zipsList = glob($page.'/*.zip');
$outdated = !file_exists($catalogue);
if(!$outdated) {
$refTime = filemtime($catalogue);
$outdated = (time() - $refTime > LIFETIME);
}
if(!$outdated) {
foreach($zipsList as $zipfile) {
if($refTime < filemtime($zipfile)) {
// one file is more recent than the cache
$outdated = true;
break;
}
}
}
return ($outdated and buildCatalogue($zipsList, $page));
}
function getCatalog($page, $expires=true) {
$filename = WORKDIR.$page.'.json';
if($expires) {
header("Expires: ".date('r', filemtime($filename) + 86400)); // 24 heures
}
return json_decode(file_get_contents($filename), true);
}
/*
* Recherche la déclaration d'une classe dans un fichier .php
* dans l'archive Zip, pour connaitre le nom réel du plugin
* */
function getPluginName(ZipArchive $zipFile) {
$result = false;
for ($i=0; $i<$zipFile->numFiles; $i++) {
$filename = $zipFile->getNameIndex($i);
if(substr($filename, -4) == '.php') {
$content = $zipFile->getFromName($filename);
if(preg_match('/\bclass\s+(\w+)\s+extends\s+plxPlugin\b/', $content, $matches) === 1) {
$result = $matches[1];
break;
} else if(preg_match('/^([\w-]+)\/(?:article|static[^\.]*)\.php$/', $filename, $matches) === 1) {
// archive zip d'un théme demandé par niqnutn
$result = $matches[1];
break;
}
}
}
return $result;
}
function getThemeName(ZipArchive $zipFile) {
return preg_replace('@^(\w[^/]*).*@', '$1',$zipFile->getNameIndex(0));
}
function exportLatest($page, $static=false) {
if(empty($page)) { exit('No catalog for '.$page); }
if(!isset($_SERVER['HTTP_ORIGIN'])) {
header('HTTP/1.1 403 Access Forbidden');
header('Content-Type: text/plain');
echo "I have a dream : You're in a jail !\n\n";
exit;
}
checkCatalogue($page);
$filename = WORKDIR.LAST_RELEASES."$page.json";
header('Content-Type: application/json');
header('Content-Length: ' . filesize($filename));
readfile($filename);
}
function exportJSON($page, $static=false) {
if(empty($page)) { exit('No catalog for '.$page); }
checkCatalogue($page);
$filename = WORKDIR."$page.json";
header('Content-Type: application/json');
header('Content-Length: ' . filesize($filename));
readfile($filename);
}
function exportRSS($page, $static=false) {
if(!in_array($page, $GLOBALS['ALL_PAGES'])) { exit('Are You Jupiter ?'); }
$updated = checkCatalogue($page); // true if the catalog for this page is just updated
// Don't make a static file if not useful
$staticFilename = $page.EXT_RSS;
if(!$updated and ($static and file_exists($staticFilename))) { return; }
$filename = WORKDIR.$page.'.json';
$lastBuildDate = date('r', filemtime($filename));
$sitename = SITE_TITLE;
$root = getBaseUrl1();
if($static) {
$link = ($page == 'plugins') ? 'index' : $page;
$link .= '.html';
$href = $root.$page.EXT_RSS;
} else {
$bs = basename(__FILE__);
$link = $bs;
if($page != 'plugins') {
$link .= "?page=$page";
}
$href = "${root}${bs}?rss";
if($page != 'plugins') { $href .= "=${page}"; };
}
$description = SITE_DESCRIPTION;
$ver = VERSION;
$output = <<< RSS_STARTS
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>$sitename, playstore for Pluxml</title>
<link>${root}${link}</link>
<description>$description</description>
<lastBuildDate>$lastBuildDate</lastBuildDate>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="$href" />
<generator>Repository for Pluxml v3.0 ($ver)</generator>
<skipDays>
<day>Sunday</day>
</skipDays>\n
RSS_STARTS;
$temp = array();
$cache = getCatalog($page);
foreach($cache as $item=>$infos) {
$lastVersion = array_keys($infos['versions'])[0];
$lastRelease = $infos['versions'][$lastVersion];
if(!empty($infos['img'])) { $lastRelease['img'] = $infos['img']; }
$temp[$lastRelease['filedate'].'-'.$item] = $lastRelease;
}
if(!empty($temp)) {
krsort($temp);
$lastUpdates = array_slice($temp, 0, 10); // 10 items for the RSS feed
foreach($lastUpdates as $item=>$infos) {
$title = $infos['title'];
$pubDate = date('r', strtotime($infos['filedate']));
$description = htmlspecialchars($infos['description'], ENT_COMPAT | ENT_XML1);
$author = htmlspecialchars($infos['author'], ENT_COMPAT | ENT_XML1);
$guid = $link.'_'.$item;
if(!empty($infos['img']) and file_exists($infos['img'])) {
$length = filesize($infos['img']);
$size = getimagesize($infos['img']);
$enclosure = <<< ENCLOSURE
\n <enclosure url="${root}${infos['img']}" length="$length" type="${size['mime']}" />
ENCLOSURE;
} else
$enclosure = '';
$output .= <<< ITEM
<item>
<title>$title</title>
<link>${root}${infos['download']}</link>
<description>$description</description>
<dc:creator>$author</dc:creator>
<pubDate>$pubDate</pubDate>$enclosure
<guid>$guid</guid>
</item>\n
ITEM;
}
}
$output .= <<< RSS_ENDS
</channel>
</rss>\n
RSS_ENDS;
if(!$static) {
$defaultMime = 'application/rss+xml';
$mimetype = (strpos($_SERVER['HTTP_ACCEPT'], $defaultMime) !== false) ? $defaultMime : 'application/xml';
header('Content-Type: '.$mimetype);
header('Content-Length: '.strlen($output));
echo $output;
} else {
file_put_contents($staticFilename, $output);
}
}
function exportXML($page, $static=false) {
if(!in_array($page, $GLOBALS['ALL_PAGES'])) { exit('Do you know Einstein ?'); }
$updated = checkCatalogue($page); // true if the catalog for this page is just updated
// Don't make a static file if not useful
$staticFilename = $page.'.xml';
if(!$updated and ($static and file_exists($staticFilename))) { return; }
$url_base = getBaseUrl1();
$repo_url = $url_base;
$repo_site = $url_base;
if($static) {
$repo_url .= $staticFilename;
$repo_site .= ($page == 'plugins') ? 'index' : $page;
$repo_site .= '.html';
} else {
$repo_url .= basename(__FILE__).'?xml';
$repo_site .= basename(__FILE__);
if($page != 'plugins') {
$repo_url .= "=$page";
$repo_site .= "?page=$page";
}
}
$repo_icon = '';
foreach(array('png', 'jpg', 'gif', 'jpeg') as $ext) {
$iconName = "icon.$ext";
if(is_readable($iconName)) {
$repo_icon = $url_base.$iconName;
}
}
$output = <<< BEGIN_XML
<?xml version="1.0" encoding="UTF-8"?>
<document>
BEGIN_XML;
/*
* // Désactivé pour assurer une certaine compatibilité avec l'existant
$title = SITE_TITLE;
$author = SITE_AUTHOR;
$name = SITE_OWNER;
$filename = WORKDIR.LAST_RELEASES."$page.json";
$version = "$page-".date('ymdHi', filemtime($filename));
$description = SITE_DESCRIPTION;
$output .= <<< XML_PLUS
<repo>
<repo_title>$title</repo_title>
<repo_author>$author</repo_author>
<repo_url>$repo_url</repo_url>
<repo_version_url>$url_base?lastUpdated</repo_version_url>
<repo_version>$version</repo_version>
<repo_site>$repo_site</repo_site>
<repo_description><![CDATA[$description]]></repo_description>
<repo_name>$name</repo_name>
<repo_icon>$repo_icon</repo_icon>
</repo>\n
XML_PLUS;
*/
$cache = getCatalog($page);
foreach($cache as $item=>$infos) {
foreach($infos['versions'] as $version=>$release) {
$filedate = substr($release['filedate'], 0, 10);
$filename = $url_base.$release['download'];
$name = basename($release['download']);
$site = (!empty($release['site'])) ? $release['site'] : '';
break;
}
$icon = (!empty($infos['img'])) ? $url_base.WORKDIR.ASSETS.$infos['img'] : '';
$output .= <<< PLUGIN
<plugin>
<title>$item</title>
<author>${release['author']}</author>
<version>$version</version>
<date>$filedate</date>
<site>$site</site>
<description><![CDATA[${release['description']}]]></description>
<name>$name</name>
<file>$filename</file>
<icon>$icon</icon>
</plugin>\n
PLUGIN;
}
$output .= <<< END_XML
</document>\n
END_XML;
if(!$static) {
header('Content-Type: text/xml');
header('Content-Length: '.strlen($output));
echo $output;
} else {
file_put_contents($staticFilename, $output);
}
}
function getRepoVersion($page) {
checkCatalogue($page);
$filename = WORKDIR.LAST_RELEASES."$page.json";
$content =
header('Content-Type: text/plain');
echo date('ymd', filemtime($filename))."\n\n";
}
function callbackRequest($page, $callback) {
if(empty($callback) or empty($page)) {
header('HTTP/1.0 400 bad request');
return;
}
checkCatalogue($page);
$filename = WORKDIR.LAST_RELEASES."$page.json";
if(file_exists($filename)) {
$hostname = ((isset($_SERVER['HTTPS']) and !empty($_SERVER['HTTPS'])) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'];
$url_base = preg_replace('@'.basename(__FILE__).'$@', '', htmlspecialchars($_SERVER['PHP_SELF']));
$title = SITE_TITLE;
$comments = <<< EOT
/* ----- $title's repository @ $hostname$url_base ----- */\n\n
EOT;
$output = $comments.$callback.'("'.addslashes(file_get_contents($filename)).'");';
header('Cache-Control: max-age=3600');
header('Content-Type: application/javascript; charset=utf-8');
echo $output;
exit;
} else {
header('HTTP/1.0 404 Not Found');
}
}
function download_source() {
$filename = 'repository3-'.VERSION.'.zip';
if(! file_exists($filename)) {
$zip = new ZipArchive();
if($zip->open($filename, ZipArchive::CREATE) === true) {
$description = SITE_DESCRIPTION;
$infos = <<< INFOS
<html lang="fr">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>$description</title>
</head>
<body>
<p>
<a href="http://www.kazimentou.fr/pluxml-plugins2/">Voir démo</a><br />
<a href="https://github.com/bazooka07/Pluxml-repository">Github</a>
</p>
</body>
</html>
INFOS;
$zip->addFromString('lisez-moi.html', $infos);
foreach(array(basename(__FILE__), 'demo.php', 'README.md', 'LICENSE.txt') as $entry) {
if(file_exists($entry)) {
$zip->addFile($entry);
}
}
$zip->close();
}
}
// echo 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'.$filename;
echo $filename;
}
function getLastRelease($page, $item) {
$cache = getCatalog($page);
if(array_key_exists($item, $cache)) {
$lastVersion = array_keys($cache[$item]['versions'])[0];
return $cache[$item]['versions'][$lastVersion];
}
return false;
}
/**
* Send an zip archive of plugin, theme, script.
* */
function cmd_download($page, $item) {
$lastRelease = getLastRelease($page, $item);
if(!empty($lastRelease)) {
$filename = $lastRelease['download'];
if(!file_exists($filename)) {
header('HTTP/1.0 404 Not Found');
exit;
}
$filesize = filesize($filename);
if($filesize < MAX_FILESIZE) {
header('Content-Type: application/zip');
header('Content-Length: ' . $filesize);
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
readfile($filename);
} else {
header('Status: 307 Temporary Redirect', false, 307);
header('Location: '.$filename);
}
} else {
header('HTTP/1.0 404 Not Found');
}
}
/**
* Send the content of the infos.xml file of the last version of an item.
* */
function cmd_infos($page, $item) {
$lastRelease = getLastRelease($page, $item);
if(!empty($lastRelease)) {
$filename = $lastRelease['download'];
if(!file_exists($filename)) {
header('HTTP/1.0 404 Not Found');
exit;
}
$zip = new ZipArchive();
if($res = $zip->open($lastRelease['download'])) {
if($infoFile = searchInfosFile($zip)) {
// send content of infos.xml
$result = $zip->getFromName($infoFile);
header('Content-Type: text/xml');
header('Content-Length: ' .strlen($result));
echo $result;
exit;
}
$zip->close();
} else {
header('HTTP/1.0 404 Not Found');
exit;
}
} else {
header('HTTP/1.0 404 Not Found');
}
}
/**
* Send an image : icon for plugin, preview for theme.
* */
function cmd_icon($page, $item) {
$cache = getCatalog($page);
if(array_key_exists($item, $cache)) {
$filename = $cache[$item]['img'];
if(!empty($filename)) {
header('Status: 307 Temporary Redirect', false, 307);
header('Location: '.$filename);
} else {
header('HTTP/1.0 404 Not Found');
header('Content-Type: text/plain');
echo "Icon not found for $item".singlePage($page)."\n\n";
}
} else {
header('HTTP/1.0 404 Not Found');
}
}
/**
* Crée les différents dossiers et installe les fichiers statiques (assets).
* */
function init() {
$folders = array_merge(
array(WORKDIR, WORKDIR.ASSETS, WORKDIR.LAST_RELEASES, ASSETS),
$GLOBALS['ALL_PAGES'],
array_map(function($item) { return WORKDIR.ASSETS."/$item"; }, $GLOBALS['ALL_PAGES'])
);
foreach($folders as $dir1) {
if(!is_dir($dir1) and !mkdir($dir1, 0755, true)) {
header('Content-Type: text/plain;charset=uft-8');
$dir1 = trim($dir1, '/');
printf("Unable to create %s/$dir1 folder.", __DIR__) ;
exit;
}
}
foreach(array(
'logo' => LOGO,
'default-icon' => DEFAULT_ICON,
'background' => BACKGROUND,
'rss' => RSS
) as $name=>$content) {
$filename = ASSETS.$name.'.png';
if(!file_exists($filename)) {
$fp = fopen($filename, 'wb');
fwrite($fp, base64_decode($content));
fclose($fp);
}
}
if(!file_exists(STYLESHEET_FILENAME) or filemtime(STYLESHEET_FILENAME) < filemtime(__FILE__)) {
file_put_contents(STYLESHEET_FILENAME, STYLESHEET);
}
// clean up caches for an update of this script
$lastUpdateProg = filemtime(__FILE__);
foreach(glob(WORKDIR.'/*.json') as $file1) {
if(file_exists($file1) and (filemtime($file1) < $lastUpdateProg))
unlink($file1);
}
}
/* ================== the core starts here =============== */
init();
header("Cache-Control: public");
/* ----------------- Parsing the parameters of the url --------------------- */
// One item is required
foreach($ALL_PAGES as $page) {
if(!isset($_GET[singlePage($page)])) {
continue;
}
$item = htmlspecialchars($_GET[singlePage($page)]);
if(!empty($item)) {
foreach(array('download', 'infos', 'icon') as $cmd) {
if(isset($_GET[$cmd])) {
$process = 'cmd_'.$cmd;
if(function_exists($process)) {
checkCatalogue($page);
$process($page, $item);
}
exit;
}
}
}
}
// working with catalogs
if(isset($_GET['callback'])) {
$callback = htmlspecialchars($_GET['callback']);
callbackRequest(getPage('cat'), $callback);
exit;
} else {
foreach(array(
'latest' => 'exportLatest',
'json' => 'exportJSON',
'rss' => 'exportRSS',
'lastUpdated' => 'getRepoVersion',
'xml' => 'exportXML'
) as $cmd=>$process) {
if(isset($_GET[$cmd])) {
$process(getPage($cmd));
exit;
}
}
}
// Go for displaying a HTML page
// if(!isset($_GET['all_versions']) and !isset($_GET['grille'])) {}
$page = getPage();
$updateStatic = checkCatalogue($page); // true if the catalog for this page is just updated
$cache = getCatalog($page, true);
$root = getBaseUrl1();
$displayAll = (isset($_GET['all_versions']));
$displayGrid = ($displayAll or isset($_GET['grille']));