diff --git a/.gitignore b/.gitignore index 1e729413..bacb72d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ #dependencies -inc/simplepie/* +vendor/simplepie/* #temp files cache/* diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 00000000..1e026060 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,16 @@ +import($import_file); + } + + function import(string $file): bool { + $json = @file_get_contents($file); + if($json===false) return false; + $json = json_decode($json, true); + if(!is_array(json)) return false; + foreach($json as $key => $value) { + $this->$$key = $value; + } + return true; + } + + function export(string $file = ""): string { + return json_encode($this, JSON_PRETTY_PRINT); + } + + function __toString(): string { + return $this->export(); + } +} \ No newline at end of file