February 26th, 2008

had a bit of a prob in my databases.yml – gotta put the the dbname at the end of the dsn. Yeah. Leave that off, and it gets very….confused.

So, now if I go to domain.com/frontend_dev.php/id/list, I get a symfony-looking page that lets me put stuff in.

Bad news, it didn’t build the pull-down for type. Rats! Back to docs…

First try, pulled the type off of the link field – Have a pull down! (Yes, I left off the symfony clear-cache and symfony propel-generate-crud frontend type Type Too bad, I’m just seeing the primary key values in the pull down. More searching…..

February 25th, 2008

…eeeee’s back!

So, I’m hanging out tonight, got Food Network in the background, and working on this db problem.

As you may recall from the last episode (more than a day ago, but work with me here), I was having issues getting the symfony config to connect to the database. After a few moments of exhaustive research, it looks like my problem was the user password. I….I…I… Naaah, that can’t be! Changed the password anyway, and my error message changed.

Now, the error looks like:
[propel-sql-exec] Failed to execute:

CREATE TABLE `dvd`
(
`type` VARCHAR,
`id` INTEGER NOT NULL AUTO_INCREMENT,
`starring` VARCHAR,
`id_starring` VARCHAR,
PRIMARY KEY (`id`)
)Type=InnoDB
[propel-sql-exec] Could not execute update [Native Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
`id` INTEGER NOT NULL AUTO_INCREMENT,
`starring` VARCHAR,
`id_starring` VAR' at line 3] [User Info:

So, I’m thinking there’s an error somewhere. Likely suspect is the schema.yml file. Since nothing appeared in the db, I’m thinking the unsuccessful statement was the one that actually *does* something. Ugh!

February 12th, 2008

At the end of day 2, I had built a DB schema in YAML, and symfony seemed to be reasonably comfortable with it, at least symfony propel-build-model didn’t toss up any errors.

But, symfony propel-build-all started griping about a mysql connection, so I’m thinking something isn’t right in my symfony config files.

Warning: SoapboxA personal note, I’m writing this from the Druid City Hospital’s Cath Lab waiting room. Evidently, DCH doesn’t allow SSH connections out. Grr^3. C’mon, folks, realize that of the few visitors with data devices, there is likely to be an admin who would really appreciate SSH or other access. Either provide Internet access or don’t. It’s not like SSH is bandwidth-intensive. Assuming a good security policy, it’s not a risk to devices inside the hospital. All blocking SSH does is annoy people like me who are actually trying to DO something while doing the “be there for a loved one” routine.End Soapbox.

Reading through (mt)’s docs, it looks like you’ve got to use internal-db.s###.gridserver.com (#’s replaced by your server number) for db connections. I’ve modified the ~/domains/domain.com/symfony/config for this name. Now to find some way to test …grr..no..SSH

Well, it looks like I’m out of luck. No SSH from the Hospital. Cell phone has got net access, but SSH doesn’t work on it for some reason. So, by reason of limited net access, today is going to be cut short. On the other hand, I’m going to play some Nintendo DS!

More evidence I’m a geek. Just couldn’t stop fiddling with SSH on the phone, now it’s working.

Gave it a symfony propel-build-all, no luck – properties file doesn’t exist. What?

February 10th, 2008

Well, from yesterday, we have web hosting, PEAR, and symfony installed.

Since data is the whole point of any application, I want to start this project with the Model part of MVC. Symfony uses YAML to define what the data will look like. One of the neat points of this framework is symfony’s ability to build the database from this YAML “sketch”.

For this DVD database, I would like to store the DVD type, title, and the leading actors/actresses. (Yes, I’m being a bit overly optimistic about HD disks making their way into the library anytime soon!) So, in my head, I’m going to need a table for type, another for titles, and another for actors.

In the type table, I want a primary key (just a serial number) and a bit of text describing the type. In SQL-eese, I would do this like this:

So, save all that to config/schema.yml, then (from the project directory) symfony propel-build-model, and experience our first problem. Symfony says schema.yml can contain only one DB entry. I’m assuming it’s referring to the 3 rows I was trying to add in one table. Ok, I can play this game, and remove the HD entries, then rerun the propel-build-model.

We now have a DB schema, which symfony recognizes and thinks it knows how to handle.

Boldly going… to symfony propel-build-all, looks good, right until the end. Looks like there is a problem connecting to mysql through a socket. It’s late, I’ve got traveling to do tomorrow, so I’m going to sign off for now.

February 9th, 2008

Quinn has gotten me interested in web development with Symfony. For those who don’t know, Symfony is a PHP framework which implements the Model-View-Controller (MVC) architecture. This system allows breaking development down into a model (data), view (web stuff), and controller (how to get and what to do with data once we get it).

For my first app, I’m going to develop an app that keeps track of DVDs. We have a decent collection, and have gotten to the point where we frequently ask the question “do we have this one?” when shopping. Since we both have PDA Phones, I think this will be a big help to us. (Truthfully, it’ll be a small, quick app for me to learn on, too)

I’ve gotten hosting through (mt) MediaTemple. Specifically, their (gs) Grid Service (hey, I’m not running anything as big as Tech-Recipes!)

For starters, in this service, PEAR needs to be set up. (mt)’s knowledge base tells you how to do this for their service, others may need different procedures. PEAR’s own instructions are here.

With PEAR up and running, it’s time to see what we can do with symfony. (mt)’s KB takes you through installing symfony into a directory, then linking (mt)’s default ~/domains/yourdomain.com/html to the symfony/web directory.

Once all of this is done, you should be able to point your web browser to http://yourdomain.com and get the wonderful “Symfony project created” welcome page. In my case, I got the page, but didn’t get the graphics. I needed to link the ~/domains/yourdomain.com/symfony/sf to the sf directory on the main installation point of symfony. In (mt) (gs), this is /home/users/.home/pear/data/symfony/web/sf