Solving Magento

Solutions for Magento E-Commerce Platform

by Oleg Ishenko

Quickly Create Magento Module Structure with a Powershell Script

Your work on a new module usually begins with a tedious task of creating the basic folder structure. You go to your app folder, cd to code, then to local, then to you working package directory. You add module folder and then etc, Block and Helper. Before you actually get to programming you logic you have to add and edit config.xml, helper.php. And when you are done and ready to fire the first test you remember you forgot to add an xml module file to app/etc/modules.

Sounds familiar? But you are a programmer; so why not try to solve this problem like a programmer?

Its fairly easy to write a shell script for Linux that would do all this dull work for you. But for those who work in Windows (I do) automating this task would mean diving into decades old DOS scripting to create a bat file. Fortunately there is a better alternative: PowerShell. This object oriented scripting framework was first introduced in 2006 and since then had evolved into an incredibly nifty tool for every advanced Windows user.

After some tinkering I was able to produce a script that offers GUI to enter destination app folder, package and module names and creates the basic folder structure and essential files in no time. No installation required: download, unzip, and double-click!

Download it now, its free to use, modify and distribute:

 

Readers who read this post also read these:

  • Magento Global Functions
    http://www.divisionlab.com/solvingmagento/n normally includes the names of a controller and its action (command). The path can be first checked for a URL-rewrite, for example, in web applications t...
  • Adding Custom Options to Products in Magento
    In my post A Magento File Custom Option Type Primer I’ve talked about how file custom product options are handled in Magento. One of the readers posted a comment there asking if there was an altern...
  • Symbolic Links
    It is surprising how many people don't know about symbolic links and do not realize how useful they can be. For instance you are running a test server with multiple instances of out shop configured...
  • Using Macros for Apache Virtual Hosts Configuration for Magento Multistore Environment
    When working with a multistore environment it is often necessary to setup several virtual hosts whose configuration is essentially the same apart from one or two settings. Instead of copying and pa...

Leave a Reply

Your email address will not be published. Required fields are marked *

Theme: Esquire by Matthew Buchanan.