PHP Class Platformsh\Cli\Helper\FilesystemHelper

Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Platformsh\Cli\Console\OutputAwareInterface
Afficher le fichier Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Свойство Type Description
$copyOnWindows
$fs
$relative
$shellHelper Platformsh\Cli\Helper\ShellHelperInterface

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

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() public méthode

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

copy() public méthode

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() public méthode

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() public méthode

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

fixTarPath() protected méthode

Fix a path so that it can be used with tar on Windows.
See also: http://betterlogic.com/roger/2009/01/tar-woes-with-windows/
protected fixTarPath ( string $path ) : string
$path string
Résultat string

getHomeDirectory() public static méthode

public static getHomeDirectory ( ) : string
Résultat string The absolute path to the user's home directory.

getName() public méthode

public getName ( )

getTarExecutable() protected méthode

protected getTarExecutable ( ) : string
Résultat string

inBlacklist() protected méthode

Check if a filename is in the blacklist.
protected inBlacklist ( string $filename, array $blacklist ) : boolean
$filename string
$blacklist array
Résultat boolean

isWindows() protected méthode

protected isWindows ( ) : boolean
Résultat boolean

makePathAbsolute() public méthode

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
Résultat string

makePathRelative() public méthode

Make a absolute path into a relative one.
public makePathRelative ( string $path1, string $path2 ) : string
$path1 string Absolute path.
$path2 string Target path.
Résultat string The first path, made relative to the second path.

mkdir() public méthode

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

remove() public méthode

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'.
Résultat boolean

setCopyOnWindows() public méthode

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

setOutput() public méthode

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

symlinkAll() public méthode

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() protected méthode

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.
Résultat boolean True on success, false on failure.

Property Details

$copyOnWindows protected_oe property

protected $copyOnWindows

$fs protected_oe property

protected $fs

$relative protected_oe property

protected $relative

$shellHelper protected_oe property

protected ShellHelperInterface,Platformsh\Cli\Helper $shellHelper
Résultat Platformsh\Cli\Helper\ShellHelperInterface