PHPackages                             sbwerewolf/batch-file-scripting - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sbwerewolf/batch-file-scripting

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sbwerewolf/batch-file-scripting
===============================

Kit of utility classes for batch file scripting

v3.2.4(1y ago)01072MITPHPPHP &gt;=8.1

Since Jan 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SbWereWolf/batch-file-scripting)[ Packagist](https://packagist.org/packages/sbwerewolf/batch-file-scripting)[ RSS](/packages/sbwerewolf-batch-file-scripting/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (2)

Batch File Scripting
====================

[](#batch-file-scripting)

Kit of utility classes for batch file scripting.

- `EnvReader` - parse the `.env` files to array and define constants or environment variables
- `DurationConverter` - prints duration in seconds or nanoseconds with human-readable format
- `Path` - glue up file system path

Code examples in [test.php](test/test.php)

How to install
--------------

[](#how-to-install)

`composer require sbwerewolf/batch-file-scripting`

How to use EnvReader
--------------------

[](#how-to-use-envreader)

```
$path = (new Path())->make(['.', 'config', 'test.env',]);
/* .env file location is './config/test.env' */
$env = new SbWereWolf\Scripting\Config\EnvReader($path);

var_dump($env->getVariables());
/*
array(4) {
    'USER' =>
  string(4) "root"
  'PORT' =>
  string(2) "80"
  'DATE' =>
  string(10) "2023-01-25"
  'FLAG' =>
  string(5) "FALSE"
}
*/
$env->defineConstants();
echo constant('USER') . PHP_EOL;
/* root */

$env->defineVariables();
echo getenv('FLAG') . PHP_EOL;
/* FALSE */
```

How to use DurationConverter
----------------------------

[](#how-to-use-durationconverter)

```
$printer =
new SbWereWolf\Scripting\Convert\SecondsConverter('%dd, %H:%I:%S');
echo $printer->print(100000.111) . PHP_EOL;
/* 1d, 03:46:40 */

$printer =
new SbWereWolf\Scripting\Convert\NanosecondsConverter('%dd, %H:%I:%S.%F%N');
echo $printer->print(100000999888777.999) . PHP_EOL;
/* 1d, 03:46:40.999888778 */

$printer =
new SbWereWolf\Scripting\Convert\NanosecondsConverter('%L ms %U mcs %N ns');
echo $printer->print(99088077.999) . PHP_EOL;
/* 099 ms 088 mcs 077 ns */
```

How to use Path
---------------

[](#how-to-use-path)

```
$pathMaker = (new SbWereWolf\Scripting\FileSystem\Path());
$path = $pathMaker->make(['.', 'config', 'test.env',]);
echo $path . PHP_EOL;
/* .\config\test.env */
```

Contacts
--------

[](#contacts)

```
Volkhin Nikolay
e-mail ulfnew@gmail.com
phone +7-902-272-65-35
Telegram @sbwerewolf

```

Chat with me via messenger

- [Telegram chat with me](https://t.me/SbWereWolf)
- [WhatsApp chat with me](https://wa.me/79022726535)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~96 days

Recently: every ~188 days

Total

9

Last Release

438d ago

Major Versions

v1.0.1 → v2.0.12023-01-26

v2.0.2 → v3.0.22023-02-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/56415ea6aeceece7248ce372ec911905cab2cd1313ed2bb4ec8cfacdbaa7d08f?d=identicon)[SbWereWolf](/maintainers/SbWereWolf)

---

Top Contributors

[![SbWereWolf](https://avatars.githubusercontent.com/u/16444541?v=4)](https://github.com/SbWereWolf "SbWereWolf (10 commits)")

---

Tags

envenvironment-variablesinterval-printerpathphp

### Embed Badge

![Health badge](/badges/sbwerewolf-batch-file-scripting/health.svg)

```
[![Health](https://phpackages.com/badges/sbwerewolf-batch-file-scripting/health.svg)](https://phpackages.com/packages/sbwerewolf-batch-file-scripting)
```

###  Alternatives

[lucasgiovanny/filament-multiselect-two-sides

This package is a Filament package that allows you to create a multiselect with two sides.

6876.4k](/packages/lucasgiovanny-filament-multiselect-two-sides)[laravel-admin-ext/grid-sortable

Sort the grid data by drag and drop rows

42119.3k](/packages/laravel-admin-ext-grid-sortable)[lephare/import-bundle

Provide Symfony integration for lephare/import

127.3k](/packages/lephare-import-bundle)[heloufir/filament-leaflet-geosearch

Implementation of LeafLet GeoSearch as a Filament Form Field

232.0k](/packages/heloufir-filament-leaflet-geosearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
