create-prisma-php-app 1.26.526 → 1.26.528
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 +34 -29
- package/dist/index.js +367 -366
- package/dist/src/Lib/MainLayout.php +6 -2
- package/dist/src/Lib/PHPX/IPHPX.php +6 -3
- package/dist/src/Lib/PHPX/PHPX.php +121 -0
- package/dist/src/Lib/PHPX/TemplateCompiler.php +59 -27
- package/dist/src/Lib/PHPX/TwMerge.php +214 -0
- package/dist/src/app/js/index.js +1 -1
- package/package.json +1 -1
- package/dist/src/Lib/PHPX/Utils.php +0 -41
package/dist/bootstrap.php
CHANGED
|
@@ -706,49 +706,54 @@ register_shutdown_function(function () {
|
|
|
706
706
|
}
|
|
707
707
|
});
|
|
708
708
|
|
|
709
|
-
spl_autoload_register(
|
|
710
|
-
|
|
711
|
-
|
|
709
|
+
spl_autoload_register(
|
|
710
|
+
function ($class) {
|
|
711
|
+
// Path to the log file
|
|
712
|
+
$logFile = SETTINGS_PATH . "/class-log.json";
|
|
712
713
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
714
|
+
// Ensure the log file exists
|
|
715
|
+
if (!file_exists($logFile)) {
|
|
716
|
+
file_put_contents($logFile, json_encode([]));
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// Read the existing log data
|
|
720
|
+
$logData = json_decode(file_get_contents($logFile), true) ?? [];
|
|
718
721
|
|
|
719
|
-
|
|
720
|
-
|
|
722
|
+
// Determine the file path for the class
|
|
723
|
+
$classParts = explode('\\', $class);
|
|
724
|
+
$filePath = __DIR__ . '/src/' . implode('/', $classParts) . '.php';
|
|
721
725
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
726
|
+
// Attempt to load the file
|
|
727
|
+
if (file_exists($filePath)) {
|
|
728
|
+
// Track previously declared classes
|
|
729
|
+
$previousClasses = get_declared_classes();
|
|
725
730
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
require_once $filePath;
|
|
731
|
+
// Require the file
|
|
732
|
+
require_once $filePath;
|
|
729
733
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
+
// Find newly declared classes
|
|
735
|
+
$newClasses = array_diff(get_declared_classes(), $previousClasses);
|
|
736
|
+
|
|
737
|
+
// Process all new classes from the file
|
|
738
|
+
foreach ($newClasses as $newClass) {
|
|
739
|
+
$reflectionClass = new ReflectionClass($newClass);
|
|
734
740
|
|
|
735
|
-
// Ensure the class is in the same namespace as the loaded class
|
|
736
|
-
$classNamespace = implode('\\', $classParts);
|
|
737
|
-
if (strpos($declaredClass, $classNamespace) === 0) {
|
|
738
741
|
// Check if the class implements IPHPX
|
|
739
742
|
if ($reflectionClass->implementsInterface(IPHPX::class)) {
|
|
740
|
-
$logData[$
|
|
741
|
-
'class_name' => $
|
|
743
|
+
$logData[$newClass] = [
|
|
744
|
+
'class_name' => $newClass,
|
|
742
745
|
'file_path' => $filePath,
|
|
743
746
|
];
|
|
744
747
|
}
|
|
745
748
|
}
|
|
746
749
|
}
|
|
747
|
-
}
|
|
748
750
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
},
|
|
751
|
+
// Save back to the JSON file
|
|
752
|
+
file_put_contents($logFile, json_encode($logData, JSON_PRETTY_PRINT));
|
|
753
|
+
},
|
|
754
|
+
true,
|
|
755
|
+
true
|
|
756
|
+
);
|
|
752
757
|
|
|
753
758
|
try {
|
|
754
759
|
$_determineContentToInclude = determineContentToInclude();
|