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
Fabien Potencier 66433c5626 Merge branch '2.1' into 2.2
* 2.1:
  bumped Symfony version to 2.1.11-DEV
  updated VERSION for 2.1.10
  update CONTRIBUTORS for 2.1.10
  updated CHANGELOG for 2.1.10
  fixed CS
  [Process] Cleanup tests & prevent assertion that kills randomly Travis-CI
  [Filesystem] Fix regression introduced in 10dea948

Conflicts:
	src/Symfony/Component/Form/Extension/Core/DataTransformer/DataTransformerChain.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
	src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
2013-05-06 22:02:13 +02:00
..
Exception [Filesystem] Added few new behaviors: 2012-06-18 12:38:47 +02:00
Tests Fixed @expectedException definitions to reference absolute exception paths 2013-01-05 18:52:40 +01:00
.gitignore made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
CHANGELOG.md [Filesystem] added a missing CHANGELOG item and fixed some CS 2012-12-11 13:58:05 +01:00
composer.json Removed useless branch alias for dev-master in composer.json 2012-12-06 11:00:55 +01:00
Filesystem.php Merge branch '2.1' into 2.2 2013-05-06 22:02:13 +02:00
LICENSE Merge branch '2.0' into 2.1 2013-01-04 18:00:54 +01:00
phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
README.md made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +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->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 --dev
$ phpunit