MAGENTO 1.X – HOW TO CREATE A STANDALONE SCRIPT


In some cases, you would need to create different kind of tasks or processes, regardless the Magento standard flow.

That is when you will need a standalone script, and that’s a simple example of how can we create one.

Create a new file inside root/shell directory called test_script.php with the following content:

Note: It’s mandatory to create the run() method inside our extended class.

Then, you can run your shell script, on your terminal, with the following command:


It would be helpful for you, visiting this following article, where i’m showing many useful code snippets that are pretty common inside Magento shell scripts: