====
composer install eden/file
====
Instantiate file in this manner.
$file = eden('file', '/some/path/to/file.txt');
====
====
Checks to see if this path is a real file
eden('file', '/some/path/to/file.txt')->isFile();
Returns bool
====
Returns the base file name with out the extension
eden('file', '/some/path/to/file.txt')->getBase();
Returns string
====
Returns the contents of a file given the path
eden('file', '/some/path/to/file.txt')->getContent();
Returns string
====
Returns the executes the specified file and returns the final value
eden('file', '/some/path/to/file.txt')->getData();
Returns bool
====
Returns the base file name extension
eden('file', '/some/path/to/file.txt')->getExtension();
Returns string|null
====
Returns the file path
eden('file', '/some/path/to/file.txt')->getFolder();
Returns string
====
Returns the mime type of a file
eden('file', '/some/path/to/file.txt')->getMime();
Returns string
====
Returns the file name
eden('file', '/some/path/to/file.txt')->getName();
Returns string
====
Returns the size of a file in bytes
eden('file', '/some/path/to/file.txt')->getSize();
Returns string
====
Returns the last time file was modified in UNIX time
eden('file', '/some/path/to/file.txt')->getTime();
Returns int
====
Creates a file and puts specified content into that file
eden('file', '/some/path/to/file.txt')->setContent(*string $content);
*string $content
- The raw content to save
Returns Eden\File\Index
eden('file', '/some/path/to/file.txt')->setContent('foo');
====
Creates a php file and puts specified variable into that file
eden('file', '/some/path/to/file.txt')->setData(*mixed $variable);
*mixed $variable
- Whatever data to save
Returns Eden\File\Index
eden('file', '/some/path/to/file.txt')->setData($variable);
====
Removes a file
eden('file', '/some/path/to/file.txt')->remove();
Returns Eden\File\Index
====
Touches a file (effectively creates the file if it doesn't exist and updates the date if it does)
eden('file', '/some/path/to/file.txt')->touch();
Returns Eden\File\Index
====
Contributions to Eden are following the Github work flow. Please read up before contributing.
##Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
##Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.