{"id":19621614,"url":"https://github.com/pkg6/think-lock","last_synced_at":"2025-07-07T18:39:49.147Z","repository":{"id":238421032,"uuid":"796524868","full_name":"pkg6/think-lock","owner":"pkg6","description":"thinkphp lock","archived":false,"fork":false,"pushed_at":"2024-05-06T07:58:26.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-09T11:40:57.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkg6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T05:48:46.000Z","updated_at":"2024-05-06T07:58:28.000Z","dependencies_parsed_at":"2024-11-11T11:26:34.426Z","dependency_job_id":"60911de0-8cbd-4651-b8d5-d15e1f2f930f","html_url":"https://github.com/pkg6/think-lock","commit_stats":null,"previous_names":["pkg6/think-lock"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fthink-lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fthink-lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fthink-lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fthink-lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkg6","download_url":"https://codeload.github.com/pkg6/think-lock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240917723,"owners_count":19878308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:23:44.149Z","updated_at":"2025-02-26T19:16:00.052Z","avatar_url":"https://github.com/pkg6.png","language":"PHP","readme":"# 安装\n\n```\ncomposer require tp5er/think-lock\n```\n\n# 使用\n\n```\n\u003c?php\n\nnamespace app\\controller;\n\nuse app\\BaseController;\nuse tp5er\\think\\lock\\facade\\Locker;\n\nclass Index extends BaseController\n{\n    public function index()\n    {\n        $lock = Locker::lock(\"index\");\n        if (!$lock-\u003eacquire()) {\n            throw new \\Exception('操作太频繁，请稍后再试');\n        }\n        try {\n            //TODO 业务操作\n        } finally {\n            $lock-\u003erelease();\n        }\n    }\n}\n```\n\n更多操作参考：[symfony/lock](https://symfony.com/doc/current/components/lock.html) 文档\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg6%2Fthink-lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkg6%2Fthink-lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg6%2Fthink-lock/lists"}