PHP code example of mouf / utils.console

1. Go to this page and download the library: Download mouf/utils.console 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/ */

    

mouf / utils.console example snippets


use Mouf\Actions\InstallUtils;
use Mouf\Console\ConsoleUtils;
use Mouf\MoufManager;

...
// Let's create an instance of "ConsoleUtils"
$consoleUtils = new ConsoleUtils($moufManager);

// We declare our instance of the Symfony command as a Mouf instance
$dbalRunSqlCommand = InstallUtils::getOrCreateInstance('dbalRunSqlCommand', 'Doctrine\\DBAL\\Tools\\Console\\Command\\RunSqlCommand', $moufManager);

// We register that instance descriptor using "ConsoleUtils"
$consoleUtils->registerCommand($dbalRunSqlCommand);