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.
- Host: GitHub
- URL: https://github.com/myjw3b/file-writing
- Owner: myJW3B
- License: mit
- Created: 2024-07-03T00:14:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-09T06:55:15.000Z (over 1 year ago)
- Last Synced: 2025-09-19T01:30:59.523Z (9 months ago)
- Topics: file, file-data-storage, files, filesystem
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
)
)
)
)
)
````