myjw3b / file-writing
File database handler for easily storing, updating, and selecting info.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=8.1
- myjw3b/helpful: 2.0.1
This package is auto-updated.
Last update: 2025-03-09 06:55:19 UTC
README
An easy way to store some config operations within text files.
Install
composer require myjw3b/file-writing
Autoload
make sure to include this at the top of your page
use JW3B\Data\FileWriting; include "vendor/autoload.php";
Storage
$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
$FileWriting = new FileWriting('cache/file-data'); $var = $FileWriting->get_file('name/to-reference/later'); echo '<pre>'.print_r($var,1).'</pre>';
Output
Array
(
[works] => Array
(
[with] => arrays
[multi] => Array
(
[deep] => it doesnt
[matter] => Array
(
[how] => Array
(
[deep] => you go
)
)
)
)
)