t4web / filesystem
Wrapper over filesystem PHP functions
1.0.0
2016-03-02 15:15 UTC
Requires
- php: ^5.5 || ^7.0
- symfony/filesystem: ~3.0.3
Requires (Dev)
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-26 18:33:32 UTC
README
Filesystem
Wrapper over filesystem PHP functions. Extend Symfony/Filesystem.
<?php use T4web\Filesystem\Filesystem; $filesystem = new Filesystem(); $filesystem->isWritable($filename); $filesystem->isDir($filename); $filesystem->put($filename, $data, $flags = FILE_APPEND); $filesystem->copy($originFile, $targetFile, $override = false); $filesystem->mkdir($dirs, $mode = 0777); $filesystem->touch($files, $time = null, $atime = null); $filesystem->remove($files); $filesystem->exists($files); $filesystem->chmod($files, $mode, $umask = 0000, $recursive = false); $filesystem->chown($files, $user, $recursive = false); $filesystem->chgrp($files, $group, $recursive = false); $filesystem->rename($origin, $target); $filesystem->isReadable($filename); $filesystem->symlink($originDir, $targetDir, $copyOnWindows = false); $filesystem->makePathRelative($endPath, $startPath); $filesystem->mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array()); $filesystem->isAbsolutePath($file); $filesystem->tempnam($dir, $prefix); $filesystem->dumpFile($filename, $content);
Installation
Add this project in your composer.json:
"require": { "t4web/filesystem": "~1.0.0" }
Now tell composer to download Filesystem by running the command:
$ php composer.phar update