create-prisma-php-app 1.20.4 → 1.20.501
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 +38 -1
- package/dist/index.js +1111 -1
- package/dist/prisma-php.js +63 -1
- package/dist/settings/public-functions.php +26 -0
- package/dist/settings/request-methods.php +1 -0
- package/dist/settings/start-dev.js +132 -0
- package/dist/settings/swagger-setup.js +54 -0
- package/dist/src/app/swagger-docs/apis/pphp-swagger.json +259 -0
- package/dist/src/app/swagger-docs/apis/users.js +180 -0
- package/dist/src/app/swagger-docs/dist/favicon-16x16.png +0 -0
- package/dist/src/app/swagger-docs/dist/favicon-32x32.png +0 -0
- package/dist/src/app/swagger-docs/dist/index.css +16 -0
- package/dist/src/app/swagger-docs/dist/index.html +19 -0
- package/dist/src/app/swagger-docs/dist/oauth2-redirect.html +79 -0
- package/dist/src/app/swagger-docs/dist/swagger-initializer.js +36 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-bundle.js +2 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-bundle.js.map +1 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-es-bundle-core.js +3 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-es-bundle-core.js.map +1 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-es-bundle.js +2 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-es-bundle.js.map +1 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-standalone-preset.js +2 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui-standalone-preset.js.map +1 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui.css +3 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui.css.map +1 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui.js +2 -0
- package/dist/src/app/swagger-docs/dist/swagger-ui.js.map +1 -0
- package/dist/src/app/swagger-docs/index.php +4 -0
- package/dist/src/app/swagger-docs-layout.php +17 -0
- package/package.json +1 -1
package/dist/bootstrap.php
CHANGED
|
@@ -173,7 +173,7 @@ function writeRoutes()
|
|
|
173
173
|
|
|
174
174
|
$jsonData = json_encode($filesList, JSON_PRETTY_PRINT);
|
|
175
175
|
$jsonFileName = SETTINGS_PATH . '/files-list.json';
|
|
176
|
-
|
|
176
|
+
file_put_contents($jsonFileName, $jsonData);
|
|
177
177
|
|
|
178
178
|
if (file_exists($jsonFileName)) {
|
|
179
179
|
$_filesListRoutes = json_decode(file_get_contents($jsonFileName), true);
|
|
@@ -596,6 +596,43 @@ try {
|
|
|
596
596
|
$_layoutsToInclude = $_determineContentToInclude['layouts'] ?? [];
|
|
597
597
|
$uri = $_determineContentToInclude['uri'] ?? '';
|
|
598
598
|
$pathname = $uri ? "/" . $uri : "/";
|
|
599
|
+
|
|
600
|
+
if (empty($_contentToInclude)) {
|
|
601
|
+
if (!$isXFilRequest) {
|
|
602
|
+
// Set the header and output a JSON response for permission denied
|
|
603
|
+
header('Content-Type: application/json');
|
|
604
|
+
echo json_encode([
|
|
605
|
+
'success' => false,
|
|
606
|
+
'error' => 'Permission denied'
|
|
607
|
+
]);
|
|
608
|
+
http_response_code(403); // Set HTTP status code to 403 Forbidden
|
|
609
|
+
exit;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
$filePath = APP_PATH . '/' . $uri;
|
|
613
|
+
if (file_exists($filePath)) {
|
|
614
|
+
// Check if the file is a PHP file
|
|
615
|
+
if (pathinfo($filePath, PATHINFO_EXTENSION) === 'php') {
|
|
616
|
+
// Include the PHP file without setting the JSON header
|
|
617
|
+
include $filePath;
|
|
618
|
+
} else {
|
|
619
|
+
// Set the appropriate content-type for non-PHP files if needed
|
|
620
|
+
// and read the content
|
|
621
|
+
header('Content-Type: ' . mime_content_type($filePath)); // Dynamic content type
|
|
622
|
+
readfile($filePath);
|
|
623
|
+
}
|
|
624
|
+
} else {
|
|
625
|
+
// Set the header and output a JSON response for file not found
|
|
626
|
+
header('Content-Type: application/json');
|
|
627
|
+
echo json_encode([
|
|
628
|
+
'success' => false,
|
|
629
|
+
'error' => 'File not found'
|
|
630
|
+
]);
|
|
631
|
+
http_response_code(404); // Set HTTP status code to 404 Not Found
|
|
632
|
+
}
|
|
633
|
+
exit;
|
|
634
|
+
}
|
|
635
|
+
|
|
599
636
|
if (!empty($_contentToInclude) && basename($_contentToInclude) === 'route.php') {
|
|
600
637
|
header('Content-Type: application/json');
|
|
601
638
|
require_once $_contentToInclude;
|