Join us in Dallas, TX! Tickets are now available for Laracon US.
質問があればお気軽にコメント欄へお願いします!(只今、作成中です) 以下は、10-15分で発表する予定の内容です。 比較表 名称 URI ライセンス 対応する PHP 最新バージョン stable releases 開発元 FuelPHP http://fuelphp.com MIT 5.3 or newer 1.3 コミュニティ CodeIgniter http://codeigniter.com CodeIgniter License 5.1.6 or newer 2.1.3 アメリカのEllisLab CakePHP http://cakephp.org MIT 5.2.8 or newer 2.2.2 アメリカのCakeソフトウェア財団 Symfony http://symfony.com MIT 5.3.2 or newer 2.1.2 フランスのSensio社 Roadmap
メリークリスマス! PHP Advent Calendarもいよいよ24日目に突入です。 昨日はxhprofについてでしたね。僕もパフォーマンスチューニングの際に使っています。手軽に利用できるのでお勧めです。 さて、このエントリーでは表題の通りMVCについて書かせていただきます。これは、PHPカンファレンス2012&WordCamp Tokyo2012合同LT大会で発表した「やはりお前らのMVCは間違っている」で煽るだけだったこの問題をきちんと解説するものです。 この発表資料を公開するとPHPの枠を超えて広く閲覧いただき*1、また多くの方から突っ込みを戴きました。「LTだから」と言って逃げていた回答をして、気持ち新たに新年を迎えようと思います。 MVCとはなんなのか 間違いを指摘する前にMVCがそもそもどういうアーキテクチャであるのかを確認しなければいけません。 MVCは1970年代にパロ
自分自身も気になってはいたのですが、試してみるきっかけがなく今に至ってしまいました。現在のプロジェクトではviewは関わらないのですが、それまではSmarty2を使っていました。Smarty3や他テンプレートエンジンも気になるところですが、次はTwigがくるだろうと勝手に予測しています。 簡潔に書ける テンプレート指向文法である 自動エスケープなど必要なものをすべてサポートしている 文法を簡単に学習できる(※他テンプレートエンジンはPHP4ベースで作られていたりして、web開発においてベストプラクティスとして採用できない。) 高い拡張性で独自DSLも作れる ユニットテストされているのでライブラリは堅牢で、大きなプロジェクトにもすぐに使える。 ちゃんとドキュメント化されている: セキュリティでは自動出力エスケープやsandboxモードによって安全性を確保 詳細なエラーメッセージでデバッグもカ
DoctrineはPDOを使用しています。PDOはSELECT句を実行すると1次元の配列で値が取得できます。この配列をDoctrineのオブジェクト、もしくはオブジェクトと同様に階層化された配列に変換することをDoctrineではHydration(ハイドレーション)と呼んでいます。ちなみにhydrateとは「潤いをあたえる」とかそんな意味だったと思います。 このHydrationはDoctrineのORマッピングの中でもとても重要な部分です。Doctrineの内部にはDoctrine::HYDRAETE_で始まる定数(Hydration mode)が3種類定義されています。 HYDRATE_RECORD オブジェクトへのHydration(デフォルト) HYDRATE_ARRAY 階層化された配列へのHydration HYDRATE_NONE そのままの値 PDO::FETCH_NUM
autoloadのオーバーヘッドはどれぐらい? モダンな実装のフレームワーク類には,かなりの割合で用意されているautoloadですが,require&require_once天国と比べてオーバーヘッドはどの程度変化しているのかと疑問に思って調べてみました. 不規則に何度も呼ばれる可能性があるばあいの,require_onceとの比較が中心です. サンプル処理 いくつかの方法でクラスファイルを読み込むようにし,ダミーのインスタンスを1000回生成します.ぐるんぐるんです. autoloadする autoloadの処理がカラッポだとズルいので,適当なダミー処理を挟んでいます. <?php function autoload($className) { $chunks = explode('_', 'Dummy_Sample_Class_Name'); $path = implode('/',
Jenkins × PHP環境構築 08��rU �i��rU Jenkins × PHP環境構築の巻 ■目的 PHP環境に対応したJenkins設定を行い、 コミットされる度にサーバ上でのPHPUnitの実行 及び カバレッジレポート出力を"全自動"で行えるようにすること。 1) PHP Pear系のインストール sudo pear channel-discover pear.phing.info sudo pear channel-discover pear.pdepend.org sudo pear channel-discover pear.phpmd.org sudo pear channel-discover pear.phpunit.de sudo pear channel-discover components.ez.no sudo pear channel-discove
これまでJenkins+PHPで色々な処理を自動化させてきたので、今までの記事をまとめてみました。 さくらVPSにjenkinsを入れてみたときの備忘録 jenkinsで新規ジョブを作成して、Subversionと連携してみる Phingをjenkinsと連携させてみる jenkinsでCheckstyle pluginを利用して、CakePHPのコーディング規約をチェックする PHPMD(PHP Mess Detector)をjenkinsで利用してみる PHPCPDとjenkinsを利用して、冗長化したコードを検出してみる jenkinsにPHPDocumentor2を連携させてみる CakePHP2.X+PHPUnit+jenkinsでテストを自動化する ここまでの処理をまとめたビルドファイルもgithubのほうにアップしています。 myPhingBuildXml – github
2012-11-09 FuelPHPをやってみる (6) - モデルテストとモック - PHP FuelPHP テスト 例えば以下のようなモデルクラスがあった場合 fuel/app/classes/model/items.php <?php class Model_Items extends \Model_Crud { protected static $_table_name = 'items'; public static function findById($id) { $entry = null; try { $entry = static::find_one_by('id', $id); } catch (Database_Exception $e) { Log::warning($e->getMessage()); } return $entry; } } まぁ単純にID値から
これはPHPを愛する者達の魂が宿りし検定。 攻略した者はPHPマスターと呼ばれるのだ。 世はソーシャル全盛、大PHP時代! あなたもPHP検定でPHPを極めましょう! 全国1000万人のPHPerのみなさん、こんにちは。 本日は弊社インフィニットループより “あの「Vim検定」“に続き検定シリーズ第二弾として企画されました Android,iPhone両対応アプリ「PHP検定」が リリースされましたことをお知らせいたします! インフィニットループはPHPエンジニアを多数抱えることもあり、 ご用意させていただきました問題数と難易度の高さに 弊社としても大きな自信を持っています! 「Vim検定」と同様に 今後は問題のアップデート配信も予定していますので、 PHPerの皆さんは是非挑戦してみてください! アプリの詳細については、こちらのPHP検定公式サイトをご参照下さい。 iPhone, And
昨日の cakephper さんの「FuelPHPでMongoDBを使う」に続きまして、今日は FuelPHP Advent Calendar 2011 10日目です。 ちなみに、ビューは app/classes/views じゃなくて app/views に置くのは、ビューがクラスではないからだと思います。 FuelPHP には、Rails のようなデータベースマイグレーション機能があります。データベースマイグレーションとは、マイグレーションファイルにテーブルの定義を記録して管理する機能です。マイグレーションを使うことでテーブルの変更をフレームワークの枠内で管理することができます。 マイグレーションは oil コマンドを使用します。コマンドの基本的な使い方は以下のようになっています。 oil generate migration <migrationname> [<fieldname1>
switch の case 文の比較は型を考慮しません。 比較演算子 == と同様の挙動です。 下記サンプルコードをご覧ください。 <?php function hoge($v) { switch ($v) { case '1': // 文字列の1 $ret = 'string: 1'; break; case 1: // 数値の1 $ret = 'integer: 1'; break; } return $ret; } $v = 1; var_dump(hoge($v)); $v = '1'; var_dump(hoge($v)); 結果 string(9) "string: 1" string(9) "string: 1"
以前、Gmailよりメールを取得し、データベースへ反映する機能の構築を実装したのでメモしておきます。はじめに、Gmailの設定でimapが有効になっていることを確認する。imapが有効になっていない場合は、有効にします。 imap関数の詳しい情報はPHP: IMAP - Manualを参考に! <?php // 必要な定数を設定 define('GMAIL_HOST','imap.googlemail.com'); define('GMAIL_PORT',993); define('GMAIL_ACCOUNT','アカウント名'); define('GMAIL_PASSWORD','パスワード'); define('SERVER','{'.GMAIL_HOST.':'.GMAIL_PORT.'/novalidate-cert/imap/ssl}'); // メールボックスへの IMAP ス
FuelPHPはエラーメッセージが不親切 oilコマンドを叩いたらこのようなエラーメッセージが出て動きませんでした ~~~ $ oil –help This is not a valid Fuel installation so Oil is a bit lost. http://fuelphp.com/docs/installation/instructions.html ~~~ Instruction – Installation – FuelPHP Documentationにあるとおりにコマンドを実行した場合 ~~~ $ curl get.fuelphp.com/oil | sh $ oil create blog ~~~ blogディレクトリ配下はこうなります ~~~ drwxr-xr-x 14 user 476 7 16 10:21 . drwxr-xr-x 4 user 13
「iPhoneとツイッターで会社は儲かる」がAmazonで販売開始され、 EC studioでは様々なプロモーション活動を行っております。 プロモーションの効果測定をするために、Amazonの商品ページへアクセスして Amazonの中で現在何位なのか順位チェックを行っていましたが、 面倒くさくなったので自動ランキング取得システムを作成しました。 今回はAmazon APIを使って、簡単にAmazonの商品情報(ランキング)を 取得する方法をご紹介いたします。 今回の完成品 こんな感じでAmazonの商品情報を取得できます。 [ 使用サービス ] ※無料 ・Amazon API ・PEARのServices_Amazonライブラリ ※Amazon API とは AmazonアソシエイトWebサービスが提供する「Product Advertising API」のこと Amazonの商品情報や関
追記 DB接続時にcharset=utf8を指定 bindValueで暗黙の型変換されないように変更 Pimpleをサービスロケータとして使う場合の注意点を追加 テンプレートとしてフラットなPHPからTwigで書いた場合を追加 前提 スクリプト、ファイル、DBの文字コードはすべてUTF-8で統一です。 また、最初に以下のMySQLのテーブルがあることを前提として記事を書いています。 Database: MySQL user: myuser password: mypassword CREATE TABLE `blog_db`.`post` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `body` text NOT NULL, `date` date NOT NULL, PRI
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く