Patrick Ward words, code, and music

Setting Up Magento From Within the Shell

Setting up Magento can be a pain sometimes, so when I’m starting a new extension or working on a new client site, I like to minimize that pain.

Because I’m a sucker for the command line shell, I also try to do as much as possible from within that environment. Thankfully, Magento provides the ability to install from the command line. I find installing from the shell to be less error prone and, in most cases, quicker.

So, these are the basic steps I take each time I need to install a Magento system. I’m assuming you’ve already created a new database in MySQL.

Sample Data

I keep a copy of the latest Magento sample data on hand. But, if you don’t have a copy, you’ll find it on their website in the community downloads section. Sample data is great for building new extensions as it provides you with a working store complete with products, categories, etc. However, it may not be appropriate if you’re working on a new client store.

If you are going to use sample data, it’s important that you install this into a new database before you run the Magento installation itself.

So, from the command line, I do a simple MySQL import:

mysql -uusername -p magento_dev \
< magento_sample_data_for_1.6.1.0.sql

Installing Magento

Next, I’ll tackle the installing of Magento. For that, Magento has several command line options that can be passed to the install.php file. Because I sometimes make mistakes and have to redo the installation, I’ll often just write the commands into a single install.sh file. This let’s me double-check the parameters and have a handly install script that can be used multiple times.

I tend to use all of the installation command line parameters with the exception of the database table prefix command. So, my install.sh file usually looks like this:

#!/bin/sh

php -f install.php -- \
--license_agreement_accepted yes \
--locale en_US \
--timezone "America/New_York" \
--default_currency USD \
--db_host localhost \
--db_name magento_dev \
--db_user root --db_pass root \
--url "http://mage.dev/" \
--use_rewrites yes \
--use_secure yes \
--secure_base_url "http://mage.dev/" \
--use_secure_admin yes \
--admin_lastname Admin \
--admin_firstname Magento \
--admin_email "magento@localhost" \
--admin_username admin \
--admin_password password101

I place this above the actual document root for the webserver, which makes installing Magento as simple as:

../install.sh

Indexing

Magento also has an indexer tool you can use from the command line. So, after I run the installation, I’ll immediately index the tables before I open the web interface. From within the Magento root directory, the following command will cd into the shell folder, index the tables, and return you to the root directory.

cd shell && php -f indexer.php reindexall && cd ..

That’s it!

I find this simple process to be the best way to install Magento, whether I’m in development or production. It’s simple, reproducible, and quick.

Operation Penguinate

For my second One Game a Month entry I made a fun little 2D platformer.

The premise is simple: Aliens have invaded Antarctica and imprisoned the penguins. Your mission: defeat the aliens and free the penguins!

The game play and idea was inspired by, and in some ways is a clone of, Dominic Szablewski’s game Biolab Diaster. However, it’s different enough that I think it has its own merit. I mean, it’s got penguins, aliens, and balloons. What more can you ask for?

This game took much longer to make than the previous game and provides a lot more in the way of the basics you would expect a video game to have:

  • a simple help screen
  • level selection (it also remembers the levels you’ve completed)
  • a simple scoring system
  • limited lives
  • first aid powerups (gain more lives)
  • simple enemy AI
  • multiple enemy types

The game starts off relatively easy, but quickly becomes more difficult as you progress through the levels, culminating in a rather difficult Level 5.

As with Stijl, this one was made with HTML5 and Javascript. If there is enough interest, I may port this to some mobile platforms (iOS, Android, Win8) as I think this would make a fun little mobile game.

I had a blast making (and playing) this one. So, I hope it brings you joy as well. Thanks for checking it out.

Stijl Take Two - A Game of Form and Color

I’ve been working on a few changes to my game Stijl that I created for the Ludum Dare #26 48-hour competition, including a better recording of my original guitar soundtrack.

I’m fairly pleased with the results. There is certainly more I could do, but I’m ready to move on and finish the other game that I’m working on.

A brief summary of the changes in the updated version of Stijl:

  • Updated and re-recorded music soundtrack
  • New sound effects
  • New levels and challenges
  • Mobile version for iOS and Android devices (visiting the game page with a mobile device will give you the option to play the mobile version)
  • A few bug fixes

The game concept and play remain the same as the original, but this is certainly a much nicer version.

Ludum Dare 26 Results

I entered the Ludum Dare game contest between April 26th-29th this year (2023). It was my first time competing in the competition. Although, the competition itself has been held since April of 2002.

Despite my anticipation and general lack of confidence going in, I have to say I had an absolute blast. It really opened my eyes to what a game jam competition could do for your self esteem and creativity. It was a real creativity booster for me. I figured there was no way that an older hacker like myself, using simple graphics and a homegrown guitar tune as a soundtrack, could compete against all those bright young stars out there, but I entered anyway.

After the competition, my game, Stijl ( found here ), seemed to be fairly well received at the time, but when I saw the results, I was blown away. I never thought I would have done that well, especially considering there were 1610 48-hour competition entries and 736 72-hour jam entries (2346 entries overall ). My game isn’t in the top 100, but it did make it to a very respectable place near the top. And what I thought was one of the weaker elements, my quick guitar doodle and simple sound effects for audio, ended up showing at #130 in the overall rankings. I’m humbled and pleased that it did so well.

The final results for my game can be found on the game’s ludum dare page, but I’ve listed them here as a reminder for myself as well. It’s a reminder to never count myself out, particularly when I don’t think I can do something.

Compo Ratings for Stijl

Out of 1,610 48-hour competition entries.

Rank Category Rating % Rank
#130 Audio 3.48 Top 8.07%
#207 Mood 3.47 Top 12.85%
#223 Overall 3.53 Top 13.85%
#224 Innovation 3.57 Top 13.91%
#261 Fun 3.33 Top 16.21%
#270 Theme 3.86 Top 16.77%
#300 Graphics 3.42 Top 18.63%
#655 Humor 2.09 Top 40.68%

My game even made it to a Best of Ludum Dare 26 list. That was a pleasant surprise too.

I’m working on a post-competition version of the game, with an expanded soundtrack, new puzzle levels, and some bug fixes. But, the core of the game remains the same.

This simple, 48-hour competition opened my eyes to the joy and challenge of a game jam, and it reawakened some of the excitement and creativity that drew me towards computer programming in the first place. So, I’ve decided to continue making games over the next few months and enter the One Game a Month challenge. My May game will be available here on this site and at my one game page within the next week.

I don’t expect my newfound passion for game development will lead to anything more than a creative spark, but that in itself is worth the effort.