この記事は はてなブログ から移行されました

rhaco2 超入門

PHPOSS

さあ、世界最強(*1)の PHP フレームワークの最新バージョン rhaco2 を一足早く体験してみましょう!

rhaco2 は 1 ファイルからスタート

rhaco.org にアクセスし、rhaco2 の download リンクを進むと、なんとダウンロードするファイルは setup.php のみ。

早速、アプリケーションを作成したいディレクトリに setup.php をダウンロードしてみます。

今回は、

/Users/riaf/tmp/rhaco2_hw/setup.php

にダウンロードし、このディレクトリを

http://localhost/hello_world

からアクセスできるようにシンボリックリンクを作成しています。

実践したい人は各自自分の環境に読み替えてみてください!

setup.php でサンプルコードをインストール

ブラウザからもセットアップできるらしいですが、ターミナル派な僕はさっそく、ターミナルで作業を開始します。

/Users/riaf/tmp/rhaco2_hw% php setup.php set or install[/Users/riaf/tmp/rhaco2_hw/rhaco/]: install application: org.rhaco.sample.hello_worldapplication url: http://localhost/hello\_worldworking directory [/Users/riaf/tmp/rhaco2_hw/work/]: template directory [/Users/riaf/tmp/rhaco2_hw/resources/templates]: media url [http://localhost/hello\_world/resources/media\]: template cache (Y / N) [N]: Yapplication handler cache (Y / N) [N]: Ydisplay log level (none / error / warning / info / debug) [none]: file log level (none / error / warning / info / debug) [none]: backup __settings__.php (Y / N) [N]: repository server (Y / N) [N]: create .htaccess (Y / N) [N]: /Users/riaf/tmp/rhaco2_hw% tree.|— __settings__.php|— index.php|— resources| `— templates| `— display.txt|— rhaco| |— __efuncs__.php| |— __funcs__.php| |— epl| | |— InfoClass.php| | |— InfoDef.php| | |— InfoDocTest.php| | |— InfoMethod.php| | |— Repository.php| | |— Setup.php| | `— Test.php| |— jump.php| `— spl| |— App.php| |— Cache.php| |— Command.php| |— Exceptions.php| |— File.php| |— FileIterator.php| |— Flow.php| |— Http.php| |— Lib.php| |— Log.php| |— Object.php| |— Paginator.php| |— Request.php| |— Tag.php| |— TagIterator.php| |— Template.php| |— Templf.php| `— Text.php|— setup.php|— vendors| `— org| `— rhaco| `— generic| `— setup| `— StandardSetup| |— StandardSetup.php| `— resources| |— media| | `— unembellished| | |— images| | | |— img01.jpg| | | |— img02.jpg| | | |— img03.jpg| | | |— img04.jpg| | | |— img05.jpg| | | |— shapeimage.png| | | `— spacer.gif| | `— style.css| `— templates| `— unembellished| |— index.html| |— test.html| `— tools.html`— work `— cache `— 20358047c661ccfed9f3849462672f4719 directories, 45 files

インストール完了です!(なげやり

早速 http://localhost/hello_world にアクセスすると、Hello World が出力されました!やったね!

サンプルアプリケーション

上記の例では、

install application: org.rhaco.sample.hello_world

として、リモートにあるサンプルアプリケーションをダウンロードしています。

このアプリケーションは他にも用意されており、こちらから検索できます

ぜひお試しあれ!!

*1: 確認はとれていません