An open API service indexing awesome lists of open source software.

https://github.com/myjw3b/file-writing

An easy way to store some config operations within text files.
https://github.com/myjw3b/file-writing

file file-data-storage files filesystem

Last synced: 5 months ago
JSON representation

An easy way to store some config operations within text files.

Awesome Lists containing this project

README

          

# File-Writing
An easy way to store some config operations within text files.

# Install
````shell
composer require myjw3b/file-writing
````

# Autoload
make sure to include this at the top of your page
````php
use JW3B\Data\FileWriting;
include "vendor/autoload.php";
````
# Storage
````php
$FileWriting = new FileWriting('cache/file-data');
$FileWriting->save('name/to-reference/later',[
'works' => [
'with' => 'arrays',
'multi' => [
'deep' => 'it doesnt',
'matter' => [
'how' => [
'deep' => 'you go'
]
]
]
]
]);
````
# Retreiving Data
````php
$FileWriting = new FileWriting('cache/file-data');
$var = $FileWriting->get_file('name/to-reference/later');

echo '

'.print_r($var,1).'
';
````
# Output
````
Array
(
[works] => Array
(
[with] => arrays
[multi] => Array
(
[deep] => it doesnt
[matter] => Array
(
[how] => Array
(
[deep] => you go
)
)
)
)
)
````