Log in

Sign in with your email address and password:

No account? Sign up here.
Forgot your password? Reset it here.
Didn't receive account confirmation email? Request a new one.

Hello Magento: How To Create a Custom Shell Script

Creating a custom Magento shell script is useful for many reasons: you may want to process CSV files, run scripts to update orders periodically (cron scripts) or a host of other things. Personally I use it during Magento development, to help debug things easy and quickly.

Hello Magento: How To Create a Custom Shell Script

We will create a simple shell script to demonstrate how this is done.

Creating The Magento Shell Class

Within the folder ‘app/shell’ folder, create a file called ‘custom.php’.


Running The Custom Magento Shell Script

Run the script by invoking it with the PHP command. As you can see, providing a command line option of ‘example’ will execute the piece of code above otherwise usage help will be displayed. Update the script according to your own needs – the sky is the limit!

Submit a Comment