PHP code example of staempfli / magento-symfony-console

1. Go to this page and download the library: Download staempfli/magento-symfony-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/ */

    

staempfli / magento-symfony-console example snippets


    <default>
        <staempfli_console>
            <commands>
                <unique_key>vendorname_packagename/console_sampleCommand</unique_key>
            </commands>
        </staempfli_console>
    </default>
    

    

    use Symfony\Component\Console\Input\InputInterface;
    use Symfony\Component\Console\Output\OutputInterface;

    class VendorName_PackageName_Model_Console_SampleCommand extends Staempfli_Console_Model_Command
    {
        protected function configure()
        {
            $this->setName('command:name')
                ->setDescription('Command Description')
                ->setHelp("Help Help!");
        }

        protected function execute(InputInterface $input, OutputInterface $output)
        {
           // ... Your actions here
        }
    }