https://github.com/sensorario/store
https://github.com/sensorario/store
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sensorario/store
- Owner: sensorario
- Created: 2019-06-23T22:50:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-01T23:52:24.000Z (almost 7 years ago)
- Last Synced: 2025-07-24T06:47:46.596Z (11 months ago)
- Language: PHP
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Store
Just for fun php "database".
## Folding
Memory
├── Config
│ └── Config
├── Model
│ └── Collection
├── Persistor
│ ├── FileSystemPersistor
│ └── PersistorPort
├── Services
│ ├── Helper
│ │ └── Matcher
│ ├── Memory
│ ├── NewLocalStorage
│ └── Persist
└── Storage
## Example
```php
use Memory\Config\Config;
use Memory\Services\Memory;
use Memory\Services\Persist;
use Memory\Persistor\FileSystemPersistor;
use Memory\Storage;
class Store
{
private $storage;
public function __construct()
{
$config = new Config([
'path' => __DIR__ . '/../../../../var/data/store',
]);
$memory = new Memory();
$memory->init($config);
$memory->loadFromFileSystem();
$this->storage = new Storage(
$memory,
new Persist(
new FileSystemPersistor(),
$config
),
$config
);
}
public function getStorage()
{
return $this->storage;
}
}
```