PHP code example of eserozvataf / scabbia2-tasks

1. Go to this page and download the library: Download eserozvataf/scabbia2-tasks 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/ */

    

eserozvataf / scabbia2-tasks example snippets


namespace MyProject;

use Scabbia\Tasks\TaskBase;
use Scabbia\Formatters\FormatterInterface;

class MyTaskTask extends TaskBase {
    public function executeTask(array $parameters, FormatterInterface $formatter) {
        $formatter->write('task is executed, with parameters:');
        $formatter->writeArray($parameters);
    }

    public function help(FormatterInterface $formatter) {
        $formatter->write('help');
    }
}

use Scabbia\Tasks\Tasks;

Tasks::run('myProject:myTask', ['parameter1', 'parameter2']);

use Scabbia\Tasks\Tasks;

Tasks::$namespaces[] = 'MyProject';