Download .zip |
Info | Documentation | View files (26) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2018-04-08 (5 months ago) | Not yet rated by the users | Total: 109 This week: 1 | All time: 8,929 This week: 468 |
Version | License | PHP version | Categories | |||
kv_storage 1.0.2 | MIT/X Consortium ... | 5 | PHP 5, Databases, Files and Folders |
Description | Author | |
This package can store and retrieve values on different containers. |
// Storage for 'test' Realm.
$s = new InMemoryStore('test');
$s->set('name', 'Payam');
$s->set('family', 'Naderi');
$fullname = $s->getFromKeys(['name', 'family']);
$fullname = StdTravers::of($fullname)
->each(function($val, $_ ,$prev) {
return $prev.= ' '.$val;
});
print_r($fullname);
$s = new FlatFileStore('user_codes');
$user_id = 'd5e110k33f';
$s->set($user_id, '1453');
// Without this syntax storage will save given entity when dispatch shutdown.
$s->save(); // force to save current
> In Next Calls
values can be retrieved.
$s = new FlatFileStore('user_codes');
if ($s->has('d5e110k33f'))
print_r($s->get('d5e110k33f'));
> Destroy Storage
will destroy storage for given 'user_codes' realm.
$s = new FlatFileStore('user_codes');
$s->destroy();
> Choose Desired Options
Options In under_score with construct
$s = new FlatFileStore('user_codes', ['dir_path' => __DIR__.'/my_user_codes.dat']);
$s->set('key', 'value');
will map to setter methods
$s = new FlatFileStore('user_codes');
$s->setPathDir(__DIR__.'/my_user_codes.dat');
$s->set('key', 'value');
$client = \Module\MongoDriver\Actions::Driver()->getClient('master');
$collection = $client->selectCollection('papioniha', 'store.app');
$s = new MongoStore('pass_trough', ['collection' => $collection]);
// Traverse All Data
$v = StdTravers::of( $s )
->each(function($val, $key ,$prev) {
if ( is_array($prev) )
return $prev[$key] = $val;
return [$key => $val];
});
print_r($v);
Files |
File | Role | Description | ||
---|---|---|---|---|
src (6 files, 6 directories) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
readme.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Exception (4 files, 1 directory) | ||||
Http (2 files) | ||||
Interchange (3 files) | ||||
Interfaces (2 files) | ||||
Redis (2 files) | ||||
Wrapper (1 file) | ||||
aDataStore.php | Class | Class source | ||
FlatFileStore.php | Class | Class source | ||
InMemoryStore.php | Class | Class source | ||
MongoStore.php | Class | Class source | ||
RedisStore.php | Class | Class source | ||
_functions.php | Aux. | Auxiliary script |
Files | / | src | / | Exception |
File | Role | Description | ||
---|---|---|---|---|
Storage (3 files) | ||||
exDataMalformed.php | Class | Class source | ||
exDataNotPersistable.php | Class | Class source | ||
exInvalidKey.php | Class | Class source | ||
exUnknownData.php | Class | Class source |
Files | / | src | / | Exception | / | Storage |
File | Role | Description |
---|---|---|
exIOError.php | Class | Class source |
exReadError.php | Class | Class source |
exWriteError.php | Class | Class source |
Files | / | src | / | Http |
File | Role | Description |
---|---|---|
CookieStore.php | Class | Class source |
SessionStore.php | Class | Class source |
Files | / | src | / | Interchange |
File | Role | Description |
---|---|---|
ExportInterchange.php | Class | Class source |
JsonInterchange.php | Class | Class source |
SerializeInterchange.php | Class | Class source |
Files | / | src | / | Interfaces |
File | Role | Description |
---|---|---|
iDataStore.php | Class | Class source |
iInterchangeable.php | Class | Class source |
Files | / | src | / | Redis |
File | Role | Description |
---|---|---|
CleanScriptCommand.php | Class | Class source |
CountScriptCommand.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.