create-prisma-php-app 1.8.18 → 1.8.20
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 +16 -15
- package/dist/src/app/index.php +0 -1
- package/package.json +1 -1
package/dist/bootstrap.php
CHANGED
|
@@ -190,16 +190,12 @@ $pathname = "";
|
|
|
190
190
|
|
|
191
191
|
ob_start();
|
|
192
192
|
|
|
193
|
-
set_error_handler(function ($severity, $message, $file, $line) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
set_exception_handler(function ($exception) {
|
|
198
|
-
echo "<div class='error'>An error occurred: " . $exception->getMessage() . "</div>";
|
|
193
|
+
set_error_handler(function ($severity, $message, $file, $line) use (&$content) {
|
|
194
|
+
echo "<div class='error'>An error occurred: $severity - $message in $file on line $line</div>";
|
|
195
|
+
$content .= ob_get_clean();
|
|
199
196
|
});
|
|
200
197
|
|
|
201
198
|
set_exception_handler(function ($exception) use (&$content) {
|
|
202
|
-
ob_start();
|
|
203
199
|
echo "<div class='error'>An error occurred: " . htmlspecialchars($exception->getMessage(), ENT_QUOTES, 'UTF-8') . "</div>";
|
|
204
200
|
$content .= ob_get_clean();
|
|
205
201
|
});
|
|
@@ -207,12 +203,8 @@ set_exception_handler(function ($exception) use (&$content) {
|
|
|
207
203
|
register_shutdown_function(function () use (&$content) {
|
|
208
204
|
$error = error_get_last();
|
|
209
205
|
if ($error && ($error['type'] === E_ERROR || $error['type'] === E_PARSE || $error['type'] === E_CORE_ERROR || $error['type'] === E_COMPILE_ERROR)) {
|
|
210
|
-
ob_start();
|
|
211
206
|
echo "<div class='error'>An error occurred: " . $error['message'] . "</div>";
|
|
212
|
-
$
|
|
213
|
-
$content = $errorContent . $content;
|
|
214
|
-
ob_clean();
|
|
215
|
-
echo "<html><body>{$content}</body></html>";
|
|
207
|
+
$content .= ob_get_clean();
|
|
216
208
|
}
|
|
217
209
|
});
|
|
218
210
|
|
|
@@ -222,9 +214,15 @@ try {
|
|
|
222
214
|
$contentToInclude = $result['path'] ?? '';
|
|
223
215
|
$layoutsToInclude = $result['layouts'] ?? [];
|
|
224
216
|
$pathname = $result['uri'] ? "/" . $result['uri'] : "/";
|
|
217
|
+
if (!empty($layoutsToInclude))
|
|
218
|
+
$isParentLayout = strpos($layoutsToInclude[0], 'src/app/layout.php') !== false;
|
|
219
|
+
else
|
|
220
|
+
$isParentLayout = false;
|
|
225
221
|
|
|
226
|
-
ob_start();
|
|
227
222
|
if (!empty($contentToInclude)) {
|
|
223
|
+
if (!$isParentLayout) {
|
|
224
|
+
require_once $contentToInclude;
|
|
225
|
+
}
|
|
228
226
|
$childContent = ob_get_clean();
|
|
229
227
|
for ($i = count($layoutsToInclude) - 1; $i >= 0; $i--) {
|
|
230
228
|
$layoutPath = $layoutsToInclude[$i];
|
|
@@ -233,7 +231,9 @@ try {
|
|
|
233
231
|
$childContent = ob_get_clean();
|
|
234
232
|
}
|
|
235
233
|
|
|
236
|
-
|
|
234
|
+
if ($isParentLayout) {
|
|
235
|
+
require_once $contentToInclude;
|
|
236
|
+
}
|
|
237
237
|
$content = $childContent;
|
|
238
238
|
} else {
|
|
239
239
|
require_once 'not-found.php';
|
|
@@ -241,5 +241,6 @@ try {
|
|
|
241
241
|
}
|
|
242
242
|
$content .= ob_get_clean();
|
|
243
243
|
} catch (Throwable $e) {
|
|
244
|
-
echo "<div class='error'>An error occurred: " . $e->getMessage() . "</div>";
|
|
244
|
+
echo "<div class='error'>An error occurred: " . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "</div>";
|
|
245
|
+
$content .= ob_get_clean();
|
|
245
246
|
}
|
package/dist/src/app/index.php
CHANGED