Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AutomaticTranslationCommand
  • ConsoleFormatterUtil
  • CronCommand
  • CryptSetupCommand
  • DummyCommand
  • ExportFixtureCommand
  • MigrateCustomCommand
  • SampleDataCommand
  • UpdateCommand
  • UpdaterPackageCommand
  • Overview
  • Package
  • Class
  • Tree

Class MigrateCustomCommand

Update/migrate custom code from the "custom" folder using Git.

Notes: (1) This command requires a Unix-like shell environment with rsync and git installed in it in order to run properly. (2) The Git repository must be up-to-date and have tags corresponding to the versions updating to and from. (3) This script will not work properly if the git repository is a clone of the public repository found on Github, and if using Professional Edition. Otherwise, if using Open Source Edition, this script should work with a clone of that repository (assuming the clone has all version tags). (4) Since controller classes only extend their base-code analogues, and do not fully copy/replace them, they are ignored by this whole process. Updating them should just be a matter of updating only the methods that were overridden, if any, instead of the entire file.

CComponent
Extended by CConsoleCommand
Extended by X2ConsoleCommand
Extended by MigrateCustomCommand
Package: application\commands
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/commands/MigrateCustomCommand.php
Methods summary
public
# actionUpdate( string $origin, string $target, string $source = null, string $gitdir = null, string $branch = null, mixed $nocopy = 0 )

Updates the custom code.

Updates the custom code.

If it can automatically merge, and if there are no merge conflicts, it will copy the files back into the source folder.

Parameters

$origin
string
$source Path to the custom code folder.
$target
string
$origin The version of the X2Engine installation at which it was customized. In other words, the version from which X2Engine is being updated.
$source
string
$target The target version to which the X2Engine customizations will be updated.
$gitdir
string
$gitdir The directory
$branch
string
$branch Name of branch to use for merging upstream changes into the custom code
$nocopy
public
# actionCopy( string $origin = null, mixed $target = null, mixed $source = null, mixed $gitdir = null, mixed $branch = null )

Copies the current source files onto analogues found in the git directory.

Copies the current source files onto analogues found in the git directory.

Parameters

$origin
string
$source Path to the source (custom folder)
$target
$source
$gitdir
$branch
public
# branchExists( )
public
# cleanUp( )

Removes the persist file and deletes the temporary branch.

Removes the persist file and deletes the temporary branch.

public
# copyBack( )

Copies the custom code from the git repository back into the original folder, overwriting originals.

Copies the custom code from the git repository back into the original folder, overwriting originals.

public
# copyForth( )
public
# debug( type $msg )

Displays debugging messages

Displays debugging messages

Parameters

$msg
type
$msg
public
# end( mixed $cleanUp = false )
public
# git( string $command, boolean $echo = true, boolean $embolden = true )

Opens a git subprocess in the git directory.

Opens a git subprocess in the git directory.

Parameters

$command
string
$command Git command to run
$echo
boolean
$echo Whether to echo (true) or suppress (false) any output from the command.
$embolden
boolean
$embolden Whether to embolden error output and turn it red.
public type
# sys( type $command, boolean $cwd = null, boolean $echo = true, mixed $embolden = true )

Run a system command, echo its output.

Run a system command, echo its output.

Parameters

$command
type
$command
$cwd
boolean
$echo Whether to echo (true) or suppress (false) any standard output from the command.
$echo
boolean
$embolden Whether to embolden error output and turn it red.
$embolden

Returns

type
public string
# getDefaultSource( )

Gets the default source path, which is guaranteed to exist more or less

Gets the default source path, which is guaranteed to exist more or less

Returns

string
public type
# getBranch( )

Getter for {@branch}

Getter for {@branch}

Returns

type
public array
# getFileList( )

Getter for fileList

Getter for fileList

Returns

array
public string
# getGitdir( )

Getter for gitdir

Getter for gitdir

Returns

string
public string
# getRsync( )

Getter for rsync

Getter for rsync

Returns

string
public string
# getSource( )

Getter for source

Getter for source

Returns

string
public
# initParams( array $params )

Sets properties initially

Sets properties initially

Parameters

$params
array
$params
public
# restoreParams( type $params = array() )

Uses parameters saved to the persistence file during the current operation

Uses parameters saved to the persistence file during the current operation

Parameters

$params
type
$params Optional parameters to override old saved parameters.
public
# saveParams( )

Saves parameters to the persistence file.

Saves parameters to the persistence file.

public
# setBranch( string $value )

Setter for branch

Setter for branch

Parameters

$value
string
$value
public
# setGitdir( string $value )

Setter for gitdir

Setter for gitdir

Parameters

$value
string
$value
public
# setSource( type $value )

Setter for source

Setter for source

Parameters

$value
type
$value
public
# validPath( mixed $value, mixed $name )
Methods inherited from X2ConsoleCommand
formatter(), headerMsg()
Methods inherited from CConsoleCommand
__construct(), afterAction(), beforeAction(), behaviors(), buildFileList(), confirm(), copyFiles(), ensureDirectory(), getCommandRunner(), getHelp(), getName(), getOptionHelp(), init(), onAfterAction(), onBeforeAction(), pluralize(), prompt(), renderFile(), resolveRequest(), run(), usageError()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
integer DEBUG 0
#
string PERSIST_FILE '.x2_git_migrate.json'
#
Properties summary
public string $origin
#

The version from which the custom code is being updated.

The version from which the custom code is being updated.

public string $target
#

The version to which the custom code should be updated.

The version to which the custom code should be updated.

Properties inherited from CConsoleCommand
$defaultAction
Magic properties summary
public string $branch
#

The name of the temporary branch that will be used for merging and updating custom code.

The name of the temporary branch that will be used for merging and updating custom code.

public array $fileList
#

List of custom files to be copied.

List of custom files to be copied.

public string $gitdir
#

The directory of the git repository. If unspecified, it is assumed to be one level above the web root.

The directory of the git repository. If unspecified, it is assumed to be one level above the web root.

public string $rsync
#

Default rsync command to use for synchronizing files.

Default rsync command to use for synchronizing files.

public string $source
#

The path to the custom folder. If unspecified, it is assumed that it is the custom folder inside the current installation.

The path to the custom folder. If unspecified, it is assumed that it is the custom folder inside the current installation.

Magic properties inherited from CConsoleCommand
$commandRunner, $help, $name, $optionHelp
X2CRM Documentation API documentation generated by ApiGen 2.8.0