1 / 11

ZendFrameworkで使うために Filemaker クラスをスクラッチから作ってみる

ZendFrameworkで使うために Filemaker クラスをスクラッチから作ってみる. 井上建事. カスタム WEB 公開. CDML やった XSLT 苦労したけどなんとか FX.PHP うう。。文字化けが。。。 APIforPHP 9しか無いんだよね( 8.5 なんです ) Zendframework で ?  → 今回のテーマ rfm(ruby) わからないけど同じ事やってそう. Zendframework. PHP の元が作ったWEBフレームワーク 昨年 l.0 になった 1 . 72が最新

peta
Download Presentation

ZendFrameworkで使うために Filemaker クラスをスクラッチから作ってみる

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ZendFrameworkで使うためにFilemakerクラスをスクラッチから作ってみるZendFrameworkで使うためにFilemakerクラスをスクラッチから作ってみる 井上建事

  2. カスタムWEB公開 • CDML やった • XSLT 苦労したけどなんとか • FX.PHP うう。。文字化けが。。。 • APIforPHP 9しか無いんだよね(8.5なんです) • Zendframeworkで? → 今回のテーマ • rfm(ruby) わからないけど同じ事やってそう

  3. Zendframework • PHPの元が作ったWEBフレームワーク • 昨年l.0になった • 1.72が最新 • Model/View/Controller • フロントコントローラー • index.phpで受けて処理 • /index/action/param1/hoge/param2/hagu • googleAPIyahooAPIDoJoとの連携 etc

  4. 制作目標=簡単 • 必要な機能のみ • 繰り返し項目とかは使ってないのでパス • 値一覧もこの際パス • 他のDBと同じコードで書ける • Oracle …基幹DB • PostgresSQL …地域連携DB • XML公開を利用 • 5以降のバ一ジョンで使える

  5. 制作目標=簡単 • CDMLより簡単 • 何せサーバーサイドでPHPが使える • 表示のときの設定がちょっと。。。 • テンプレートエンジンでも作らないと無理かも • APIforPHPよりも簡単 • YYYY/MM/DD実装済 • MVCでコードが書ける • カプセル化を一層進める • URLエンコード済み

  6. 使用方法 • ZFの(ディレクトリー)構造 • Application • Controllers プログラムの中心・コントロール • config.ini 制御ファイル • Models データベースを記述 • Views WEB表示部分の記述 • Library ここにFilemakerクラスを置く • Index.php 入り口

  7. 宣言 • Model • config.ini <?php Class Staff extends FilmakerPro9 { protected _table='staff'; protected _layout='レイアウト1'; } [FM6] fmdb.hostname = hostname.domain fmdb.port = 391 [FM9] fmdb.hostname = hostrname.domain fmdb.port = 80 あくまでも予定

  8. 定義 • Application/Controllers • index.php • 今は何もなし。予定ではconfigをクラス設定 <?php Class IndexController extends Zend-Controller-Action { function init() { require_once ‘FilemakerPro9.php’; Zend_Loader::loadClass(’Staff.php’);

  9. 実装 • コントローラーとモデル • 定義済み関数 • fetchAll($where) • update($recid, $record) • insert($record) • delete($recid) • duplicate($recid) • error() • count() • Recid/Modidはデータの配列に含む

  10. クラスの実装 • とにかくコードを読んでみて • fmp5で187行 • fmp7で289行 • ヒント • Zend_HTTP_Clientでク工リーを処理する • XMLReaderクラスで簡易に処理 • 日付処理は年が前になるようにするだけ • レイアウトのフィールドは全て連想配列に入る • ポータルは一段下の連想配列に格納

  11. Any questions? ご静聴ありがとうございました

More Related