定制 echovick/helper-utilities 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

echovick/helper-utilities

最新稳定版本:v1.0.0

Composer 安装命令:

composer require echovick/helper-utilities

包简介

A package that provides a collection of utility functions that developers can use in their projects. It's broad and encompasses various types of helpers like throttling or rate limiting, attempt, string and numeric manipulations.

README 文档

README

Echoutilities is a PHP utility package developed by Echovick that provides various helper functions to simplify common tasks in PHP applications.

Installation

You can install Echoutilities via Composer. Run the following command in your terminal:

composer require echovick/helper-utilities

Usage

Currently, Echoutilities includes the ThrottleHelper class, which allows you to throttle a function based on user ID and function name.

ThrottleHelper

The ThrottleHelper class provides a way to limit the rate at which a function can be called by a user within a specified time period.

Example usage:

use App\Helpers\ThrottleHelper;

// Define your function
$myFunction = function() {
    // Your function logic goes here
};

// Throttle the function
$result = ThrottleHelper::throttle($myFunction, 15, 'myFunction', $userId);

// Check the result
if (is_callable($result)) {
    // Function was executed successfully
} else {
    // Function was throttled, handle accordingly
    echo $result; // Example: "Please try again in 10 seconds."
}

Documentation

For more detailed documentation on how to use Echoutilities, refer to the PHPDoc comments in the source code or visit the GitHub repository.

Contributing

Contributions to Echoutilities are welcome! If you have any suggestions, improvements, or new features to add, please open an issue or submit a pull request on the GitHub repository.

License

Echoutilities is open-source software licensed under the MIT License.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GNU
  • 更新时间: 2024-05-05