<?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>アストロデオブログ &#187; Zend Framework</title>
	<atom:link href="http://astrodeo.com/blog/archives/category/zend-framework/feed" rel="self" type="application/rss+xml" />
	<link>http://astrodeo.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 11 Jul 2011 01:38:11 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Zend Framework + Smarty</title>
		<link>http://astrodeo.com/blog/archives/610</link>
		<comments>http://astrodeo.com/blog/archives/610#comments</comments>
		<pubDate>Thu, 13 May 2010 08:06:55 +0000</pubDate>
		<dc:creator>鳥よし</dc:creator>
				<category><![CDATA[Smarty]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://astrodeo.com/blog/?p=610</guid>
		<description><![CDATA[仕事でZend Framework + Smartyが必要になってくるので、環境を整えてみました。 その際の手順をメモ。 僕の端末にはXAMPPが入っているため、PHPの動作環境は一通り揃っていました。 まずはZend Frameworkをダウンロード ダウンロードしたファイルを解凍して好きな場所に配置 php.iniのinclude_pathパラメータに以下のようにパスを追記(僕の環境の場合PEARのパスが既に入っているので、後ろに追記しました。) include_path = ".;C:\xampp\php\PEAR;C:\[配置したディレクトリ]\ZendFramework-1.10.4\library\" 次にApache側の環境設定 httpd.conf内のmod_rewriteモジュールを有効にする。(XAMPP入れたときにデフォルトで有効でした。) LoadModule rewrite_module modules/mod_rewrite.so さらに、ドキュメントフォルダ内の.htaccessの設定を有効にする。(こちらもXAMPP入れたときにデフォルトで有効でした。) # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # [...]]]></description>
			<content:encoded><![CDATA[<p>仕事でZend Framework + Smartyが必要になってくるので、環境を整えてみました。<br />
その際の手順をメモ。</p>
<p>僕の端末にはXAMPPが入っているため、PHPの動作環境は一通り揃っていました。</p>
<p>まずは<a href="http://framework.zend.com/download/latest" target="_blank">Zend Frameworkをダウンロード</a></p>
<p>ダウンロードしたファイルを解凍して好きな場所に配置<br />
php.iniのinclude_pathパラメータに以下のようにパスを追記(僕の環境の場合PEARのパスが既に入っているので、後ろに追記しました。)</p>
<textarea name="code" class="PHP:nocontrols" cols="30" rows="5">
include_path = ".;C:\xampp\php\PEAR;C:\[配置したディレクトリ]\ZendFramework-1.10.4\library\"
</textarea>
<p>次にApache側の環境設定<br />
httpd.conf内のmod_rewriteモジュールを有効にする。(XAMPP入れたときにデフォルトで有効でした。)</p>
<textarea name="code" class="PHP:nocontrols" cols="30" rows="5">
LoadModule rewrite_module modules/mod_rewrite.so
</textarea>
<p>さらに、ドキュメントフォルダ内の.htaccessの設定を有効にする。(こちらもXAMPP入れたときにデフォルトで有効でした。)</p>
<textarea name="code" class="PHP:nocontrols" cols="30" rows="5">
<Directory "C:\xampp\htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>
</textarea>
<p>.htaccessの設定</p>
<textarea name="code" class="PHP:nocontrols" cols="30" rows="5">
<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /zendtest
   RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
</IfModule>
</textarea>
<p>RewriteBaseは各々の環境に合わせてください。</p>
<p>ちなみに、RewriteRuleの記述の意味は「js、ico、gif、jpg、png、css」以外の名前のパスを全て、index.phpに飛ばすと言うことです。<br />
index.phpをフロントコントローラにする為に記述しています。</p>
<p>ここで、動作確認の為に新しいプロジェクトを作って、Zendのバージョン情報を確認しようとしたところ、<br />
自分がダウンロードしたバージョンと違うバージョンが出力されるという問題が発生しました。</p>
<p>【実行コード】</p>
<textarea name="code" class="PHP:nocontrols" cols="30" rows="5">
<?php
require_once 'Zend/Version.php';
echo 'バージョン情報 ： ' . Zend_Version::VERSION;
</textarea>
<p>調べたところ、PEARの中にもデフォルトでZendが入っており、include_pathの順番的に先に読み込まれているようでした。<br />
なので、PEAR内のZendディレクトリを一先ず退避させました。</p>
<p>さて、ここまででZend Frameworkの設定が完了です。</p>
<p>次はSmarty</p>
<p>Zend Framework上でSmartyを使用するために下記のサイトに書かれていることを行いました。<br />
<a href="http://www.phppro.jp/school/smarty/vol12/1" target="_blank">SmartyとZend Framework</a></p>
<p>これでようやく環境が整いました。</p>
<p>最後が投げやりですって？　･･･すみません。</p>
]]></content:encoded>
			<wfw:commentRss>http://astrodeo.com/blog/archives/610/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

