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 38c36c2f67 Merge branch '3.0'
* 3.0:
  fixed CS
  [DomCrawler] Dont use LIBXML_PARSEHUGE by default
  [Filesystem] Reduce complexity of ->remove()
  added tests for non-trusted proxies
  add 'guid' to list of exception to filter out
  Ensure backend slashes for symlinks on Windows systems
  [Filesystem] Try to delete broken symlinks
  fixed tests
  [FrameworkBundle] Test that ObjectNormalizer is registered
2016-03-02 16:26:30 +01:00
..
Exception Merge branch '2.3' into 2.7 2015-09-29 14:06:14 +02:00
Tests Merge branch '2.8' into 3.0 2016-03-02 16:25:36 +01:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md Merge branch '2.8' 2015-11-10 14:34:42 +01:00
composer.json updated version to 3.1 2015-11-30 22:39:17 +01:00
Filesystem.php Merge branch '2.8' into 3.0 2016-03-02 16:25:36 +01:00
LICENSE Update copyright year 2016-01-01 23:53:47 -03:00
LockHandler.php fixed CS 2016-01-21 09:40:25 +01:00
phpunit.xml.dist Add missing exclusions from phpunit.xml.dist 2015-11-18 09:19:46 +01:00
README.md Update coding standard for MockStream 2015-11-09 17:11:40 +02: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 install
$ phpunit