Do You PHP はてブロ

Do You PHPはてなからはてブロに移動しました

Symfonyを始める

今更ながら、WEB+DB PRESS vol.33にあるSymfonyの記事を試してみた。

WEB+DB PRESS Vol.33

WEB+DB PRESS Vol.33

インストールしたバージョンは0.7.1914。まだ触り程度ですが、「お決まり作業」をコマンドである程度可能なのは便利ですな。
で、

$ symfony propel-build-schema

でschema.xmlが作成され・・・されね〜!
Symfony本家のweblogを漁ってみると、


We thought that, for a framework trying to be as simple as possible, it was not the best we could do. As a matter of fact, quite a number of symfony beginners were afraid about its configuration specifically because of this XML file. Some of them were even caught quitting at that point, when they thought that learning a new syntax for schema files was too much for a first try.
So we made it possible to write database schemas in YAML format. You know how we like this format: It's easy to read and write, it's simple to understand, and it's fun.

           :

Nothing more. Save this into a schema.yml file in your project config/ folder, then run

$ symfony propel-build-model

...and the Propel model classes are generated just as before.

ということで、YAML形式のschema.ymlに変わったらしい。これに2時間ぐらいハマリました :-(