sfFilesystem provides basic utility to manipulate the file system.
Method Summary
-
chmod($files, $mode, $umask)
Change mode for an array of files or directories.
-
copy($originFile, $targetFile, $options)
Copies a file.
-
logSection($section, $message, $size)
Logs a message in a section.
-
mirror($originDir, $targetDir, $finder, $options)
Mirrors a directory to another.
-
bool
mkdirs($path, $mode)
Creates a directory recursively.
-
remove($files)
Removes files or directories.
-
rename($origin, $target)
Renames a file.
-
replaceTokens($files, $beginToken, $endToken, $tokens)
Replaces tokens in an array of files.
-
sh($cmd)
Executes a shell command.
-
symlink($originDir, $targetDir, $copyOnWindows)
Creates a symbolic link or copy a directory.
-
touch($files)
Creates empty files.
-
__construct($dispatcher, $formatter)
Constructor.
Method Details
-
chmod ($files, $mode, $umask)
Browse code
| $files |
An array of files or directories |
| $mode |
The new mode |
| $umask |
The mode mask (octal) |
Change mode for an array of files or directories.
-
copy ($originFile, $targetFile, $options)
Browse code
| $originFile |
The original filename |
| $targetFile |
The target filename |
| $options |
An array of options |
Copies a file.
This method only copies the file if the origin file is newer than the target file. By default, if the target already exists, it is not overriden. To override existing files, pass the "override" option.
-
logSection ($section, $message, $size)
Browse code
| $section |
The section name |
| $message |
The message |
| $size |
The maximum size of a line |
Logs a message in a section.
-
mirror ($originDir, $targetDir, $finder, $options)
Browse code
| $originDir |
The origin directory |
| $targetDir |
The target directory |
| $finder |
An sfFinder instance |
| $options |
An array of options (see copy()) |
Mirrors a directory to another.
-
(bool) mkdirs ($path, $mode)
Browse code
| $path |
The directory path |
| $mode |
The directory mode |
Creates a directory recursively.
returns true if the directory has been created, false otherwise
-
| $files |
A filename or an array of files to remove |
Removes files or directories.
-
rename ($origin, $target)
Browse code
| $origin |
The origin filename |
| $target |
The new filename |
Renames a file.
-
replaceTokens ($files, $beginToken, $endToken, $tokens)
Browse code
| $files |
An array of filenames |
| $beginToken |
The begin token delimiter |
| $endToken |
The end token delimiter |
| $tokens |
An array of token/value pairs |
Replaces tokens in an array of files.
-
| $cmd |
The command to execute on the shell |
Executes a shell command.
-
symlink ($originDir, $targetDir, $copyOnWindows)
Browse code
| $originDir |
The origin directory path |
| $targetDir |
The symbolic link name |
| $copyOnWindows |
Whether to copy files if on windows |
Creates a symbolic link or copy a directory.
-
| $files |
The filename, or an array of filenames |
Creates empty files.
-
__construct ($dispatcher, $formatter)
Browse code
| $dispatcher |
An sfEventDispatcher instance |
| $formatter |
An sfFormatter instance |
Constructor.
|