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 5f8d71be52 Merge branch '2.6' into 2.7
* 2.6:
  Use PHPUnit ini_set wrapper in tests
  [Process] Added a test skip check for Windows
  [Process] Removed unused variable assignment
  Fixes various phpdoc and coding standards.
  Fixes Issue #13184 - incremental output getters now return empty strings
  Updated copyright to 2015
  Updated copyright to 2015
  Updated copyright to 2015
  [VarDumper] increase debug.max_items to 2500
  [Debug] Update exception messages.
  use value of DIRECTORY_SEPARATOR to detect Windows
  force ExpressionLanguage version >= 2.6
  [Debug] fixes ClassNotFoundFatalErrorHandler to correctly handle class not found errors with Symfony ClassLoader component autoloaders.
  Clarify a comment.
  use PHP_WINDOWS_VERSION_BUILD to detect Windows
  Check if a field type_class is defined before using it.
  Currently if you want to use inline bootstrap form rendering, this is usually enough:

Conflicts:
	src/Symfony/Component/Debug/composer.json
2015-01-03 09:02:46 +01:00
..
Exception Merge branch '2.3' into 2.5 2014-12-22 17:29:52 +01:00
Tests use value of DIRECTORY_SEPARATOR to detect Windows 2014-12-31 10:20:32 +01:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md [Filesystem] Added a lock handler 2014-09-12 16:19:59 +02:00
composer.json updated version to 2.7 2014-11-10 19:00:54 +01:00
Filesystem.php use value of DIRECTORY_SEPARATOR to detect Windows 2014-12-31 10:20:32 +01:00
LICENSE Updated copyright to 2015 2015-01-01 13:56:52 +01:00
LockHandler.php [Filesystem] fix lock file permissions 2014-11-30 11:30:45 +01:00
phpunit.xml.dist [Tests] Silenced all deprecations in tests for 2.3 2014-12-18 20:00:19 +01: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