+3
-2
composer.json
+3
-2
composer.json
+279
-110
composer.lock
+279
-110
composer.lock
···
4
4
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
5
"This file is @generated automatically"
6
6
],
7
-
"content-hash": "b31aa5345c626611d27ce253c4630358",
7
+
"content-hash": "3544e45e7955fe5fbbfa0487876eae71",
8
8
"packages": [
9
9
{
10
10
"name": "altorouter/altorouter",
11
-
"version": "2.0.2",
11
+
"version": "2.0.3",
12
12
"source": {
13
13
"type": "git",
14
14
"url": "https://github.com/dannyvankooten/AltoRouter.git",
15
-
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2"
15
+
"reference": "9931b976423f7334c94f7b5b348be8ab1da3415d"
16
16
},
17
17
"dist": {
18
18
"type": "zip",
19
-
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
20
-
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
19
+
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/9931b976423f7334c94f7b5b348be8ab1da3415d",
20
+
"reference": "9931b976423f7334c94f7b5b348be8ab1da3415d",
21
21
"shasum": ""
22
22
},
23
23
"require": {
24
-
"php": ">=5.6.0"
24
+
"php": ">=7.3"
25
25
},
26
26
"require-dev": {
27
-
"codeclimate/php-test-reporter": "dev-master",
28
-
"phpunit/phpunit": "5.7.*",
29
-
"squizlabs/php_codesniffer": "3.4.2"
27
+
"phpunit/phpunit": "9.6.*",
28
+
"squizlabs/php_codesniffer": "3.6.2"
30
29
},
31
30
"type": "library",
32
31
"autoload": {
···
61
60
"routing"
62
61
],
63
62
"support": {
64
-
"issues": "https://github.com/dannyvankooten/AltoRouter/issues",
65
-
"source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.2"
63
+
"source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.3"
66
64
},
67
-
"time": "2020-03-09T08:34:59+00:00"
65
+
"time": "2025-01-05T20:33:28+00:00"
68
66
},
69
67
{
70
68
"name": "carbonphp/carbon-doctrine-types",
···
135
133
],
136
134
"time": "2024-02-09T16:56:22+00:00"
137
135
},
138
-
{
139
-
"name": "michelf/php-markdown",
140
-
"version": "2.0.0",
141
-
"source": {
142
-
"type": "git",
143
-
"url": "https://github.com/michelf/php-markdown.git",
144
-
"reference": "eb176f173fbac58a045aff78e55f833264b34e71"
145
-
},
146
-
"dist": {
147
-
"type": "zip",
148
-
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/eb176f173fbac58a045aff78e55f833264b34e71",
149
-
"reference": "eb176f173fbac58a045aff78e55f833264b34e71",
150
-
"shasum": ""
151
-
},
152
-
"require": {
153
-
"php": ">=7.4"
154
-
},
155
-
"require-dev": {
156
-
"friendsofphp/php-cs-fixer": "^3.0",
157
-
"phpstan/phpstan": ">=1.0",
158
-
"phpstan/phpstan-phpunit": ">=1.0",
159
-
"phpunit/phpunit": "^9.5"
160
-
},
161
-
"type": "library",
162
-
"autoload": {
163
-
"psr-4": {
164
-
"Michelf\\": "Michelf/"
165
-
}
166
-
},
167
-
"notification-url": "https://packagist.org/downloads/",
168
-
"license": [
169
-
"BSD-3-Clause"
170
-
],
171
-
"authors": [
172
-
{
173
-
"name": "Michel Fortin",
174
-
"email": "michel.fortin@michelf.ca",
175
-
"homepage": "https://michelf.ca/",
176
-
"role": "Developer"
177
-
},
178
-
{
179
-
"name": "John Gruber",
180
-
"homepage": "https://daringfireball.net/"
181
-
}
182
-
],
183
-
"description": "PHP Markdown",
184
-
"homepage": "https://michelf.ca/projects/php-markdown/",
185
-
"keywords": [
186
-
"markdown"
187
-
],
188
-
"support": {
189
-
"issues": "https://github.com/michelf/php-markdown/issues",
190
-
"source": "https://github.com/michelf/php-markdown/tree/2.0.0"
191
-
},
192
-
"time": "2022-09-26T12:21:08+00:00"
193
-
},
194
136
{
195
137
"name": "nesbot/carbon",
196
-
"version": "3.8.0",
138
+
"version": "3.8.6",
197
139
"source": {
198
140
"type": "git",
199
-
"url": "https://github.com/briannesbitt/Carbon.git",
200
-
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f"
141
+
"url": "https://github.com/CarbonPHP/carbon.git",
142
+
"reference": "ff2f20cf83bd4d503720632ce8a426dc747bf7fd"
201
143
},
202
144
"dist": {
203
145
"type": "zip",
204
-
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
205
-
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
146
+
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/ff2f20cf83bd4d503720632ce8a426dc747bf7fd",
147
+
"reference": "ff2f20cf83bd4d503720632ce8a426dc747bf7fd",
206
148
"shasum": ""
207
149
},
208
150
"require": {
209
-
"carbonphp/carbon-doctrine-types": "*",
151
+
"carbonphp/carbon-doctrine-types": "<100.0",
210
152
"ext-json": "*",
211
153
"php": "^8.1",
212
154
"psr/clock": "^1.0",
···
234
176
],
235
177
"type": "library",
236
178
"extra": {
237
-
"branch-alias": {
238
-
"dev-master": "3.x-dev",
239
-
"dev-2.x": "2.x-dev"
240
-
},
241
179
"laravel": {
242
180
"providers": [
243
181
"Carbon\\Laravel\\ServiceProvider"
···
247
185
"includes": [
248
186
"extension.neon"
249
187
]
188
+
},
189
+
"branch-alias": {
190
+
"dev-2.x": "2.x-dev",
191
+
"dev-master": "3.x-dev"
250
192
}
251
193
},
252
194
"autoload": {
···
278
220
],
279
221
"support": {
280
222
"docs": "https://carbon.nesbot.com/docs",
281
-
"issues": "https://github.com/briannesbitt/Carbon/issues",
282
-
"source": "https://github.com/briannesbitt/Carbon"
223
+
"issues": "https://github.com/CarbonPHP/carbon/issues",
224
+
"source": "https://github.com/CarbonPHP/carbon"
283
225
},
284
226
"funding": [
285
227
{
···
295
237
"type": "tidelift"
296
238
}
297
239
],
298
-
"time": "2024-08-19T06:22:39+00:00"
240
+
"time": "2025-02-20T17:33:38+00:00"
299
241
},
300
242
{
301
243
"name": "psr/clock",
···
347
289
},
348
290
{
349
291
"name": "symfony/clock",
350
-
"version": "v7.1.1",
292
+
"version": "v7.2.0",
351
293
"source": {
352
294
"type": "git",
353
295
"url": "https://github.com/symfony/clock.git",
354
-
"reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7"
296
+
"reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24"
355
297
},
356
298
"dist": {
357
299
"type": "zip",
358
-
"url": "https://api.github.com/repos/symfony/clock/zipball/3dfc8b084853586de51dd1441c6242c76a28cbe7",
359
-
"reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7",
300
+
"url": "https://api.github.com/repos/symfony/clock/zipball/b81435fbd6648ea425d1ee96a2d8e68f4ceacd24",
301
+
"reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24",
360
302
"shasum": ""
361
303
},
362
304
"require": {
···
401
343
"time"
402
344
],
403
345
"support": {
404
-
"source": "https://github.com/symfony/clock/tree/v7.1.1"
346
+
"source": "https://github.com/symfony/clock/tree/v7.2.0"
347
+
},
348
+
"funding": [
349
+
{
350
+
"url": "https://symfony.com/sponsor",
351
+
"type": "custom"
352
+
},
353
+
{
354
+
"url": "https://github.com/fabpot",
355
+
"type": "github"
356
+
},
357
+
{
358
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
359
+
"type": "tidelift"
360
+
}
361
+
],
362
+
"time": "2024-09-25T14:21:43+00:00"
363
+
},
364
+
{
365
+
"name": "symfony/deprecation-contracts",
366
+
"version": "v3.5.1",
367
+
"source": {
368
+
"type": "git",
369
+
"url": "https://github.com/symfony/deprecation-contracts.git",
370
+
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
371
+
},
372
+
"dist": {
373
+
"type": "zip",
374
+
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
375
+
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
376
+
"shasum": ""
377
+
},
378
+
"require": {
379
+
"php": ">=8.1"
380
+
},
381
+
"type": "library",
382
+
"extra": {
383
+
"thanks": {
384
+
"url": "https://github.com/symfony/contracts",
385
+
"name": "symfony/contracts"
386
+
},
387
+
"branch-alias": {
388
+
"dev-main": "3.5-dev"
389
+
}
390
+
},
391
+
"autoload": {
392
+
"files": [
393
+
"function.php"
394
+
]
395
+
},
396
+
"notification-url": "https://packagist.org/downloads/",
397
+
"license": [
398
+
"MIT"
399
+
],
400
+
"authors": [
401
+
{
402
+
"name": "Nicolas Grekas",
403
+
"email": "p@tchwork.com"
404
+
},
405
+
{
406
+
"name": "Symfony Community",
407
+
"homepage": "https://symfony.com/contributors"
408
+
}
409
+
],
410
+
"description": "A generic function and convention to trigger deprecation notices",
411
+
"homepage": "https://symfony.com",
412
+
"support": {
413
+
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
414
+
},
415
+
"funding": [
416
+
{
417
+
"url": "https://symfony.com/sponsor",
418
+
"type": "custom"
419
+
},
420
+
{
421
+
"url": "https://github.com/fabpot",
422
+
"type": "github"
423
+
},
424
+
{
425
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
426
+
"type": "tidelift"
427
+
}
428
+
],
429
+
"time": "2024-09-25T14:20:29+00:00"
430
+
},
431
+
{
432
+
"name": "symfony/http-foundation",
433
+
"version": "v7.2.3",
434
+
"source": {
435
+
"type": "git",
436
+
"url": "https://github.com/symfony/http-foundation.git",
437
+
"reference": "ee1b504b8926198be89d05e5b6fc4c3810c090f0"
438
+
},
439
+
"dist": {
440
+
"type": "zip",
441
+
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/ee1b504b8926198be89d05e5b6fc4c3810c090f0",
442
+
"reference": "ee1b504b8926198be89d05e5b6fc4c3810c090f0",
443
+
"shasum": ""
444
+
},
445
+
"require": {
446
+
"php": ">=8.2",
447
+
"symfony/deprecation-contracts": "^2.5|^3.0",
448
+
"symfony/polyfill-mbstring": "~1.1",
449
+
"symfony/polyfill-php83": "^1.27"
450
+
},
451
+
"conflict": {
452
+
"doctrine/dbal": "<3.6",
453
+
"symfony/cache": "<6.4.12|>=7.0,<7.1.5"
454
+
},
455
+
"require-dev": {
456
+
"doctrine/dbal": "^3.6|^4",
457
+
"predis/predis": "^1.1|^2.0",
458
+
"symfony/cache": "^6.4.12|^7.1.5",
459
+
"symfony/dependency-injection": "^6.4|^7.0",
460
+
"symfony/expression-language": "^6.4|^7.0",
461
+
"symfony/http-kernel": "^6.4|^7.0",
462
+
"symfony/mime": "^6.4|^7.0",
463
+
"symfony/rate-limiter": "^6.4|^7.0"
464
+
},
465
+
"type": "library",
466
+
"autoload": {
467
+
"psr-4": {
468
+
"Symfony\\Component\\HttpFoundation\\": ""
469
+
},
470
+
"exclude-from-classmap": [
471
+
"/Tests/"
472
+
]
473
+
},
474
+
"notification-url": "https://packagist.org/downloads/",
475
+
"license": [
476
+
"MIT"
477
+
],
478
+
"authors": [
479
+
{
480
+
"name": "Fabien Potencier",
481
+
"email": "fabien@symfony.com"
482
+
},
483
+
{
484
+
"name": "Symfony Community",
485
+
"homepage": "https://symfony.com/contributors"
486
+
}
487
+
],
488
+
"description": "Defines an object-oriented layer for the HTTP specification",
489
+
"homepage": "https://symfony.com",
490
+
"support": {
491
+
"source": "https://github.com/symfony/http-foundation/tree/v7.2.3"
405
492
},
406
493
"funding": [
407
494
{
···
417
504
"type": "tidelift"
418
505
}
419
506
],
420
-
"time": "2024-05-31T14:57:53+00:00"
507
+
"time": "2025-01-17T10:56:55+00:00"
421
508
},
422
509
{
423
510
"name": "symfony/polyfill-mbstring",
···
445
532
"type": "library",
446
533
"extra": {
447
534
"thanks": {
448
-
"name": "symfony/polyfill",
449
-
"url": "https://github.com/symfony/polyfill"
535
+
"url": "https://github.com/symfony/polyfill",
536
+
"name": "symfony/polyfill"
450
537
}
451
538
},
452
539
"autoload": {
···
519
606
"type": "library",
520
607
"extra": {
521
608
"thanks": {
522
-
"name": "symfony/polyfill",
523
-
"url": "https://github.com/symfony/polyfill"
609
+
"url": "https://github.com/symfony/polyfill",
610
+
"name": "symfony/polyfill"
524
611
}
525
612
},
526
613
"autoload": {
···
575
662
],
576
663
"time": "2024-09-09T11:45:10+00:00"
577
664
},
665
+
{
666
+
"name": "symfony/routing",
667
+
"version": "v7.2.3",
668
+
"source": {
669
+
"type": "git",
670
+
"url": "https://github.com/symfony/routing.git",
671
+
"reference": "ee9a67edc6baa33e5fae662f94f91fd262930996"
672
+
},
673
+
"dist": {
674
+
"type": "zip",
675
+
"url": "https://api.github.com/repos/symfony/routing/zipball/ee9a67edc6baa33e5fae662f94f91fd262930996",
676
+
"reference": "ee9a67edc6baa33e5fae662f94f91fd262930996",
677
+
"shasum": ""
678
+
},
679
+
"require": {
680
+
"php": ">=8.2",
681
+
"symfony/deprecation-contracts": "^2.5|^3"
682
+
},
683
+
"conflict": {
684
+
"symfony/config": "<6.4",
685
+
"symfony/dependency-injection": "<6.4",
686
+
"symfony/yaml": "<6.4"
687
+
},
688
+
"require-dev": {
689
+
"psr/log": "^1|^2|^3",
690
+
"symfony/config": "^6.4|^7.0",
691
+
"symfony/dependency-injection": "^6.4|^7.0",
692
+
"symfony/expression-language": "^6.4|^7.0",
693
+
"symfony/http-foundation": "^6.4|^7.0",
694
+
"symfony/yaml": "^6.4|^7.0"
695
+
},
696
+
"type": "library",
697
+
"autoload": {
698
+
"psr-4": {
699
+
"Symfony\\Component\\Routing\\": ""
700
+
},
701
+
"exclude-from-classmap": [
702
+
"/Tests/"
703
+
]
704
+
},
705
+
"notification-url": "https://packagist.org/downloads/",
706
+
"license": [
707
+
"MIT"
708
+
],
709
+
"authors": [
710
+
{
711
+
"name": "Fabien Potencier",
712
+
"email": "fabien@symfony.com"
713
+
},
714
+
{
715
+
"name": "Symfony Community",
716
+
"homepage": "https://symfony.com/contributors"
717
+
}
718
+
],
719
+
"description": "Maps an HTTP request to a set of configuration variables",
720
+
"homepage": "https://symfony.com",
721
+
"keywords": [
722
+
"router",
723
+
"routing",
724
+
"uri",
725
+
"url"
726
+
],
727
+
"support": {
728
+
"source": "https://github.com/symfony/routing/tree/v7.2.3"
729
+
},
730
+
"funding": [
731
+
{
732
+
"url": "https://symfony.com/sponsor",
733
+
"type": "custom"
734
+
},
735
+
{
736
+
"url": "https://github.com/fabpot",
737
+
"type": "github"
738
+
},
739
+
{
740
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
741
+
"type": "tidelift"
742
+
}
743
+
],
744
+
"time": "2025-01-17T10:56:55+00:00"
745
+
},
578
746
{
579
747
"name": "symfony/translation",
580
-
"version": "v7.1.5",
748
+
"version": "v7.2.4",
581
749
"source": {
582
750
"type": "git",
583
751
"url": "https://github.com/symfony/translation.git",
584
-
"reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea"
752
+
"reference": "283856e6981286cc0d800b53bd5703e8e363f05a"
585
753
},
586
754
"dist": {
587
755
"type": "zip",
588
-
"url": "https://api.github.com/repos/symfony/translation/zipball/235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
589
-
"reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
756
+
"url": "https://api.github.com/repos/symfony/translation/zipball/283856e6981286cc0d800b53bd5703e8e363f05a",
757
+
"reference": "283856e6981286cc0d800b53bd5703e8e363f05a",
590
758
"shasum": ""
591
759
},
592
760
"require": {
593
761
"php": ">=8.2",
762
+
"symfony/deprecation-contracts": "^2.5|^3",
594
763
"symfony/polyfill-mbstring": "~1.0",
595
764
"symfony/translation-contracts": "^2.5|^3.0"
596
765
},
···
651
820
"description": "Provides tools to internationalize your application",
652
821
"homepage": "https://symfony.com",
653
822
"support": {
654
-
"source": "https://github.com/symfony/translation/tree/v7.1.5"
823
+
"source": "https://github.com/symfony/translation/tree/v7.2.4"
655
824
},
656
825
"funding": [
657
826
{
···
667
836
"type": "tidelift"
668
837
}
669
838
],
670
-
"time": "2024-09-16T06:30:38+00:00"
839
+
"time": "2025-02-13T10:27:23+00:00"
671
840
},
672
841
{
673
842
"name": "symfony/translation-contracts",
674
-
"version": "v3.5.0",
843
+
"version": "v3.5.1",
675
844
"source": {
676
845
"type": "git",
677
846
"url": "https://github.com/symfony/translation-contracts.git",
678
-
"reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a"
847
+
"reference": "4667ff3bd513750603a09c8dedbea942487fb07c"
679
848
},
680
849
"dist": {
681
850
"type": "zip",
682
-
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a",
683
-
"reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a",
851
+
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c",
852
+
"reference": "4667ff3bd513750603a09c8dedbea942487fb07c",
684
853
"shasum": ""
685
854
},
686
855
"require": {
···
688
857
},
689
858
"type": "library",
690
859
"extra": {
860
+
"thanks": {
861
+
"url": "https://github.com/symfony/contracts",
862
+
"name": "symfony/contracts"
863
+
},
691
864
"branch-alias": {
692
865
"dev-main": "3.5-dev"
693
-
},
694
-
"thanks": {
695
-
"name": "symfony/contracts",
696
-
"url": "https://github.com/symfony/contracts"
697
866
}
698
867
},
699
868
"autoload": {
···
729
898
"standards"
730
899
],
731
900
"support": {
732
-
"source": "https://github.com/symfony/translation-contracts/tree/v3.5.0"
901
+
"source": "https://github.com/symfony/translation-contracts/tree/v3.5.1"
733
902
},
734
903
"funding": [
735
904
{
···
745
914
"type": "tidelift"
746
915
}
747
916
],
748
-
"time": "2024-04-18T09:32:20+00:00"
917
+
"time": "2024-09-25T14:20:29+00:00"
749
918
}
750
919
],
751
920
"packages-dev": [],
752
921
"aliases": [],
753
922
"minimum-stability": "stable",
754
-
"stability-flags": [],
923
+
"stability-flags": {},
755
924
"prefer-stable": false,
756
925
"prefer-lowest": false,
757
-
"platform": [],
758
-
"platform-dev": [],
926
+
"platform": {},
927
+
"platform-dev": {},
759
928
"plugin-api-version": "2.6.0"
760
929
}
+54
-22
index.php
+54
-22
index.php
···
2
2
3
3
declare(strict_types=1);
4
4
5
+
use Symfony\Component\HttpFoundation\Request;
6
+
use Symfony\Component\HttpFoundation\Response;
7
+
use Symfony\Component\Routing;
8
+
use Symfony\Component\Routing\Route;
9
+
use Symfony\Component\Routing\RouteCollection;
10
+
5
11
require_once 'vendor/autoload.php';
6
12
require_once 'posts/post-list.php';
7
13
8
-
global $router;
14
+
9
15
10
16
function fragment(string $name): void
11
17
{
12
18
require_once __DIR__ . '/routes/fragments/' . $name . '.php';
13
19
}
14
20
15
-
$router = new AltoRouter();
21
+
$routes = new RouteCollection();
22
+
23
+
//$router = new AltoRouter();
16
24
17
25
/**
18
26
* This can be useful if you're using PHP's built-in web server, to serve files like images or css
···
22
30
return;
23
31
}
24
32
25
-
try {
26
-
$router->map('GET', '/', 'routes/home.php', "index");
27
-
$router->map('GET', '/blog', 'routes/blog-index.php', "blog-index");
28
-
$router->map('GET', '/blog/[*:post_slug]', 'routes/blog-post.php', "blog-post");
29
-
$router->map('GET', '/contact', 'routes/contact.php', "contact");
30
-
$router->map('GET', '/projects', 'routes/projects.php', "projects");
31
-
$router->map('GET', '/friends', 'routes/88x31-wall.php', "friends");
32
-
$router->map('GET', '/feed[.xml]?', 'routes/feed.php', "feed");
33
-
} catch (Exception $e) {
34
-
echo $e;
35
-
}
33
+
$request = Request::createFromGlobals();
34
+
35
+
$routes->add("home", new Route('/') );
36
+
$routes->add("blog-index", new Route('/blog') );
37
+
$routes->add("blog-post", new Route('/blog/{post_slug}', ['post_slug' => '404']) );
38
+
$routes->add("contact", new Route('/contact') );
39
+
$routes->add("projects", new Route('/projects') );
40
+
$routes->add("friends", new Route('/friends') );
41
+
$routes->add("feed", new Route('/feed{_format}', requirements: ['_format' => '|.xml']) );
42
+
43
+
//$router->map('GET', '/blog', 'routes/blog-index.php', "blog-index");
44
+
//$router->map('GET', '/blog/[*:post_slug]', 'routes/blog-post.php', "blog-post");
45
+
//$router->map('GET', '/contact', 'routes/contact.php', "contact");
46
+
//$router->map('GET', '/projects', 'routes/projects.php', "projects");
47
+
//$router->map('GET', '/friends', 'routes/88x31-wall.php', "friends");
48
+
//$router->map('GET', '/feed[.xml]?', 'routes/feed.php', "feed");
36
49
37
50
// Match the current request
38
-
$match = $router->match(urldecode($_SERVER['REQUEST_URI']));
39
-
if ($match) {
40
-
foreach ($match['params'] as &$param) {
41
-
${key($match['params'])} = $param;
42
-
}
43
-
require_once $match['target'];
44
-
} else {
45
-
http_response_code(404);
46
-
exit('Page not found');
51
+
//$match = $router->match(urldecode($_SERVER['REQUEST_URI']));
52
+
//if ($match) {
53
+
// foreach ($match['params'] as &$param) {
54
+
// ${key($match['params'])} = $param;
55
+
// }
56
+
// require_once $match['target'];
57
+
//} else {
58
+
// http_response_code(404);
59
+
// exit('Page not found');
60
+
//}
61
+
62
+
$context = new Routing\RequestContext();
63
+
$context->fromRequest($request);
64
+
$matcher = new Routing\Matcher\UrlMatcher($routes, $context);
65
+
66
+
67
+
try {
68
+
extract($matcher->match($request->getPathInfo()), EXTR_SKIP);
69
+
ob_start();
70
+
include sprintf(__DIR__.'/routes/%s.php', $_route);
71
+
72
+
$response = new Response(ob_get_clean());
73
+
} catch (Routing\Exception\ResourceNotFoundException $exception) {
74
+
$response = new Response('Not Found', 404);
75
+
} catch (Exception $exception) {
76
+
$response = new Response('An error occurred', 500);
47
77
}
78
+
79
+
$response->send();
static/bsky-comments.js
static/bsky-comments.js