PHP code example of ec-europa / phpdrush

1. Go to this page and download the library: Download ec-europa/phpdrush library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ec-europa / phpdrush example snippets




$drush = new \PhpDrush\PhpDrush( '/local/path/to/drush', '/local/path/to/site' );

// run updb :

$drush->updateDatabase();

// run registry rebuild (rr) :

$drush->registryRebuild();

// run full feature revert :

$drush->featuresRevert();

// run selective feature revert :

$drush->featuresRevert(
    ['feature1','feature2','feature3']
);

// enable maintenance mode :

$drush->setMaintenanceMode(true);

// clear all caches :

$drush->clearCache();

// evaluate php code in the drush context
$drush->ev('echo "Hello world!"');