decodelabs / iota
Discrete, dependable generated code repository
v0.2.0
2025-03-11 10:23 UTC
Requires
- php: ^8.4
- decodelabs/atlas: ^0.12.4
- decodelabs/coercion: ^0.3.1
- decodelabs/exceptional: ^0.5.3
- decodelabs/hatch: ^0.1.0
- decodelabs/veneer: ^0.12.6
Requires (Dev)
- decodelabs/genesis: ^0.11.1
- decodelabs/phpstan-decodelabs: ^0.7.0
README
Discrete, dependable generated code repository
Iota provides a simple mechanism for storing, retrieving and loading generated code.
Get news and updates on the DecodeLabs blog.
Installation
Install via Composer:
composer require decodelabs/iota
Usage
Load a repository:
use DecodeLabs\Iota; // Load manually $repo = Iota::load('name', '/path/to/repo'); // Load an app-level repository only writable in dev mode $repo = Iota::loadStatic('name'); // Load a writable app-level repository $repo = Iota::loadDynamic('name');
Then you can store and retrieve code:
// Store anything $repo->store( 'key', <<<'PHP' <?php return 'Hello, world!'; PHP ); // Retrieve code $code = $repo->fetch('key'); // Include quietly $repo->include('key'); // Include and return $value = $repo->Return('key'); // 'Hello, world!'
Licensing
Iota is licensed under the MIT License. See LICENSE for the full license text.