Skip to content

Commit b3a976f

Browse files
authored
Merge pull request #668 from UlrichEckhardt/issue-576
Add missing `__clockwork/lastest` implementation for Slim frameworks
2 parents d57fffd + 1e100ad commit b3a976f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

Clockwork/Support/Slim/ClockworkMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function process(Request $request, RequestHandler $handler)
3636
return $this->authenticate($request);
3737
}
3838

39-
$clockworkDataUri = '#/__clockwork(?:/(?<id>[0-9-]+))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
39+
$clockworkDataUri = '#/__clockwork(?:/(?<id>([0-9-]+|latest)))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
4040
if (preg_match($clockworkDataUri, $request->getUri()->getPath(), $matches)) {
4141
$matches = array_merge([ 'id' => null, 'direction' => null, 'count' => null ], $matches);
4242
return $this->retrieveRequest($request, $matches['id'], $matches['direction'], $matches['count']);

Clockwork/Support/Slim/Legacy/ClockworkMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function process(Request $request, Response $response, callable $next)
3434
return $this->authenticate($response, $request);
3535
}
3636

37-
$clockworkDataUri = '#/__clockwork(?:/(?<id>[0-9-]+))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
37+
$clockworkDataUri = '#/__clockwork(?:/(?<id>([0-9-]+|latest)))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
3838
if (preg_match($clockworkDataUri, $request->getUri()->getPath(), $matches)) {
3939
$matches = array_merge([ 'id' => null, 'direction' => null, 'count' => null ], $matches);
4040
return $this->retrieveRequest($response, $request, $matches['id'], $matches['direction'], $matches['count']);

Clockwork/Support/Slim/Old/ClockworkMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function call()
3939

4040
$this->app->getLog()->setWriter($clockworkLogWriter);
4141

42-
$clockworkDataUri = '#/__clockwork(?:/(?<id>[0-9-]+))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
42+
$clockworkDataUri = '#/__clockwork(?:/(?<id>([0-9-]+|latest)))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
4343
if ($this->app->config('debug') && preg_match($clockworkDataUri, $this->app->request()->getPathInfo(), $matches)) {
4444
$matches = array_merge([ 'direction' => null, 'count' => null ], $matches);
4545
return $this->retrieveRequest($matches['id'], $matches['direction'], $matches['count']);

0 commit comments

Comments
 (0)