PHP code example of steverobbins / magento-shell

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

    

steverobbins / magento-shell example snippets




 Local_Shell_MyScript extends Local_Shell_Abstract
{
    public function run()
    {
        $this->log->debug('Hello World!');
    }
}



 Local_Shell_MyScript extends Local_Shell_Abstract
{
    public function run()
    {
        $collection = Mage::getModel('catalog/product')->getCollection();
        $count      = $collection->count();
        $bar        = $this->progressBar($count);
        $i          = 0;
        foreach ($collection as $product) {
            $product->setDescription(strip_tags($product->getDescription()))
                ->save();
            $bar->update(++$i);
        }
        $bar->finish();
    }
}