robertwesner/awdy
最新稳定版本:v0.8.0
Composer 安装命令:
composer require robertwesner/awdy
包简介
Spice up your PHP-Scripts with unnecessary progress-bars!
README 文档
README
AWDY
Are We Done Yet? Spice up your PHP-scripts with progress-bars and more!
Installation
Composer (preferred)
composer require robertwesner/awdy
Single file download
- Download /dist/AWDY.php.
- Include the bundled file in your script:
require __DIR__ . '/AWDY.php';
Require from URL
If you wish to not use composer or manually download a file, you can add following code to your script:
$awdyPath = tempnam(sys_get_temp_dir(), 'awdy_'); file_put_contents($awdyPath, fopen('https://github.com/RobertWesner/awdy/releases/latest/download/AWDY.php', 'r')); require $awdyPath;
Use
More details avaiable in the wiki page.
At the beginning of your script
Set up AWDY with your choice of template, optionally with a fixed width and height
// Dynamic size takes the full shell window and reacts to size changes AWDY::setUp(new SimpleTemplate()); // Fixed width 80 and height 32 AWDY::setUp(new SimpleTemplate(), 80, 32);
Change progress
// Only as percentage AWDY::progress($i / $maxAmount); // Including current and maximum value AWDY::progress($i / $maxAmount, $i, $maxAmount);
Append to log
// Unformatted AWDY::echo("This is some simple informative text!\n"); // Printf formatting AWDY::printf('You are %d steps away from your destiny! ', $myNumber);
Templates
If the pre-defined templates are not to your liking, take a look at how to create your own.
JustProgress
00:00:23 418/1337 [==========> ] Memory[00.12%]: 15659904/134217728
Simple
.----------------------------------------------------------.
| 13370/13370 [==========================================] |
+----------------------------------------------------------+
| 0 is your lucky number! |
| 777 is your lucky number! |
| 1554 is your lucky number! |
| 2331 is your lucky number! |
| 3108 is your lucky number! |
| 3885 is your lucky number! |
| 4662 is your lucky number! |
| 5439 is your lucky number! |
| 6216 is your lucky number! |
| 6993 is your lucky number! |
| 7770 is your lucky number! |
| 8547 is your lucky number! |
| 9324 is your lucky number! |
| 10101 is your lucky number! |
| 10878 is your lucky number! |
| 11655 is your lucky number! |
| 12432 is your lucky number! |
| 13209 is your lucky number! |
'----------------------------------------------------------'
Demo
Keeping it simple
Adding some color
Allows dynamic size
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-22

