PHP Class Cake\Upgrade\Shell\Task\StageTask

Handles staging changes for the upgrade process
Inheritance: extends Cake\Console\Shell
Show file Open project: cakephp/upgrade

Protected Properties

Property Type Description
$_files array Files
$_mkdirCommand string mkdir command to use for creating folders/paths.
$_paths array Paths
$_staged array Staged changes for processing at the end

Public Methods

Method Description
__construct ( ConsoleIo $io = null ) {@inheritDoc}
change ( string $filePath, string $original, string $updated ) : boolean Store a change for a file
clear ( ) : void Clears the change log.
commit ( string $path = null ) : void Write staged changes
delete ( string $path ) : boolean delete
files ( array $excludes = [], boolean $reset = false ) : array Searches the paths and finds files based on extension.
move ( string $from, string $to ) : boolean move
source ( string $path ) : string Get the source of a file, taking into account that there may be incremental diffs

Protected Methods

Method Description
_getPath ( ) : string Get the path to operate on. Uses either the first argument, or the plugin parameter if its set.
_gitMove ( string $gitCd, string $from, string $to ) : void Moves files or folders using GIT.
_makeDir ( string $path ) : void Creates a directory/path.

Method Details

__construct() public method

{@inheritDoc}
public __construct ( ConsoleIo $io = null )
$io Cake\Console\ConsoleIo

_getPath() protected method

Get the path to operate on. Uses either the first argument, or the plugin parameter if its set.
protected _getPath ( ) : string
return string

_gitMove() protected method

Moves files or folders using GIT.
protected _gitMove ( string $gitCd, string $from, string $to ) : void
$gitCd string The `cd` command that changes into the files/folder parent directory
$from string The source path
$to string The target path
return void

_makeDir() protected method

Creates a directory/path.
protected _makeDir ( string $path ) : void
$path string The directory/path to create.
return void

change() public method

Store a change for a file
public change ( string $filePath, string $original, string $updated ) : boolean
$filePath string (unused, for future reference)
$original string
$updated string
return boolean

clear() public method

Clears the change log.
public clear ( ) : void
return void

commit() public method

If it's a dry run though - only show what will be done, don't do anything
public commit ( string $path = null ) : void
$path string file path
return void

delete() public method

delete
public delete ( string $path ) : boolean
$path string
return boolean

files() public method

Searches the paths and finds files based on extension.
public files ( array $excludes = [], boolean $reset = false ) : array
$excludes array
$reset boolean
return array

move() public method

move
public move ( string $from, string $to ) : boolean
$from string
$to string
return boolean

source() public method

Get the source of a file, taking into account that there may be incremental diffs
public source ( string $path ) : string
$path string
return string

Property Details

$_files protected property

Files
protected array $_files
return array

$_mkdirCommand protected property

mkdir command to use for creating folders/paths.
protected string $_mkdirCommand
return string

$_paths protected property

Paths
protected array $_paths
return array

$_staged protected property

Staged changes for processing at the end
protected array $_staged
return array