# super-tool **Repository Path**: jianglibin/super-tool ## Basic Information - **Project Name**: super-tool - **Description**: 一个用文件实现的队列类库,一个用来解析crontab格式时间的类库 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-05-15 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # super-tool 一个小众的工具类 ## 安装 > `composer require godv/super-tool dev-master` ### 工具大纲 * 小型文件队列 (`FileQueue`) > key-value结构,并且保证并发下的数据的原子性(主要是利用文件锁实现) * crontab字符串时间解析类 (`CronParser`) > 一个解析crontab格式的时间工具 ### 队列 api方法 * `FileQueue::push` 入队 * `FileQueue::pop` 出队 * `FileQueue::remove` 删除指定key * `FileQueue::removeAll` 删除全部key * `FileQueue::getCount` 获取某个key数量 ``` php './file-queue/test' //设置文件存储路径,没有会自动创建 ]); foreach(range(1,1000) as $i) { $queue->push('list',$i); } echo "删除list之前: " . $queue->getCount('list') . "\n"; // 删除所有数据 $queue->removeAll(); echo "删除list之后: " . $queue->getCount('list') . "\n"; $queue->push('name', 'jlb'); echo "name: " . $queue->pop('name') . "\n"; $queue->remove('name'); /* 删除list之前: 1000 删除list之后: 0 name: jlb */ ``` ### crontab解析工具 ``` php