fperdomo/scanner
最新稳定版本:1.0.0
Composer 安装命令:
composer require fperdomo/scanner
包简介
Scan an array or file of URLs and report inaccessible URLs
README 文档
README
A lightweight, framework-agnostic PHP package to scan large lists of URLs efficiently using chunked asynchronous processing.
Designed for use inside Laravel commands or any PHP application where non-blocking URL checking is required
use
use Fperdomo\App\Url\Scanner; $urls = Scanner::create() ->fromArray([ 'https://example.com', 'https://another-example.com', ])->getInvalidUrls();
From a file:
use Fperdomo\App\Url\Scanner; $scanner = Scanner::create() ->fromFile('url.csv') ->onProgress(funtion ($progress) {); // show progress print_r(''); print_r('========================================'); print_r(sprintf('Total URLs processed: %d', $progress->totalRowsProcessed)); print_r(sprintf( 'Valid URLs: %d (%.1f%%)', $progress->resultsOk, $progress->validPercentage() )); print_r(sprintf( 'Invalid URLs: %d (%.1f%%)', $progress->resultsErr, $progress->invalidPercentage() )); print_r('========================================'); }); Benchmark::dd(fn () => $scanner->scan());
From a file async:
use Fperdomo\App\Url\Scanner; $urls = Scanner::create() ->fromFile('url.csv') ->field('url') ->chunk(1000) ->onProgress(funtion ($progress) {); // show progress print_r(''); print_r('========================================'); print_r(sprintf('Total URLs processed: %d', $progress->totalRowsProcessed)); print_r(sprintf( 'Valid URLs: %d (%.1f%%)', $progress->resultsOk, $progress->validPercentage() )); print_r(sprintf( 'Invalid URLs: %d (%.1f%%)', $progress->resultsErr, $progress->invalidPercentage() )); print_r('========================================'); }); Benchmark::dd(fn () => $scanner->scan());
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-17