PHP Класс Platformsh\Cli\Helper\FilesystemHelper

Наследование: extends Symfony\Component\Console\Helper\Helper, implements Platformsh\Cli\Console\OutputAwareInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$copyOnWindows
$fs
$relative
$shellHelper Platformsh\Cli\Helper\ShellHelperInterface

Открытые методы

Метод Описание
__construct ( Platformsh\Cli\Helper\ShellHelperInterface $shellHelper = null, Symfony\Component\Console\Output\OutputInterface $fs = null )
archiveDir ( string $dir, string $destination ) Create a gzipped tar archive of a directory's contents.
copy ( string $source, string $destination, boolean $override = false ) Copy a file, if it is newer than the destination.
copyAll ( string $source, string $destination, array $skip = ['.git', '.DS_Store'], boolean $override = false ) Copy all files and folders between directories.
extractArchive ( string $archive, string $destination ) Extract a gzipped tar archive into the specified destination directory.
getHomeDirectory ( ) : string
getName ( )
makePathAbsolute ( string $relativePath ) : string Make a relative path into an absolute one.
makePathRelative ( string $path1, string $path2 ) : string Make a absolute path into a relative one.
mkdir ( string $dir, integer $mode = 493 )
remove ( string | array | Traversable $files, boolean $retryWithChmod = false ) : boolean Delete a file or directory.
setCopyOnWindows ( boolean $copyOnWindows = true )
setOutput ( Symfony\Component\Console\Output\OutputInterface $output )
setRelativeLinks ( boolean $relative = true ) Set whether to use relative links.
symlink ( $target, $link ) : string Create a symbolic link to a file or directory.
symlinkAll ( string $source, string $destination, boolean $skipExisting = true, boolean $recursive = false, string[] $blacklist = [], boolean $copy = false ) Symlink or copy all files and folders between two directories.

Защищенные методы

Метод Описание
fixTarPath ( string $path ) : string Fix a path so that it can be used with tar on Windows.
getTarExecutable ( ) : string
inBlacklist ( string $filename, array $blacklist ) : boolean Check if a filename is in the blacklist.
isWindows ( ) : boolean
unprotect ( string | array | Traversable $files, boolean $recursive = false ) : boolean Make files writable by the current user.

Описание методов

__construct() публичный Метод

public __construct ( Platformsh\Cli\Helper\ShellHelperInterface $shellHelper = null, Symfony\Component\Console\Output\OutputInterface $fs = null )
$shellHelper Platformsh\Cli\Helper\ShellHelperInterface
$fs Symfony\Component\Console\Output\OutputInterface

archiveDir() публичный Метод

Create a gzipped tar archive of a directory's contents.
public archiveDir ( string $dir, string $destination )
$dir string
$destination string

copy() публичный Метод

Copy a file, if it is newer than the destination.
public copy ( string $source, string $destination, boolean $override = false )
$source string
$destination string
$override boolean

copyAll() публичный Метод

Copy all files and folders between directories.
public copyAll ( string $source, string $destination, array $skip = ['.git', '.DS_Store'], boolean $override = false )
$source string
$destination string
$skip array
$override boolean

extractArchive() публичный Метод

Extract a gzipped tar archive into the specified destination directory.
public extractArchive ( string $archive, string $destination )
$archive string
$destination string

fixTarPath() защищенный Метод

Fix a path so that it can be used with tar on Windows.
См. также: http://betterlogic.com/roger/2009/01/tar-woes-with-windows/
protected fixTarPath ( string $path ) : string
$path string
Результат string

getHomeDirectory() публичный статический Метод

public static getHomeDirectory ( ) : string
Результат string The absolute path to the user's home directory.

getName() публичный Метод

public getName ( )

getTarExecutable() защищенный Метод

protected getTarExecutable ( ) : string
Результат string

inBlacklist() защищенный Метод

Check if a filename is in the blacklist.
protected inBlacklist ( string $filename, array $blacklist ) : boolean
$filename string
$blacklist array
Результат boolean

isWindows() защищенный Метод

protected isWindows ( ) : boolean
Результат boolean

makePathAbsolute() публичный Метод

The realpath() function will only work for existing files, and not for symlinks. This is a more flexible solution.
public makePathAbsolute ( string $relativePath ) : string
$relativePath string
Результат string

makePathRelative() публичный Метод

Make a absolute path into a relative one.
public makePathRelative ( string $path1, string $path2 ) : string
$path1 string Absolute path.
$path2 string Target path.
Результат string The first path, made relative to the second path.

mkdir() публичный Метод

public mkdir ( string $dir, integer $mode = 493 )
$dir string
$mode integer

remove() публичный Метод

Delete a file or directory.
public remove ( string | array | Traversable $files, boolean $retryWithChmod = false ) : boolean
$files string | array | Traversable A filename, an array of files, or a \Traversable instance to delete.
$retryWithChmod boolean Whether to retry deleting on error, after recursively changing file modes to add read/write/exec permissions. A bit like 'rm -rf'.
Результат boolean

setCopyOnWindows() публичный Метод

public setCopyOnWindows ( boolean $copyOnWindows = true )
$copyOnWindows boolean

setOutput() публичный Метод

public setOutput ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

symlinkAll() публичный Метод

Symlink or copy all files and folders between two directories.
public symlinkAll ( string $source, string $destination, boolean $skipExisting = true, boolean $recursive = false, string[] $blacklist = [], boolean $copy = false )
$source string
$destination string
$skipExisting boolean
$recursive boolean
$blacklist string[]
$copy boolean

unprotect() защищенный Метод

Make files writable by the current user.
protected unprotect ( string | array | Traversable $files, boolean $recursive = false ) : boolean
$files string | array | Traversable A filename, an array of files, or a \Traversable instance.
$recursive boolean Whether to change the mode recursively or not.
Результат boolean True on success, false on failure.

Описание свойств

$copyOnWindows защищенное свойство

protected $copyOnWindows

$fs защищенное свойство

protected $fs

$relative защищенное свойство

protected $relative

$shellHelper защищенное свойство

protected ShellHelperInterface,Platformsh\Cli\Helper $shellHelper
Результат Platformsh\Cli\Helper\ShellHelperInterface