Larry Ullman

Translating Geek Into English

Creating a Yii Console Application

I’ve spent the past couple of weeks developing a search engine for a Yii-based site (my problems and solutions specific to the search engine will be addressed in a separate post). As you may know, a search engine is really two things:

  1. One tool for creating the site index
  2. Another tool for searching the index and displaying the results

For both, I used the Zend_Search_Lucene module within Yii (or, I think that’s the route I’ll end up using). And although I initially created a Controller method for generating the index (per the instructions I sketched out in this other post), indexing a lot of content through a Web request is less than ideal. This particular site probably only has a hundred or more database records and a couple dozen files (PDFs) to be indexed, but the process still took a minute or two. Even if the index is only created or updated once a day or once a week, that’s still a lot of Web server resources being tied up. A better solution is to use a command-line script to create the index. Since most of the indexing requires a database connection and some Model information, I didn’t want to separate the indexing script from the Yii-based site. Fortunately, Yii supports command-line scripts by creating a “console application”. As with other things in Yii that are less common, the documentation on console applications is meager, but it was enough for me to go on. Here’s what you need to know…

“Learning the Yii Framework” Series Updated

Over the past two days I updated all eight posts in my “Learning the Yii Framework” series. The series was originally begun in June of 2009, starting with version 1.0.6 of Yii. A fair amount has changed since then, particularly the switch from using the command-line tool to using the Web-based Gii to generate code. So I reviewed all of the writing and code to make sure it was up-to-date with what users will see when developing with Yii today (current version: 1.1.4). The introduction of Gii was the largest change, although a while back Yii also switched from a “list” Controller method with a “list” View file to “index” and “index”; also “show” became “view”. And the Zii extension of widgets are now used extensively (um…pun).

Considering the popularity of this series, I’m not thinking of self-publishing a complete Yii guide (depending upon how I feel after self-publishing a JavaScript book).

What is Larry Thinking? #31 => E-Commerce, E-Commerce, and E-Commerce (and Nothing About Pigs)

In this edition…

About This Newsletter

For the past six weeks, all of my time, or as much as possible, has gone towards completing my “Effortless E-Commerce with PHP and MySQL” book. (This is why it’s taken me so long to get this newsletter out, for those of you that pay attention to such things.) But the book is essentially done now, so I can start thinking about, and doing, other stuff, like trying to get a newsletter out on a semi-regular schedule. Ironically, this newsletter ends up being largely about the e-commerce book. There’s an old adage that says, “Write what you know”. Well, I know a fair amount, but right now, my head is full of e-commerce! As always, thanks for reading and for your interest in my work!

Second E-Commerce Site for “Effortless E-Commerce with PHP and MySQL” Now Online

The second example site developed in my “Effortless E-Commerce with PHP and MySQL” book is now online. You can view it at http://ecom2.dmcinsights.com. This is a fully functioning site, at least in terms of what you learn how to do in the book. It is hooked up to a payment gateway (Authorize.net), in test mode. Test credit card numbers are listed for you to use. The code for the site can be downloaded from the book’s corresponding Web site. I’m going to figure out a reasonable way to make the administrative side of the site usable, too.

10 Sites Developers Should Have in Their Bookmarks

Some time back, I StumbledUpon this post: 10 sites developers should have in their bookmarks. I wasn’t familiar with many of them, but am now. I particularly like the MySQL Format Date site (something I’m always looking up), the .htaccess Editor (ditto), and test everything, which will do lots of stuff at once: validate the CSS and HTML, check SEO factors, and so forth. Most of the comments in response to the post are people similarly indicating surprise that they were unfamiliar with these bookmarks, but you’ll find some additional recommendations there as well.