symfony1.1 beta3を導入してみる
ちょっと試しにローカル環境に導入してみました。
導入にはPEARからインストールせず、サクっと試せるsf_sandboxを利用してます。
sf_sandboxは必要なライブラリとか全部込みでワンパッケージ化されていて、webルートディレクトリに置けばそのまま動く便利モノです。sf_sandboxの詳細は原文を参照したので参考に。
The sandbox
The sandbox is an empty symfony project where all the required libraries are already included, and where the basic configuration is already done. It is made for symfony beginners, who want to play with the framework or try the tutorials without installing anything.
You can download a sandbox sf_sandbox.tgz. Unpack it in your root web directory. Refer to the included readme file for more information.
After downloading the sandbox, you might want to follow the My first project tutorial to discover the basics of symfony development.
http://www.symfony-project.org/installation/1_1
この後やった手順は順に、
と、普通のセットアップ手順になります。セットアップ完了後、http://localhost/にアクセスしたSSが下記です。
1.0の時と同じデフォルト画面。変わってるかなと期待してたので残念。
sf_sandboxのディレクトリ構成を見てみます。下記リストがディレクトリ構成になってます。
- LICENSE
- README
- apps/
- frontend/
- config/
- i18n/
- lib/
- modules/
- templates/
- frontend/
- cache/
- config/
- data/
- symfony/
- bin/
- web/
- symfony/
- doc/
- lib/
- log/
- plugins/
- symfony
- symfony.bat
- test/
- web/
- css/
- frontend_dev.php
- images/
- index.php
- js/
- robots.txt
- sf/
- uploads/
ザッと見た感じディレクトリの構成は1.0からの変更はなさそう。
ディレクトリ構成を眺めた雑感をまとめると、
- libとdataディレクトリにsymfonyのCoreライブラリがガッツリ入ってる
- サンプルはapp名がお決まりのfrontend
- prototype.jsが1.6.0.2、script.aculo.usが1.8.1にアップデート
試しにsf_sandboxのプロジェクトルートで下記コマンドを実行。
./symfony -V symfony version 1.1.0-BETA3 (/var/www/sf_sandbox/lib/symfony)
ちゃんと1.1.0-BETA3で動いてます。
コレsymfonyはインストールしなくてパッケージ化できるよ、って事なのでアピールポイントになるんじゃないのかな。jarみたいに置いてwebサーバの設定だけでOKですよ!みたいな。
まぁ、どのフレームワークでもパッケージングはやろうと思えばできるから同じか。
app名がfrontendとわかったのでdev環境でdebugバーを表示させてみました。
これも特に1.0から変わりなし。次にvars&configをクリックしてみました。
項目が増えてます。中身も見ると表示の仕方が変わっていてスッキリしていました。
気になった点を箇条書きでつらつらと挙げておきます。
- configuration
- tokenizerが追加されてる
- request variables
- RequestのattributeHolderにformatsパラメータがデフォで入ってる
parameterHolder: action: index module: default attributeHolder: formats: { txt: text/plain, js: [application/javascript, application/x-javascript, text/javascript], css: text/css, json: [application/json, application/x-json], xml: [text/xml, application/xml, application/x-xml], rdf: application/rdf+xml, atom: application/atom+xml }
-
- Responseのjavascripts, stylesheetsにfirst, lastという項目がある
options: logging: '1' charset: utf-8 cookies: { } httpHeaders: Content-Type: 'text/html; charset=utf-8' javascripts: first: { } '': { } last: { } stylesheets: first: { } '': { main: { } } last: { /sf/sf_default/css/screen.css: { } } metas: robots: 'index, follow' httpMetas: Content-Type: 'text/html; charset=utf-8'
-
- Userが追加されてる
options: auto_shutdown: false culture: null default_culture: en use_flash: true logging: '1' timeout: 1800 attributeHolder: { } culture: en
cookie: symfony: 66d52c93923612380f8c6ade58b4df70 env: LANG: C PATH: '/usr/local/bin:/usr/bin:/bin' PWD: /var/www/sf_sandbox SHLVL: '1' _: /usr/sbin/apache2 files: { } get: { } post: { } server: DOCUMENT_ROOT: /var/www/sf_sandbox/web GATEWAY_INTERFACE: CGI/1.1 HTTP_ACCEPT: 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' HTTP_ACCEPT_CHARSET: 'Shift_JIS,utf-8;q=0.7,*;q=0.7' HTTP_ACCEPT_ENCODING: 'gzip,deflate' HTTP_ACCEPT_LANGUAGE: 'ja,en-us;q=0.7,en;q=0.3' HTTP_CONNECTION: keep-alive HTTP_COOKIE: symfony=66d52c93923612380f8c6ade58b4df70 HTTP_HOST: 'localhost:8000' HTTP_KEEP_ALIVE: '300' HTTP_USER_AGENT: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14' PATH: '/usr/local/bin:/usr/bin:/bin' PATH_INFO: / PATH_TRANSLATED: /var/www/sf_sandbox/web/index.php PHP_SELF: /frontend_dev.php/ QUERY_STRING: '' REMOTE_ADDR: *.*.*.* REMOTE_PORT: '****' REQUEST_METHOD: GET REQUEST_TIME: 1208829098 REQUEST_URI: /frontend_dev.php/ SCRIPT_FILENAME: /var/www/sf_sandbox/web/frontend_dev.php SCRIPT_NAME: /frontend_dev.php SERVER_ADDR: *.*.*.* SERVER_ADMIN: webmaster@localhost SERVER_NAME: localhost SERVER_PORT: '****' SERVER_PROTOCOL: HTTP/1.1 argc: 0 argv: { } session: symfony/user/sfUser/attributes: { } symfony/user/sfUser/authenticated: false symfony/user/sfUser/credentials: { } symfony/user/sfUser/culture: en symfony/user/sfUser/lastRequest: 1208829073
- Phpのインストール済みライブラリにバージョン番号が出るようになってるモノがある
とりあえずここまで。1.1は外見的には1.0からそんなに変わってる印象はありませんでした。