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
Nicolas Grekas 76c35089c5 Merge branch '2.3' into 2.5
* 2.3:
  [SecurityBundle] Firewall providers building - code cleaning
  [Filesystem] symlink use RealPath instead LinkTarget
  Fixed the AuthenticationProviderInterface alignment
  Fixed the proxy-manager version constraint

Conflicts:
	composer.json
	src/Symfony/Bridge/ProxyManager/composer.json
2014-12-12 16:58:22 +01:00
..
Exception fixed CS 2014-09-22 10:32:35 +02:00
Tests Merge branch '2.3' into 2.5 2014-12-12 16:58:22 +01:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md Fix #8205 : Deprecate file mode update when calling dumpFile 2014-03-26 08:33:01 +01:00
composer.json updated version to 2.5 2013-11-24 21:17:07 +01:00
Filesystem.php Merge branch '2.3' into 2.5 2014-12-12 16:58:22 +01:00
LICENSE update year on licenses 2014-01-07 08:19:25 -05:00
phpunit.xml.dist removed defaults from PHPUnit configuration 2014-07-07 12:13:42 +02:00
README.md Update filesystem readme.md to include exists method 2014-11-16 18:27:15 +01:00

Filesystem Component

Filesystem provides basic utility to manipulate the file system:

<?php

use Symfony\Component\Filesystem\Filesystem;

$filesystem = new Filesystem();

$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->symlink($originDir, $targetDir, $copyOnWindows = false);

$filesystem->makePathRelative($endPath, $startPath);

$filesystem->mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array());

$filesystem->isAbsolutePath($file);

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/Filesystem/
$ composer.phar install
$ phpunit