create-prisma-php-app 1.26.524 → 1.26.525
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.php +14 -7
- package/dist/src/app/index.php +2 -2
- package/package.json +1 -1
package/dist/bootstrap.php
CHANGED
|
@@ -15,6 +15,7 @@ use Lib\Middleware\AuthMiddleware;
|
|
|
15
15
|
use Lib\Auth\Auth;
|
|
16
16
|
use Lib\MainLayout;
|
|
17
17
|
use Lib\PHPX\TemplateCompiler;
|
|
18
|
+
use Lib\PHPX\IPHPX;
|
|
18
19
|
|
|
19
20
|
$dotenv = Dotenv::createImmutable(\DOCUMENT_PATH);
|
|
20
21
|
$dotenv->load();
|
|
@@ -715,7 +716,7 @@ spl_autoload_register(function ($class) {
|
|
|
715
716
|
file_put_contents($logFile, json_encode([]));
|
|
716
717
|
}
|
|
717
718
|
|
|
718
|
-
// Read the current log data
|
|
719
|
+
// Read the current log data
|
|
719
720
|
$logData = json_decode(file_get_contents($logFile), true) ?? [];
|
|
720
721
|
|
|
721
722
|
// Attempt to load the class file and get the file path
|
|
@@ -726,15 +727,21 @@ spl_autoload_register(function ($class) {
|
|
|
726
727
|
if (file_exists($filePath)) {
|
|
727
728
|
require_once $filePath;
|
|
728
729
|
|
|
729
|
-
//
|
|
730
|
+
// After loading the file, check all declared classes
|
|
730
731
|
$declaredClasses = get_declared_classes();
|
|
731
732
|
foreach ($declaredClasses as $declaredClass) {
|
|
733
|
+
$reflectionClass = new ReflectionClass($declaredClass);
|
|
734
|
+
|
|
735
|
+
// Ensure the class is in the same namespace as the loaded class
|
|
732
736
|
$classNamespace = implode('\\', $classParts);
|
|
733
|
-
if (strpos($declaredClass, $classNamespace)
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
737
|
+
if (strpos($declaredClass, $classNamespace) === 0) {
|
|
738
|
+
// Check if the class implements IPHPX
|
|
739
|
+
if ($reflectionClass->implementsInterface(IPHPX::class)) {
|
|
740
|
+
$logData[$declaredClass] = [
|
|
741
|
+
'class_name' => $declaredClass,
|
|
742
|
+
'file_path' => $filePath,
|
|
743
|
+
];
|
|
744
|
+
}
|
|
738
745
|
}
|
|
739
746
|
}
|
|
740
747
|
}
|
package/dist/src/app/index.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="flex flex-col min-h-[100vh] bg-gradient-to-b from-[#a1b8c2] to-white dark:from-[#334455] dark:to-black">
|
|
4
4
|
<header class="px-4 lg:px-6 h-14 flex items-center">
|
|
5
5
|
<a class="flex items-center justify-center" href="/">
|
|
6
|
-
<img class="size-9" src="<?= Request::baseUrl ?>/assets/images/prisma-php.svg" alt="Prisma PHP"
|
|
6
|
+
<img class="size-9" src="<?= Request::baseUrl ?>/assets/images/prisma-php.svg" alt="Prisma PHP" />
|
|
7
7
|
<span class="sr-only">Prisma PHP</span>
|
|
8
8
|
</a>
|
|
9
9
|
<nav class="ml-auto flex gap-4 sm:gap-6">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<div class="px-4 md:px-6">
|
|
27
27
|
<div class="flex flex-col items-center space-y-4 text-center">
|
|
28
28
|
<h1 class="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl/none flex items-center gap-3 justify-center">
|
|
29
|
-
Welcome to Prisma PHP <img class="size-20 hidden sm:block" src="<?= Request::baseUrl ?>/assets/images/prisma-php.svg" alt="Prisma PHP"
|
|
29
|
+
Welcome to Prisma PHP <img class="size-20 hidden sm:block" src="<?= Request::baseUrl ?>/assets/images/prisma-php.svg" alt="Prisma PHP" />
|
|
30
30
|
</h1>
|
|
31
31
|
<p class="mx-auto max-w-[700px] text-gray-500 md:text-xl dark:text-gray-400">
|
|
32
32
|
Your Next Generation PHP Framework
|