create-prisma-php-app 1.11.7 → 1.11.8
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 +24 -6
- package/package.json +1 -1
- package/dist/.env +0 -0
package/dist/bootstrap.php
CHANGED
|
@@ -15,12 +15,9 @@ $dotenv->load();
|
|
|
15
15
|
|
|
16
16
|
function determineContentToInclude()
|
|
17
17
|
{
|
|
18
|
-
$
|
|
19
|
-
$
|
|
20
|
-
$
|
|
21
|
-
$requestUri = rtrim($requestUri, '/');
|
|
22
|
-
$requestUri = str_replace($dirname, '', $requestUri);
|
|
23
|
-
$uri = trim($requestUri, '/');
|
|
18
|
+
$scriptUrl = $_SERVER['REQUEST_URI'];
|
|
19
|
+
$scriptUrl = explode('?', $scriptUrl, 2)[0];
|
|
20
|
+
$uri = $_SERVER['SCRIPT_URL'] ?? uriExtractor($scriptUrl);
|
|
24
21
|
$baseDir = APP_PATH;
|
|
25
22
|
$includePath = '';
|
|
26
23
|
$layoutsToInclude = [];
|
|
@@ -69,6 +66,27 @@ function determineContentToInclude()
|
|
|
69
66
|
return ['path' => $includePath, 'layouts' => $layoutsToInclude, 'uri' => $uri];
|
|
70
67
|
}
|
|
71
68
|
|
|
69
|
+
function uriExtractor(string $scriptUrl): string
|
|
70
|
+
{
|
|
71
|
+
$prismaPHPSettings = json_decode(file_get_contents("prisma-php.json"), true);
|
|
72
|
+
$projectName = $prismaPHPSettings['projectName'] ?? '';
|
|
73
|
+
if (empty($projectName)) {
|
|
74
|
+
return "/";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
$escapedIdentifier = preg_quote($projectName, '/');
|
|
78
|
+
$pattern = "/(?:.*$escapedIdentifier)(\/.*)$/";
|
|
79
|
+
if (preg_match($pattern, $scriptUrl, $matches)) {
|
|
80
|
+
if (!empty($matches[1])) {
|
|
81
|
+
$leftTrim = ltrim($matches[1], '/');
|
|
82
|
+
$rightTrim = rtrim($leftTrim, '/');
|
|
83
|
+
return "$rightTrim";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return "/";
|
|
88
|
+
}
|
|
89
|
+
|
|
72
90
|
function checkForDuplicateRoutes()
|
|
73
91
|
{
|
|
74
92
|
$routes = json_decode(file_get_contents(SETTINGS_PATH . "/files-list.json"), true);
|
package/package.json
CHANGED
package/dist/.env
DELETED
|
File without changes
|