初始化

This commit is contained in:
2026-01-06 13:37:07 +08:00
parent c3435595fe
commit 00d7a381aa
70 changed files with 3913 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace think\worker\resetters;
use think\App;
use think\Paginator;
use think\worker\contract\ResetterInterface;
use think\worker\Sandbox;
class ResetPaginator implements ResetterInterface
{
public function handle(App $app, Sandbox $sandbox)
{
Paginator::currentPathResolver(function () use ($sandbox) {
return $sandbox->getSnapshot()->request->baseUrl();
});
Paginator::currentPageResolver(function ($varPage = 'page') use ($sandbox) {
$page = $sandbox->getSnapshot()->request->param($varPage);
if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
return (int) $page;
}
return 1;
});
}
}