Properties

$drushLocation

$drushLocation : \PhpDrush\Drush

Type

\PhpDrush\Drush — location

$siteLocation

$siteLocation : \PhpDrush\Site

Type

\PhpDrush\Site — location

$noColor

$noColor : \PhpDrush\Enable

Type

\PhpDrush\Enable — or disable coloring in drush output By default disabled

$alias

$alias : string

Type

string — Alias to run commands on ( for targeting multiple sites )

Methods

__construct()

__construct(  $drushLocation,   $siteLocation,   $alias = null) 

Parameters

$drushLocation
$siteLocation
$alias

Throws

\PhpDrush\PhpDrushException

getUpDbStatus()

getUpDbStatus() : boolean

Throws

\PhpDrush\PhpDrushException

Returns

boolean

updateDatabase()

updateDatabase(boolean|true  $doubleCheck = true) : array

Run a database upgrade

Parameters

boolean|true $doubleCheck

Double check that updb did its job since rc code are for idiots (or sysadmins)

Throws

\PhpDrush\PhpDrushException

Returns

array

registryRebuild()

registryRebuild(boolean|false  $noCacheClear = false, boolean|false  $fireBazooka = false) : array

Runs a registry rebuild

Parameters

boolean|false $noCacheClear

Avoid clearing the cache after rr

boolean|false $fireBazooka

Fire a professional bazooka ... Yes ... A bazooka mtf!

Throws

\PhpDrush\PhpDrushException

Returns

array

featuresRevert()

featuresRevert(array  $featureList = array(), boolean|false  $force = false) : array

Parameters

array $featureList

List of features to revert

boolean|false $force

If true, pass the --force argument

Throws

\PhpDrush\PhpDrushException

Returns

array

setMaintenanceMode()

setMaintenanceMode(  $bool) : array

Set the maintenance mode for the site

Parameters

$bool

True to enable, False to disable

Throws

\PhpDrush\PhpDrushException

Returns

array

setVariable()

setVariable(  $key,   $value) : array

Set a variable name

Parameters

$key
$value

Throws

\PhpDrush\PhpDrushException

Returns

array

clearCache()

clearCache(string  $type = 'all') : array

Run a clear cache

Parameters

string $type

Type of cache to clean ( default : all )

Throws

\PhpDrush\PhpDrushException

Returns

array

enableModules()

enableModules(mixed  $modules) : array

Enable one or multiple modules

Parameters

mixed $modules

Either a string (single module) or an array

Throws

\PhpDrush\PhpDrushException

Returns

array

disableModules()

disableModules(mixed  $modules) : array

Disable one or multiple modules

Parameters

mixed $modules

Either a string (single module) or an array

Throws

\PhpDrush\PhpDrushException

Returns

array

uninstallModules()

uninstallModules(mixed  $modules) : array

Uninstall one or multiple modules

Parameters

mixed $modules

Either a string (single module) or an array

Throws

\PhpDrush\PhpDrushException

Returns

array

ev()

ev(  $toEval) : array

Eval PHP code in current drush session

Parameters

$toEval

Throws

\PhpDrush\PhpDrushException

Returns

array

userLogin()

userLogin(null  $user = null, null  $path = null) : string

Get logged in URL

Parameters

null $user

User to log into

null $path

Path to log into

Throws

\PhpDrush\PhpDrushException

Returns

string —

URL

updatePassword()

updatePassword(  $authname,   $password) : array

Update password for user by auth name

Parameters

$authname
$password

Throws

\PhpDrush\PhpDrushException

Returns

array

validateDrushOutput()

validateDrushOutput(array  $output) : boolean

Check drush output to handle drush [error]

Parameters

array $output

Throws

\PhpDrush\PhpDrushException

Returns

boolean

setColoring()

setColoring(  $color) 

Enable/disable coloring drush output

Parameters

$color

userAdd()

userAdd(  $username,   $mail = null,   $password = false) : array

Add user

Parameters

$username
$mail
$password

Throws

\PhpDrush\PhpDrushException

Returns

array

userAddRole()

userAddRole(  $username,   $role) : array

Add role to user

Parameters

$username
$role

Throws

\PhpDrush\PhpDrushException

Returns

array

getVariable()

getVariable(  $variable) : string

Get variable value

Parameters

$variable

Throws

\PhpDrush\PhpDrushException

Returns

string

sqlQuery()

sqlQuery(  $query) 

Run SQLQuery

Parameters

$query

redisFlushDB()

redisFlushDB() 

Flush Redis DB

Remove all keys from the current database

Throws

\PhpDrush\ErrorResponseException

runDrush()

runDrush(  $arguments) : array

Run a drush command and throws an exception if failing

Parameters

$arguments

Argument to pass to drush as a string

Throws

\PhpDrush\PhpDrushException

Returns

array —

An array of all the lines returned by drush (including PHP warnings/errors)

getRedisClient()

getRedisClient() 

Get redis-cli