decodelabs / iota
Discrete, dependable generated code repository
Installs: 1 254
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.4
- decodelabs/atlas: ^0.14
- decodelabs/coercion: ^0.3.3
- decodelabs/exceptional: ^0.6.1
- decodelabs/hatch: ^0.1.4
- decodelabs/kingdom: ^0.1
- decodelabs/monarch: ^0.2
Requires (Dev)
- decodelabs/genesis: ^0.14
- decodelabs/phpstan-decodelabs: ^0.7.0
Conflicts
- decodelabs/genesis: <0.14
README
Discrete, dependable generated code repository
Iota provides a simple mechanism for storing, retrieving and loading generated code.
Installation
Install via Composer:
composer require decodelabs/iota
Usage
Load a repository:
use DecodeLabs\Iota; // Get service $iota = new 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.