create-prisma-php-app 1.13.0 → 1.13.2
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 +3 -7
- package/package.json +1 -1
package/dist/bootstrap.php
CHANGED
|
@@ -181,9 +181,9 @@ function dynamicRoute($uri)
|
|
|
181
181
|
$segmentMatch = singleDynamicRoute($uriSegments, $routeSegments);
|
|
182
182
|
if (!empty($segmentMatch)) {
|
|
183
183
|
$trimSegmentMatch = trim($segmentMatch, '[]');
|
|
184
|
-
$dynamicRouteParams = [$trimSegmentMatch => $uriSegments[array_search($segmentMatch, $routeSegments)]];
|
|
184
|
+
$dynamicRouteParams = new \ArrayObject([$trimSegmentMatch => $uriSegments[array_search($segmentMatch, $routeSegments)]], \ArrayObject::ARRAY_AS_PROPS);
|
|
185
185
|
|
|
186
|
-
$dynamicRouteUri = str_replace($segmentMatch, $
|
|
186
|
+
$dynamicRouteUri = str_replace($segmentMatch, $uriSegments[array_search($segmentMatch, $routeSegments)], $normalizedRoute);
|
|
187
187
|
$dynamicRouteUriDirname = dirname($dynamicRouteUri);
|
|
188
188
|
$dynamicRouteUriDirname = rtrim($dynamicRouteUriDirname, '/');
|
|
189
189
|
|
|
@@ -207,7 +207,7 @@ function dynamicRoute($uri)
|
|
|
207
207
|
$pattern = '/\[\.\.\.(.*?)\]/';
|
|
208
208
|
if (preg_match($pattern, $normalizedRoute, $matches)) {
|
|
209
209
|
$contentWithinBrackets = $matches[1];
|
|
210
|
-
$dynamicRouteParams = [$contentWithinBrackets => $explodedNormalizedUri];
|
|
210
|
+
$dynamicRouteParams = new \ArrayObject([$contentWithinBrackets => $explodedNormalizedUri], \ArrayObject::ARRAY_AS_PROPS);
|
|
211
211
|
}
|
|
212
212
|
if (strpos($normalizedRoute, 'route.php') !== false) {
|
|
213
213
|
$uriMatch = $normalizedRoute;
|
|
@@ -279,10 +279,6 @@ function getGroupFolder($uri): string
|
|
|
279
279
|
function singleDynamicRoute($uriSegments, $routeSegments)
|
|
280
280
|
{
|
|
281
281
|
$segmentMatch = "";
|
|
282
|
-
if (count($routeSegments) != count($uriSegments)) {
|
|
283
|
-
return $segmentMatch;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
282
|
foreach ($routeSegments as $index => $segment) {
|
|
287
283
|
if (preg_match('/^\[[^\]]+\]$/', $segment)) {
|
|
288
284
|
return "{$segment}";
|