Skip to content

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

License

Notifications You must be signed in to change notification settings

myJW3B/File-Writing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File-Writing

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

include "vendor/autoload.php";
use JW3B\Data\FileWriting;

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
                                )
                        )
                )
        )
)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages