PHP code example of aeviiq / storage-manager
1. Go to this page and download the library: Download aeviiq/storage-manager library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aeviiq / storage-manager example snippets
final class Foo
{
public function __construct(private readonly StorageManagerInterface $storageManager)
{
}
public function __invoke(): void
{
$object = new stdClass();
$object->foo = 'foo';
$this->storageManager->save('some_key', $object);
// These changes are made after the save() call and will not be there upon load().
$object->foo = 'bar';
$loadedObject = $this->storageManager->load('some_key');
$object === $loadedObject; // false
$loadedObject->foo === 'bar' // false
}
}