phore/file

This package is abandoned and no longer maintained. No replacement package was suggested.

File wrapper

dev-master 2017-11-22 10:32 UTC

This package is auto-updated.

Last update: 2020-01-24 20:54:38 UTC


README

file wrapper

Proof of concept: Don't use in production!

Features

  • File-Locking: content() uses flock to lock file access

Examples

pfile("../file.txt")->content()
pfile("../file.txt")->lock()->content("New Content")->unlock();
pfile("directory/../file.txt")->resolve()->mustExist()->unlink();

Load Encoded data

pfile("file.json")->json();
pfile("file.yml")->yaml();

Write Encoded data

pfile("file.json")->json(["some"=>"data"]);
pfile("file.yml")->yaml(["some"=>"data"]);

Stream data

pfile("file.json")->fopen("w+")->fwrite("someData")->fclose();