This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Filesystem/README.md

46 lines
1.0 KiB
Markdown
Raw Normal View History

2011-12-22 18:43:09 +00:00
Filesystem Component
====================
Filesystem provides basic utility to manipulate the file system:
```php
<?php
2011-12-22 18:43:09 +00:00
use Symfony\Component\Filesystem\Filesystem;
2011-12-22 18:43:09 +00:00
$filesystem = new Filesystem();
2011-12-22 18:43:09 +00:00
$filesystem->copy($originFile, $targetFile, $override = false);
2011-12-22 18:43:09 +00:00
$filesystem->mkdir($dirs, $mode = 0777);
2011-12-22 18:43:09 +00:00
$filesystem->touch($files, $time = null, $atime = null);
2011-12-22 18:43:09 +00:00
$filesystem->remove($files);
2011-12-22 18:43:09 +00:00
$filesystem->chmod($files, $mode, $umask = 0000, $recursive = false);
2011-12-22 18:43:09 +00:00
$filesystem->chown($files, $user, $recursive = false);
2011-12-22 18:43:09 +00:00
$filesystem->chgrp($files, $group, $recursive = false);
2011-12-22 18:43:09 +00:00
$filesystem->rename($origin, $target);
2011-12-22 18:43:09 +00:00
$filesystem->symlink($originDir, $targetDir, $copyOnWindows = false);
$filesystem->makePathRelative($endPath, $startPath);
$filesystem->mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array());
$filesystem->isAbsolutePath($file);
```
2011-12-22 18:43:09 +00:00
Resources
---------
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Filesystem/
$ composer.phar install
$ phpunit