<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lllnorikolll@online &#187; ZendFramework</title>
	<atom:link href="http://blog.lllnorikolll.com/archives/category/zendframework/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.lllnorikolll.com</link>
	<description>オンライン - WEBアプリケーション開発関連のメモなど</description>
	<lastBuildDate>Sat, 15 Oct 2011 05:08:36 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Secure Programming with the Zend Framework</title>
		<link>http://blog.lllnorikolll.com/archives/310</link>
		<comments>http://blog.lllnorikolll.com/archives/310#comments</comments>
		<pubDate>Wed, 17 Jun 2009 00:31:08 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[dpcon]]></category>
		<category><![CDATA[ZF]]></category>
		<category><![CDATA[セキュリティ]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=310</guid>
		<description><![CDATA[Dutch PHP Conferenceのスライドが公開されたようです。 http://www.suspekt.org/2009/06/16/dutch-php-conference-the-slides/ 中でも気にな [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phpconference.nl/" target="_blank">Dutch PHP Conference</a>のスライドが公開されたようです。</p>
<p><a href="http://www.suspekt.org/2009/06/16/dutch-php-conference-the-slides/" target="_blank">http://www.suspekt.org/2009/06/16/dutch-php-conference-the-slides/</a></p>
<p>中でも気になったのが「<a href="http://www.suspekt.org/downloads/DPC_Secure_Programming_With_The_Zend_Framework.pdf" target="_blank">Secure Programming with the Zend Framework</a>」というスライド。</p>
<p>Zend Frameworkを使う際、セキュリティ的に気をつけなければいけないポイントと、<br />
各クラスの使い方をまとめてくれています。<br />
既に知っている内容も多いかと思いますが、ZF使い必見のスライドです。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/310/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Tool_ProjectでZend Frameworkのデフォルトファイル作成</title>
		<link>http://blog.lllnorikolll.com/archives/304</link>
		<comments>http://blog.lllnorikolll.com/archives/304#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:52:07 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Zend_Tool_Project]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=304</guid>
		<description><![CDATA[先ほどのzfコマンド(→こちら)を使うと、コマンドラインでZendFrameworkのデフォルトファイルを生成することができます。 ZendFrameworkってディレクトリ構成をどうしたらいいかわからずに先に進めない！ [...]]]></description>
			<content:encoded><![CDATA[<p>先ほどのzfコマンド(<a href="http://blog.lllnorikolll.com/archives/298" target="_blank">→こちら</a>)を使うと、コマンドラインでZendFrameworkのデフォルトファイルを生成することができます。</p>
<p>ZendFrameworkってディレクトリ構成をどうしたらいいかわからずに先に進めない！という方は、是非お試しください。</p>
<p><a href="http://framework.zend.com/manual/ja/zend.tool.project.create-a-project.html" target="_blank">http://framework.zend.com/manual/ja/zend.tool.project.create-a-project.html</a><br />
↑のマニュアルを参考にしました。</p>
<p>「tool」という名前のディレクトリを作成(どんな名前でも可)して、そこに作成していきます。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> tool
<span style="color: #7a0874; font-weight: bold;">cd</span> tool
zf create project</pre></div></div>

<p>え！これだけ？と、思いましたが、本当にこれだけです。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Tool_Framework &#8211; zfコマンドをMacOS10.5Leopardで使えるようにする</title>
		<link>http://blog.lllnorikolll.com/archives/298</link>
		<comments>http://blog.lllnorikolll.com/archives/298#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:29:25 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=298</guid>
		<description><![CDATA[さて、かなり気になっていたZend_Tool関連のお話です。 CakePHPにはbakeというコマンドがありますが、Zend Frameworkはzfコマンドが使えるようになったようです。(といってもかなり前から・・・私 [...]]]></description>
			<content:encoded><![CDATA[<p>さて、かなり気になっていたZend_Tool関連のお話です。<br />
CakePHPにはbakeというコマンドがありますが、Zend Frameworkはzfコマンドが使えるようになったようです。(といってもかなり前から・・・私がいかにZendFrameworkサボっていたかがわかってしまいます・・・)</p>
<p><a href="http://framework.zend.com/manual/ja/zend.tool.framework.clitool.html" target="_blank">http://framework.zend.com/manual/ja/zend.tool.framework.clitool.html</a><br />
↑のマニュアルを参考にしました。</p>
<p>phpがインストールされていて、ZendFrameworkソースファイルを取得していることを前提に進めます。<br />
ちなみに私はmacportsのphp5をインストールしています。<br />
ZendFrameworkは/projects/zf/library/Zend/となるように置いています。</p>
<p>まず、</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">which</span> php
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php</pre></div></div>

<p>でphpバイナリがあるパスを確認します。この場合は、/opt/local/binがそうです。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p><a href="http://framework.zend.com/svn/framework/standard/trunk/bin/" target="_blank">http://framework.zend.com/svn/framework/standard/trunk/bin/</a><br />
cdコマンドで移動し、上記URLにあるzf.phpとzf.shをコピーします。<br />
zf.shはzfとリネームします。</p>
<p>次にphp.iniでZendFrameworkをinclude_pathに追加します。<br />
（既に設定してある場合は省略）<br />
正しくinclude_pathに指定されたか、を確認します。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> include_path
include_path =<span style="color: #000000; font-weight: bold;">&gt;</span> .:<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>zf<span style="color: #000000; font-weight: bold;">/</span>library =<span style="color: #000000; font-weight: bold;">&gt;</span> .:<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>zf<span style="color: #000000; font-weight: bold;">/</span>library</pre></div></div>

<p>これでzfコマンドが使えるようになります。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/298/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendFramework勉強会@Tokyo参加報告</title>
		<link>http://blog.lllnorikolll.com/archives/251</link>
		<comments>http://blog.lllnorikolll.com/archives/251#comments</comments>
		<pubDate>Sat, 04 Apr 2009 08:55:05 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[イベント]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=251</guid>
		<description><![CDATA[ZendFramework勉強会@Tokyoに参加してきました。 ZFではじめる携帯サイト &#8211; bayside 携帯サイトをZendFrameworkを利用して作る際に必要となる知識を、全般的にざっと紹介。  [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://events.php.gr.jp/events/show/72" target="_blank">ZendFramework勉強会@Tokyo</a>に参加してきました。</strong></p>
<h3>ZFではじめる携帯サイト &#8211; bayside</h3>
<p>携帯サイトをZendFrameworkを利用して作る際に必要となる知識を、全般的にざっと紹介。</p>
<p>Firefoxの<a href="http://chrispederick.com/work/user-agent-switcher/" target="_blank">UserAgentSwitcher</a>というアドオンは、UserAgentを偽装するだけだけれど、<a href="http://firemobilesimulator.org/" target="_blank">FireMobileSimulator</a>というのが絵文字なども再現してくれてすごいとのこと。</p>
<p>あとで入れてみよう。。。</p>
<h3>思い立ったらZF 〜 今日の目次 〜 &#8211; <a href="http://en.yummy.stripper.jp/" target="_blank">junichiro</a></h3>
<p>CakePHPとZendFrameworkの比較をしながら、それぞれの特徴をざっと紹介。</p>
<p>junichiroさんが使っているZendFrameworkのファイルレイアウトは、githubにあるらしい。ファイルレイアウトに悩んでその先に進むまでが大変なときは、ここから利用させてもらうと便利！→<a href="http://github.com/junichiro/zf-starter/tree/master" target="_blank">http://github.com/junichiro/zf-starter/tree/master</a></p>
<p>実際に簡単なコードを書いて、Zend_Formなどを説明。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>junichiro<span style="color: #000000; font-weight: bold;">/</span>zf-starter.git zf-starter</pre></div></div>

<p>さっそく取得してきてみた。githubの仕様（？）で空のディレクトリはUPできないらしいので、moduleなどは入っていないとのこと。</p>
<h3>はじめてのZend_Form &#8211; <a href="http://nonn-et-twk.net/twk/" target="_blank">twk</a></h3>
<p>Zend_Formを使ったサンプルコードをたくさん用意して、紹介。</p>
<p>実際みんなどう書いているの？という声がいろんなところで聞かれるので、とても参考になった。</p>
<p>コードはPDTを利用して書いているとのこと。コード補完のために各所にコメントがうめられていて、この一手間をかけることで、コーディングがかなりラクになるのだろうなと思った。</p>
<p>
</br></p>
<h3>Phwittrについて &#8211; <a href="http://d.hatena.ne.jp/heavenshell" target="_blank">heavenshell</a></h3>
<p>Phwitterのソースはcodereposで管理されている→<a href="http://coderepos.org/share/browser/events/phpframework/zend_framework/trunk" target="_blank">http://coderepos.org/share/browser/events/phpframework/zend_framework/trunk</a></p>
<p>viewでshort_tagを使うのに<a href="http://www.revulo.com/ZendFramework/Component/Phtmlc.html" target="_blank">Revulo_View_Phtmlc</a>を使っているらしい。</p>
<h3>【感想】</h3>
<p>実践的な内容が多く、参考になった。</p>
<p>ZFが自由度が高いというのを、複数人のコードの書き方やディレクトリ構成を見ることで、実際に体感した。</p>
<p>自由度が高いために、「できない」ことは少なくなるけれど、「できる」ことだけを集めた後で自分でルールを決めないと、ひとつのプロジェクトでも統一感のない書き方に、簡単になってしまうんだろうなと思った。</p>
<h3>自作のZFコンポーネントなど  &#8211; wads</h3>
<p>自作のコンポーネントを紹介してくださいました。</p>
<p>プレフィックスがwadsというのがうけた。</p>
<h3>たとえばZend_Cacheとか &#8211; noopable</h3>
<p>Zend_Cacheの使い方。これは、もう少しじっくり詳しく聞いてみたかった。</p>
<h3>ZFにまつわる何か &#8211; m-takagi</h3>
<p>iPhoneでスライド操作していたのが印象的だった。</p>
<p>ノートPCの壁紙が下地島で撮った飛行機の写真だったのが印象的だった。</p>
<h3>ZendFrameworkにバグ報告をする &#8211; cocoiti</h3>
<p>POSTのときだけatom_xmlが着かないバグがあり、バグ報告をした際のお話。</p>
<p>IRCにくると、案外日本語でバグ報告ができるかも！？</p>
<h3>いろいろ &#8211; sasezaki</h3>
<p>12月の時の参考資料。<a href="http://handsout.jp/slide/1027" target="_blank">http://handsout.jp/slide/1027</a></p>
<h3>デバッグ &#8211; wozozo</h3>
<p>ビューヘルパー作った！</p>
<p></p>
<p>さてさて、いつものことですが、肉に向かいます。いってきます！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/251/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendFramework勉強会@Tokyo参加予定</title>
		<link>http://blog.lllnorikolll.com/archives/240</link>
		<comments>http://blog.lllnorikolll.com/archives/240#comments</comments>
		<pubDate>Tue, 17 Mar 2009 08:52:45 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[イベント]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=240</guid>
		<description><![CDATA[ZendFramework勉強会@Tokyoが開催されます。 以下抜粋 イベント内容 ZendFrameworkの勉強会を行います。 20人ほどの会場で、カジュアルな感じの勉強会になると思います 勉強会終了後には参加者同 [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://events.php.gr.jp/events/show/72" target="_blank">ZendFramework勉強会@Tokyo</a></strong>が開催されます。</p>
<p>以下抜粋</p>
<h4>イベント内容</h4>
<p>ZendFrameworkの勉強会を行います。</p>
<p>20人ほどの会場で、カジュアルな感じの勉強会になると思います</p>
<p>勉強会終了後には参加者同士で交流を深めるために懇親会を行います。<br />
参加される方は申込み時に合わせて参加表明をお願いします。</p>
<p>■概要<br />
日時: 2009年04月04日(土) 14:00～18：00<br />
会場: 東京都渋谷区</p>
<p>申し込みは　2009-03-17 18:00:00　〜　2009-04-04 14:00:00　まで、<br />
こちらから→　<strong><a href="http://events.php.gr.jp/events/show/72" target="_blank">http://events.php.gr.jp/events/show/72</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/240/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBookAir(MacOS10.5Leopard)に常に最新のZendFrameworkマニュアルを作成する</title>
		<link>http://blog.lllnorikolll.com/archives/235</link>
		<comments>http://blog.lllnorikolll.com/archives/235#comments</comments>
		<pubDate>Thu, 26 Feb 2009 23:57:56 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=235</guid>
		<description><![CDATA[ZendFrameworkはSubversion(以下SVN)から取得して常に最新版での動作を確認することができる。 （マニュアルの1.2. インストール参照） このSVNリポジトリにはdocumentationディレク [...]]]></description>
			<content:encoded><![CDATA[<p>ZendFrameworkはSubversion(以下SVN)から取得して常に最新版での動作を確認することができる。<br />
（<a href="http://framework.zend.com/manual/ja/introduction.installation.html" target="_blank">マニュアルの1.2. インストール</a>参照）<br />
このSVNリポジトリにはdocumentationディレクトリもあり、<strong>各国の言語でのマニュアルも日々更新</strong>されている。<br />
MacBookAirはHDD容量が少なめなため、SVNから取得した最新マニュアルの日本語版のみをHTML作成したい。できればZendFramework日本語マニュアルを自分が見やすいと思うような好みのデザインにCSSで変更したい。<br />
というわけで、翻訳の神<a href="http://d.hatena.ne.jp/takagimasahiro/" target="_blank">id:m-takagi</a>さんに色々と助けていただきながら作成してみた。</p>
<h3>下準備 &#8211; MacPortsからautoconfとlibxsltをインストール</h3>
<p>ZendFrameworkのマニュアルはDockBookというもので書かれているため、SVNから取得できるのはxmlファイルとテンプレートとなるデザインのみ。<br />
これをHTMLにするにはMacにautoconfとlibxsltというものをMacPortsからインストールする。<br />
MacPortsのインストールについては<a href="http://blog.lllnorikolll.com/archives/214" target="_blank">前回の記事</a>を参照。</p>
<p>ターミナルを立ち上げ、以下のコマンドでautoconfとlibxsltをインストール（若干時間がかかる）</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">autoconf</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> libxslt</pre></div></div>

<h3>SVNから日本語マニュアルHTML作成に必要なもののみ取得</h3>
<p>SVNからのソースの取得方法は、ここでは省略する。（取得方法については他サイトを参考に）<br />
SVNから下記の２ディレクトリ以下のもののみチェックアウトする</p>
<ul>
<li>日本語マニュアル用（<a href="http://framework.zend.com/svn/framework/standard/trunk/documentation/manual/ja/" target="_blank">http://framework.zend.com/svn/framework/standard/trunk/documentation/manual/ja/</a>）</li>
<li>英語マニュアル用（<a href="http://framework.zend.com/svn/framework/standard/trunk/documentation/manual/en/" target="_blank">http://framework.zend.com/svn/framework/standard/trunk/documentation/manual/en/</a>）</li>
</ul>
<p>なぜ英語版も必要かは<strong>後述</strong>。<br />
チェックアウト完了後、ターミナルを起動。<br />
作成されたjaディレクトリにcdコマンドで移動。<br />
下記コマンドをうつ。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">autoconf</span>
$ .<span style="color: #000000; font-weight: bold;">/</span>configure
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>makeと打ったあと、<br />
warning: failed to load external entity &#8220;module_specs/Zend_Dojo-View-Helpers.xml&#8221;<br />
というワーニングがいくつか出るが、<a href="http://d.hatena.ne.jp/takagimasahiro/" target="_blank">id:m-takagi</a>さんによると、jaディレクトリにファイルが無いワーニングで、ファイルが無い場合はenディレクトリから英語版のものを利用することになっているので、問題ないとのこと。<br />
このような部分で英語版を利用するので<strong>enもSVNから取得</strong>していた。<br />
warningが出た後しばらくそのまま待っていると、writing &#8230;&#8230;とファイル作成中の表示が出てja/html以下にhtmlファイルが作成される。（全ファイルを作成するまでに結構時間がかかる）</p>
<p>できたーーー。と感動していると、実はja/html/imagesディレクトリが無くて一部画像が表示されないので、以下2ファイルを本家マニュアルから拝借し、ja/html/imagesディレクトリを作成してgifファイルをpngファイルに変更し、保存。</p>
<ul>
<li><a href="http://framework.zend.com/images/note.gif" target="_blank">http://framework.zend.com/images/note.gif</a>→これをnote.pngにして保存</li>
<li><a href="http://framework.zend.com/images/tip.gif" target="_blank">http://framework.zend.com/images/tip.gif</a>→これをtip.pngにして保存</li>
</ul>
<p>pngファイルにするのが面倒な場合は、手元にある適当な画像を置いてもOK。</p>
<p>ja/html/index.html<br />
このファイルをブラウザで開くと、ZendFrameworkマニュアル日本語版が見れる。</p>
<p>あとはSVNをupdateするたびにコマンドでhtmlを作成しなおせばOK。</p>
<p>HTMLのデザインを変更するには、<br />
ja/html/dbstyle.cssファイルでCSSを書き換えてあげればよい。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/235/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ベーシック認証のかかっている別サイトにJPEG画像を生データでPOSTするメモ</title>
		<link>http://blog.lllnorikolll.com/archives/90</link>
		<comments>http://blog.lllnorikolll.com/archives/90#comments</comments>
		<pubDate>Mon, 25 Aug 2008 14:09:47 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[メモ箱]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend_Http]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=90</guid>
		<description><![CDATA[苦労したのでメモ。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $Url = 'http://ほげほげー.com/ほげー/ほげー.php'; $UserId [...]]]></description>
			<content:encoded><![CDATA[<p>苦労したのでメモ。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$Url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://ほげほげー.com/ほげー/ほげー.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$UserId</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ユーザID'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$Pwd</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'パスワード'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$binaryData</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span>’ファイル名’<span style="color: #339933;">,</span> FILE_BINARY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$arrUrl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">parse_url</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arrUrl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$path</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arrUrl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;path&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$port</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrUrl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;port&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$arrUrl</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;port&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$socket</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">stream_socket_client</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tcp://'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$host</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">':'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$port</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$strHeader</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;POST &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; HTTP/1.1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
             <span style="color: #0000ff;">&quot;Host: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$host</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
             <span style="color: #0000ff;">&quot;Content-type: application/jpeg<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
             <span style="color: #0000ff;">&quot;Authorization: Basic &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$UserId</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;:&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$Pwd</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
             <span style="color: #0000ff;">&quot;Content-length: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$entity</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>size <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
             <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$socket</span><span style="color: #339933;">,</span> <span style="color: #000088;">$strHeader</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$binaryData</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fread</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$socket</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$response</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$buff</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$socket</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>ちなみにZendFrameworkのライブラリにZend_Httpという便利なものがあります！！！</strong><br />
Zend_Httpなら、下記のように書くだけ！</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Http/Client.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$Url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://ほげほげー.com/ほげー/ほげー.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$UserId</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ユーザID'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$Pwd</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'パスワード'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$binaryData</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span>’ファイル名’<span style="color: #339933;">,</span> FILE_BINARY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Http_Client<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$client</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setUri<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$client</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setAuth<span style="color: #009900;">&#40;</span><span style="color: #000088;">$UserId</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Pwd</span><span style="color: #339933;">,</span> Zend_Http_Client<span style="color: #339933;">::</span><span style="color: #004000;">AUTH_BASIC</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$client</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setRawData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$binaryData</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'application/jpeg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>request<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'POST'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/90/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendFrameworkのZend_Pdfで日本語フォントを使う</title>
		<link>http://blog.lllnorikolll.com/archives/65</link>
		<comments>http://blog.lllnorikolll.com/archives/65#comments</comments>
		<pubDate>Tue, 05 Aug 2008 04:38:35 +0000</pubDate>
		<dc:creator>lllnorikolll</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.lllnorikolll.com/?p=65</guid>
		<description><![CDATA[ZendFrameworkのZend_Pdf（http://framework.zend.com/manual/ja/zend.pdf.html） を、試してみました。 ところが、日本語が表示されない。 こちらのサイト→ [...]]]></description>
			<content:encoded><![CDATA[<p>ZendFrameworkのZend_Pdf（<a href="http://framework.zend.com/manual/ja/zend.pdf.html" target="_blank">http://framework.zend.com/manual/ja/zend.pdf.html</a>）</p>
<p>を、試してみました。<br />
ところが、日本語が表示されない。</p>
<p>こちらのサイト→（<a href="http://eringi.com/weblog/archives/2008/03/zend_pdf.html" target="_blank">Zend_Pdf で日本語が使えるようになってた</a>）<br />
を教えてもらって、ここに書いているようにフォントファイルをダウンロードして配置したら、ちゃんと日本語が使えました！</p>
<p>2008/08/05現在、ZendFrameworkのZend_Pdfで利用できるデフォルトのフォント指定は、下記のもののみでした。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER_BOLD <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier-Bold'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER_OBLIQUE <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier-Oblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier-Oblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER_BOLD_OBLIQUE <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier-BoldOblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_COURIER_BOLD_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Courier-BoldOblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA_BOLD <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica-Bold'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA_OBLIQUE <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica-Oblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica-Oblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA_BOLD_OBLIQUE <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica-BoldOblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_HELVETICA_BOLD_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Helvetica-BoldOblique'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_SYMBOL <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Symbol'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_TIMES_ROMAN <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Times-Roman'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_TIMES <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Times-Roman'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_TIMES_BOLD <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Times-Bold'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_TIMES_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Times-Italic'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_TIMES_BOLD_ITALIC <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Times-BoldItalic'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FONT_ZAPFDINGBATS <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ZapfDingbats'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.lllnorikolll.com/archives/65/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

