first commit.

This commit is contained in:
kj
2026-10-05 15:08:39 -03:00
commit b7799f9fff
93 changed files with 8966 additions and 0 deletions
@@ -0,0 +1,25 @@
<?php
namespace Toolbox;
/**
* Fuente de paquetes en disco: `packages/<pkg>/<archivo>`.
*/
final class DirectorySource implements PackageSource
{
public function __construct(private readonly string $packagesDir)
{
}
public function baseDir(string $package): string
{
return rtrim($this->packagesDir, '/') . '/' . $package;
}
public function read(string $package, string $file): ?string
{
$path = $this->baseDir($package) . '/' . ltrim($file, '/');
return is_file($path) ? (string) file_get_contents($path) : null;
}
}