Download the PHP package libratechie/think-distributed-lock without Composer

On this page you can find all versions of the php package libratechie/think-distributed-lock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-distributed-lock

think-distributed-lock

专为 ThinkPHP 框架设计的轻量级分布式锁组件,帮助开发者轻松实现高并发场景下的资源互斥访问。

特性

安装

配置

在 config/distributed_lock.php 中配置(文件不存在时会自动创建):

使用指南

注意事项

  1. 异常处理
    确保在 try-catch 块中进行业务操作,避免异常导致锁无法释放;

  2. 不可重入锁
    本项目当前不支持可重入锁机制。即同一线程在持有锁的情况下,无法再次获得该锁。请确保锁的使用符合这一约束;

  3. 默认超时时间
    锁资源的默认超时时间为60秒。如果在超时时间内没有释放锁,锁将自动过期并被释放;

  4. 节点故障与锁资源释放
    如果锁持有的节点发生故障或宕机,锁资源的释放可能会延迟。这意味着,在锁资源未释放之前,其他节点无法获得该锁。此期间的分布式锁将无法被任何节点使用,直到故障节点恢复或锁被手动释放;

  5. PHP客户端的限制
    目前,PHP客户端不具备类似于Java Redisson的自动监控机制,因此,PHP实现的分布式锁可能会面临锁超时后无法自动延长有效期的问题。我们也欢迎大家通过Pull Request参与贡献,帮助改进这一特性。

免责声明

在您的生产环境中使用本项目之前,请确保了解其工作原理,并在充分测试后再进行部署。我们不对因使用本项目造成的任何损失或故障负责。

贡献

欢迎通过 Issue 提交问题或 Pull Request 参与贡献


All versions of think-distributed-lock with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
topthink/framework Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package libratechie/think-distributed-lock contains the following files

Loading the files please wait ....