<?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>tech</title>
	<atom:link href="http://www.airgroove.com/tech/feed" rel="self" type="application/rss+xml" />
	<link>http://www.airgroove.com/tech</link>
	<description>技術的なことのメモ</description>
	<lastBuildDate>Fri, 08 Jan 2010 07:12:36 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Let&#8217;sNoteのデュアルブート(xp/2000)</title>
		<link>http://www.airgroove.com/tech/archives/159</link>
		<comments>http://www.airgroove.com/tech/archives/159#comments</comments>
		<pubDate>Fri, 08 Jan 2010 07:12:36 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=159</guid>
		<description><![CDATA[元々XPが入っているLet&#8217;sNoteに2000をインストールしてデュアルブートにする。 USBのCDからインストールする場合、2000のインストールCDをSP4化しておかないとブルースクリーンになる。 2000のインストールCDのSP4化 必要なもの ・Win2000インストールCD ・bbie ・cdrtools-1.11a12-win32-bin.zip 手順 1. cdの中身を例えばc:\w2kにコピー。 2. win2000用SP4をMicrosoftからダウンロード。 3. w2ksp4_jp.exeをオプション付で実行。 w2ksp4.exe -s:c:¥w2k 4. Win2000インストールCDからブート用イメージ抽出。CDがD:ドライブとすると bbie.exe d: でそのディレクトリにimage1.binができる。 5. イメージ作成 　　mkisofs.exe -b image1.bin -no-emul-boot -J -N -o c:\w2ksp4.iso c:\w2k 6.　できたw2ksp4.isoをInfraRecorder等で焼く。 事前準備 XPでファイルをコピー。 C:直下のNTLDR、ntdetect.com、bootfont.binをバックアップしておく。 エクスプローラーに出てこない場合は、表示オプションで「すべてのファイルとフォルダを表示する」にチェックを入れて、保護されたオペレーティングシステムファイルを表示しないのチェックを外す。 パーティション分割。 元のXPが入ってるドライブをCとして、Dを作成しておく。 インストール Win2000のインストールCDからD:ドライブにインストール。 この段階でデュアルブートのメニューは表示されるがXPからは起動できない。 インストール終了後、Win2000から、C:ドライブにアクセスしてバックアップしたファイルを元に戻す。 デュアルブート可能になる。 No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>元々XPが入っているLet&#8217;sNoteに2000をインストールしてデュアルブートにする。</p>
<p>USBのCDからインストールする場合、2000のインストールCDをSP4化しておかないとブルースクリーンになる。</p>
<p><strong>2000のインストールCDのSP4化</strong><br />
必要なもの<br />
・Win2000インストールCD<br />
・<a href="http://www.nu2.nu/download.php?sFile=bbie10.zip">bbie</a><br />
・<a href="ftp://ftp.berlios.de/pub/cdrecord/alpha/win32/">cdrtools-1.11a12-win32-bin.zip</a></p>
<p>手順<br />
1. cdの中身を例えばc:\w2kにコピー。<br />
2. win2000用SP4をMicrosoftからダウンロード。<br />
3. w2ksp4_jp.exeをオプション付で実行。<br />
    w2ksp4.exe -s:c:¥w2k<br />
4. Win2000インストールCDからブート用イメージ抽出。CDがD:ドライブとすると<br />
    bbie.exe d:<br />
    でそのディレクトリにimage1.binができる。<br />
5. イメージ作成<br />
　　mkisofs.exe -b image1.bin -no-emul-boot -J -N -o c:\w2ksp4.iso c:\w2k<br />
6.　できたw2ksp4.isoを<a href="http://www.forest.impress.co.jp/lib/sys/hardcust/cddvdburn/infrarecord.html">InfraRecorder</a>等で焼く。</p>
<p><strong>事前準備</strong><br />
XPでファイルをコピー。<br />
C:直下のNTLDR、ntdetect.com、bootfont.binをバックアップしておく。<br />
エクスプローラーに出てこない場合は、表示オプションで「すべてのファイルとフォルダを表示する」にチェックを入れて、保護されたオペレーティングシステムファイルを表示しないのチェックを外す。</p>
<p>パーティション分割。<br />
元のXPが入ってるドライブをCとして、Dを作成しておく。</p>
<p><strong>インストール</strong><br />
Win2000のインストールCDからD:ドライブにインストール。<br />
この段階でデュアルブートのメニューは表示されるがXPからは起動できない。<br />
インストール終了後、Win2000から、C:ドライブにアクセスしてバックアップしたファイルを元に戻す。<br />
デュアルブート可能になる。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/159/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>muninでhpサーバの温度表示</title>
		<link>http://www.airgroove.com/tech/archives/148</link>
		<comments>http://www.airgroove.com/tech/archives/148#comments</comments>
		<pubDate>Thu, 20 Aug 2009 05:27:27 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[munin]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=148</guid>
		<description><![CDATA[以下、CentOS、RHESの話。 HPのサイトからHP Support Packを入れておく。psp-8.25.rhel5.i686.en.tar.gzとか。 hp-healthのRPMパッケージが入っていれば、以下のコマンドで各種の温度が取得できる。 # hpasmcli -s "SHOW TEMP" Sensor Location Temp Threshold ------ -------- ---- --------- #1 PROCESSOR_ZONE 38C/100F 62C/143F #2 CPU#1 36C/96F 73C/163F #3 I/O_ZONE 47C/116F 68C/154F #4 - - - #5 POWER_SUPPLY_BAY 37C/98F 55C/131F ここからプラグインのスクリプトを取得。 hpasmcli_tempというファイル名で/usr/share/munin/plugins/とかに保存。 sudoの設定をします。visudoで、以下を追加 #Defaults requiretty　　


No related posts.]]></description>
			<content:encoded><![CDATA[<p>以下、CentOS、RHESの話。</p>
<p>HPのサイトからHP Support Packを入れておく。psp-8.25.rhel5.i686.en.tar.gzとか。<br />
hp-healthのRPMパッケージが入っていれば、以下のコマンドで各種の温度が取得できる。</p>
<pre class="brush:text">
# hpasmcli -s "SHOW TEMP"

Sensor   Location              Temp       Threshold
------   --------              ----       ---------
#1        PROCESSOR_ZONE       38C/100F   62C/143F
#2        CPU#1                36C/96F    73C/163F
#3        I/O_ZONE             47C/116F   68C/154F
#4         -                    -          -
#5        POWER_SUPPLY_BAY     37C/98F    55C/131F
</pre>
<p><strong><a href="http://munin.projects.linpro.no/attachment/wiki/PluginCat/hpasmcli_temp">ここ</a></strong>からプラグインのスクリプトを取得。<br />
hpasmcli_tempというファイル名で/usr/share/munin/plugins/とかに保存。</p>
<p>sudoの設定をします。visudoで、以下を追加</p>
<pre class="brush:text">
#Defaults    requiretty　　<- コメントアウト
nobody ALL = (root) NOPASSWD:/sbin/hpasmcli
</pre>
<p>以下、お約束で</p>
<pre class="brush:bash">
# ln -s /usr/share/munin/plugins/hpasmcli_temp /etc/munin/plugins/hpasmcli_temp
# /etc/init.d/munin-node restart
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/148/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSにphp-5.2をインストール</title>
		<link>http://www.airgroove.com/tech/archives/146</link>
		<comments>http://www.airgroove.com/tech/archives/146#comments</comments>
		<pubDate>Thu, 20 Aug 2009 02:49:30 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=146</guid>
		<description><![CDATA[http://www.jasonlitka.com/yum-repository/からリポジトリを追加します。 # rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka /etc/yum.repos.d/utterramblings.repoを作成。中身は [utterramblings] name=Jason's Utter Ramblings Repo baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/ enabled=0 gpgcheck=1 gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka アップデート # yum --enablerepo=utterramblings check-update # yum --enablerepo=utterramblings update php # yum --enablerepo=utterramblings update pcre php-pear 念のため/etc/yum.repos.d/CentOS-Baseの[base][updates]に exclude=php* など追加 Related posts:CentOSにPostgresql-8.2をインストール


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/140' rel='bookmark' title='Permanent Link: CentOSにPostgresql-8.2をインストール'>CentOSにPostgresql-8.2をインストール</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jasonlitka.com/yum-repository/">http://www.jasonlitka.com/yum-repository/</a>からリポジトリを追加します。</p>
<pre class="brush:bash">
# rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
</pre>
<p>/etc/yum.repos.d/utterramblings.repoを作成。中身は</p>
<pre class="brush:text">
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
</pre>
<p>アップデート</p>
<pre class="brush:bash">
# yum --enablerepo=utterramblings check-update
# yum --enablerepo=utterramblings update php
# yum --enablerepo=utterramblings update pcre php-pear
</pre>
<p>念のため/etc/yum.repos.d/CentOS-Baseの[base][updates]に</p>
<pre class="brush:text">
exclude=php*
</pre>
<p>など追加</p>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/140' rel='bookmark' title='Permanent Link: CentOSにPostgresql-8.2をインストール'>CentOSにPostgresql-8.2をインストール</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/146/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSにPostgresql-8.2をインストール</title>
		<link>http://www.airgroove.com/tech/archives/140</link>
		<comments>http://www.airgroove.com/tech/archives/140#comments</comments>
		<pubDate>Thu, 20 Aug 2009 02:35:01 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=140</guid>
		<description><![CDATA[yumでの管理の方法を元に。。。 /etc/yum.repos.dのCentOS-Base.repoの中の[base]と[updates]セクションの最後に exclude=postgresql* を追加 http://yum.pgsqlrpms.org/reporpms/repoview/pgdg-centos.htmlから欲しいバージョンのrpmを取得。 # wget http://yum.pgsqlrpms.org/reporpms/8.2/pgdg-centos-8.2-4.noarch.rpm # rpm -ivh pgdg-centos-8.2-4.noarch.rpm # yum update とかでアップデートされるはずだが、 依存関係でエラーになったので /etc/yum.repos.d/pgdg-82-centos.repoの[pgdg82]セクションに exclude=libevent* を追加。ついでにenabled=0に変更。 Related posts:CentOSにphp-5.2をインストール


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/146' rel='bookmark' title='Permanent Link: CentOSにphp-5.2をインストール'>CentOSにphp-5.2をインストール</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://yum.pgsqlrpms.org/howtoyum.php">yumでの管理の方法</a>を元に。。。</p>
<p>/etc/yum.repos.dのCentOS-Base.repoの中の[base]と[updates]セクションの最後に</p>
<pre class="brush:text">
exclude=postgresql*
</pre>
<p>を追加</p>
<p><a href="http://yum.pgsqlrpms.org/reporpms/repoview/pgdg-centos.html">http://yum.pgsqlrpms.org/reporpms/repoview/pgdg-centos.html</a>から欲しいバージョンのrpmを取得。</p>
<pre class="brush:bash">
# wget http://yum.pgsqlrpms.org/reporpms/8.2/pgdg-centos-8.2-4.noarch.rpm
# rpm -ivh pgdg-centos-8.2-4.noarch.rpm
</pre>
<pre class="brush:bash">
# yum update
</pre>
<p>とかでアップデートされるはずだが、<br />
依存関係でエラーになったので<br />
/etc/yum.repos.d/pgdg-82-centos.repoの[pgdg82]セクションに</p>
<pre class="brush:text">
exclude=libevent*
</pre>
<p>を追加。ついでにenabled=0に変更。</p>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/146' rel='bookmark' title='Permanent Link: CentOSにphp-5.2をインストール'>CentOSにphp-5.2をインストール</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/140/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>paginatorのSmarty化</title>
		<link>http://www.airgroove.com/tech/archives/111</link>
		<comments>http://www.airgroove.com/tech/archives/111#comments</comments>
		<pubDate>Fri, 07 Aug 2009 04:53:56 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=111</guid>
		<description><![CDATA[無理やりですが。 対象のテーブルはServersとします。 smarty.phpの修正 [cakeのインストール先]/app/views/smarty.phpの69行目あたりにtemplate_dirの定義を追加。 $this-&#62;smarty-&#62;cache_dir = TMP.'smarty'.DS.'cache'.DS; $this-&#62;smarty-&#62;template_dir = dirname(__FILE__); # これを追加 $this-&#62;smarty-&#62;error_reporting = 'E_ALL &#38; ~E_NOTICE'; layoutファイルの修正 [cakeのインストール先]/app/views/layouts/smarty/default.tplを修正。 &#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62; &#60;html xmlns="http://www.w3.org/1999/xhtml"&#62; &#60;head&#62; {$html-&#62;charset()} &#60;title&#62;{$title_for_layout}&#60;/title&#62; {$html-&#62;meta('icon')} {$html-&#62;css('cake.generic')} {$scripts_for_layout} &#60;/head&#62; &#60;body&#62; {$content_for_layout} &#60;/body&#62; &#60;/html&#62; paging.tplの作成 [cakeのインストール先]/app/views/elements/にpaging.tplを作成。 {assign_assoc var='CounterArray' value='format=&#62;全%pages%ページ中の%page%ページ目を表示中  全%count%件中の%start%件目から%end%件目の%current%件を表示中'} {$paginator-&#62;counter($CounterArray)} &#60;/p&#62; &#60;table cellpadding="0" cellspacing="0" border="1"&#62; &#60;tr&#62; {foreach from=$paging_data.0.$model [...]


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>無理やりですが。<br />
対象のテーブルはServersとします。</p>
<li>smarty.phpの修正</li>
<p>[cakeのインストール先]/app/views/smarty.phpの69行目あたりにtemplate_dirの定義を追加。<br />
<span id="more-111"></span></p>
<pre class="brush:php">$this-&gt;smarty-&gt;cache_dir = TMP.'smarty'.DS.'cache'.DS;
$this-&gt;smarty-&gt;template_dir = dirname(__FILE__);  # これを追加
$this-&gt;smarty-&gt;error_reporting = 'E_ALL &amp; ~E_NOTICE';</pre>
<li>layoutファイルの修正</li>
<p>[cakeのインストール先]/app/views/layouts/smarty/default.tplを修正。</p>
<pre class="brush:html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
{$html-&gt;charset()}
&lt;title&gt;{$title_for_layout}&lt;/title&gt;
{$html-&gt;meta('icon')}
{$html-&gt;css('cake.generic')}
{$scripts_for_layout}
&lt;/head&gt;
&lt;body&gt;
{$content_for_layout}
&lt;/body&gt;
&lt;/html&gt;</pre>
<li>paging.tplの作成</li>
<p>[cakeのインストール先]/app/views/elements/にpaging.tplを作成。</p>
<pre class="brush:html">{assign_assoc var='CounterArray' value='format=&gt;全%pages%ページ中の%page%ページ目を表示中  全%count%件中の%start%件目から%end%件目の%current%件を表示中'}
{$paginator-&gt;counter($CounterArray)}
&lt;/p&gt;
&lt;table cellpadding="0" cellspacing="0" border="1"&gt;
&lt;tr&gt;
 {foreach from=$paging_data.0.$model key=key item=head}
 &lt;th&gt;{$paginator-&gt;sort($translate.$key,$key)}&lt;/th&gt;
 {/foreach}
 &lt;th&gt;Actions&lt;/th&gt;
&lt;/tr&gt;
{foreach from=$paging_data item=data}
 &lt;traltrow,altrow2"}"&gt;

 {foreach from=$data.$model key=key item=item}
 &lt;td&gt;
 {$item}&lt;br&gt;
 &lt;/td&gt;
 {/foreach}
 {assign var='id' value=$data.$model.id}
 {assign_assoc var='view_link' value='action=&gt;view,$id'}
 &lt;td&gt;
 {$view_link}
 {$html-&gt;link('View', "view/$id")}
 {$html-&gt;link('Edit', "edit/$id")}
 {$html-&gt;link('Delete', "delete/$id")}
 &lt;/td&gt;
 &lt;/tr&gt;
{/foreach}
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
 {$paginator-&gt;prev('&lt;&lt; '.__('previous', true), array(), null, array('class'=&gt;'disabled'))}
 |      {$paginator-&gt;numbers()}
 {$paginator-&gt;next(__('next', true).' &gt;&gt;', array(), null, array('class'=&gt;'disabled'))}
&lt;/div&gt;</pre>
<li>翻訳テーブルの作成</li>
<p>例えば</p>
<pre class="brush:sql">
create table translates (
        id              serial NOT NULL,
        word            text,
        translate       text,
        created         timestamp(0) default NULL,
        modified        timestamp(0) default NULL
);
</pre>
<p>こんな感じで。対象のテーブルの各項目をwordに、その訳をtranslateに格納しておきます。</p>
<li>controllerの修正</li>
<p>translatesテーブルを使う。</p>
<pre class="brush:php">
var $uses = array('Servers','Translates')
</pre>
<p>index functionの中を修正。</p>
<pre class="brush:php">function index() {
   $this-&gt;Server-&gt;recursive = 0;
  //$this-&gt;set('servers', $this-&gt;paginate());

   $this-&gt;set(
       'translate',$this-&gt;Translate-&gt;find(
            'list',
            array('fields'=&gt;
                  array('Translate.word','Translate.translate')
            )
        )
    );

    $this-&gt;set('model','Server');
    $this-&gt;set('paging_data', $this-&gt;paginate());
 }</pre>
<li>viewの変更</li>
<p>index.ctpの代わりにindex.tplを作成。</p>
<pre class="brush:html">&lt;div&gt;
&lt;h2&gt;{$model}&lt;/h2&gt;
&lt;p&gt;
{include file="elements/paging.tpl"}</pre>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/111/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>はてなとdel.icio.usの被ブクマ数を表示するプラグイン</title>
		<link>http://www.airgroove.com/tech/archives/105</link>
		<comments>http://www.airgroove.com/tech/archives/105#comments</comments>
		<pubDate>Thu, 06 Aug 2009 09:25:32 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=105</guid>
		<description><![CDATA[被ブックマーク数表示＋ランキング生成プラグインからSBM Popular Entry　pluginをダウンロード。 そして、wp-content/plugins/にアップロード 表示させるには、comments.phpの一番上に を追記。 ランキング表示はsidebar.phpに < ?php SBM_popular_entry_list(10) ?> を追記。 No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://aoina.com/archives/18">被ブックマーク数表示＋ランキング生成プラグイン</a>からSBM Popular Entry　pluginをダウンロード。</p>
<p>そして、wp-content/plugins/にアップロード</p>
<p>表示させるには、comments.phpの一番上に</p>
<pre class="brush:php">
<?php SBM_count_get() ?>
</pre>
<p>を追記。</p>
<p>ランキング表示はsidebar.phpに</p>
<pre class="brush:php">
< ?php SBM_popular_entry_list(10) ?>
</pre>
<p>を追記。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/105/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bakeで雛型を作る</title>
		<link>http://www.airgroove.com/tech/archives/60</link>
		<comments>http://www.airgroove.com/tech/archives/60#comments</comments>
		<pubDate>Thu, 06 Aug 2009 08:26:58 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=60</guid>
		<description><![CDATA[DBにテーブルをあらかじめ作成しておく。 今回使うテーブルは「servers」。 bakeの実行 $ cd [cakeのインストール先]/cake/console $ ./cake bake Welcome to CakePHP v1.2.4.8284 Console --------------------------------------------------------------- App : app Path: /home/iwd-idc/httpd/cake/app --------------------------------------------------------------- Interactive Bake Shell --------------------------------------------------------------- [D]atabase Configuration [M]odel [V]iew [C]ontroller [P]roject [Q]uit What would you like to Bake? (D/M/V/C/P/Q) Databaseの設定 Databaseの設定はここからもできる。 --------------------------------------------------------------- Database Configuration: --------------------------------------------------------------- Name: [default] > Driver: (db2/firebird/mssql/mysql/mysqli/odbc/oracle/postgres/sqlite/sybase) [mysql] > postgres Persistent Connection? [...]


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/111' rel='bookmark' title='Permanent Link: paginatorのSmarty化'>paginatorのSmarty化</a></li>
<li><a href='http://www.airgroove.com/tech/archives/39' rel='bookmark' title='Permanent Link: cakephp最初のコントローラー'>cakephp最初のコントローラー</a></li>
<li><a href='http://www.airgroove.com/tech/archives/64' rel='bookmark' title='Permanent Link: cakephpにsimpletest'>cakephpにsimpletest</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>DBにテーブルをあらかじめ作成しておく。<br />
今回使うテーブルは「servers」。</p>
<li>bakeの実行</li>
<p><span id="more-60"></span></p>
<pre class="brush:bash">
$ cd [cakeのインストール先]/cake/console
$ ./cake bake
Welcome to CakePHP v1.2.4.8284 Console
---------------------------------------------------------------
App : app
Path: /home/iwd-idc/httpd/cake/app
---------------------------------------------------------------
Interactive Bake Shell
---------------------------------------------------------------
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[Q]uit
What would you like to Bake? (D/M/V/C/P/Q)
</pre>
<li>Databaseの設定</li>
<p>Databaseの設定はここからもできる。</p>
<pre class="brush:bash">
---------------------------------------------------------------
Database Configuration:
---------------------------------------------------------------
Name:
[default] >
Driver: (db2/firebird/mssql/mysql/mysqli/odbc/oracle/postgres/sqlite/sybase)
[mysql] > postgres
Persistent Connection? (y/n)
[n] >
Database Host:
[localhost] >
Port?
[n] >
User:
[root] > test
Password:
> test
Database Name:
[cake] > test
Table Prefix?
[n] >
Table encoding?
[n] >
Table schema?
[n] > 

---------------------------------------------------------------
The following database configuration will be created:
---------------------------------------------------------------
Name:         default
Driver:       postgres
Persistent:   false
Host:         localhost
User:         test
Pass:         *******
Database:     test
---------------------------------------------------------------
Look okay? (y/n)
[y] >
Do you wish to add another database configuration?
[n] > 

Creating file [cakeのインストール先]/app/config/database.php
Wrote [cakeのインストール先]/app/config/database.php
</pre>
<li>Modelの作成</li>
<pre class="brush:bash">
What would you like to Bake? (D/M/V/C/P/Q)
> M
---------------------------------------------------------------
Bake Model
Path: [cakeのインストール先]/app/models/
---------------------------------------------------------------
Use Database Config: (test/default)
[default] >
Possible Models based on your current database:
1. Server
Enter a number from the list above, type in the name of another model, or 'q' to exit
[q] > 1

Given your model named 'Server', Cake would expect a database table named servers
Do you want to use this table? (y/n)
[y] >
Would you like to supply validation criteria for the fields in your model? (y/n)
[y] > n   #とりあえずValidateは設定しない
Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)? (y/n)
[y] > n    #とりあえずリレーションは設定しない

---------------------------------------------------------------
The following Model will be created:
---------------------------------------------------------------
Name:       Server
Associations:
---------------------------------------------------------------
Look okay? (y/n)
[y] > 

Baking model class for Server...

Creating file [cakeのインストール先]/app/models/server.php
Wrote [cakeのインストール先]/app/models/server.php
</pre>
<li>Controllerの作成</li>
<pre class="brush:bash">
What would you like to Bake? (D/M/V/C/P/Q)
> C
---------------------------------------------------------------
Bake Controller
Path: [cakeのインストール先]/app/controllers/
---------------------------------------------------------------
Possible Controllers based on your current database:
1. Servers
Enter a number from the list above, type in the name of another controller, or 'q' to exit
[q] > 1
---------------------------------------------------------------
Baking ServersController
---------------------------------------------------------------
Would you like to build your controller interactively? (y/n)
[y] >
Would you like to use scaffolding? (y/n)
[n] >
Would you like to include some basic class methods (index(), add(), view(), edit())? (y/n)
[n] > y
Would you like to create the methods for admin routing? (y/n)
[n] > y
Would you like this controller to use other helpers besides HtmlHelper and FormHelper? (y/n)
[n] >
Would you like this controller to use any components? (y/n)
[n] >
Would you like to use Sessions? (y/n)
[y] > 

---------------------------------------------------------------
The following controller will be created:
---------------------------------------------------------------
Controller Name:  Servers
---------------------------------------------------------------
Look okay? (y/n)
[y] > 

Creating file [cakeのインストール先]/app/controllers/servers_controller.php
Wrote [cakeのインストール先]/app/controllers/servers_controller.php

Baking unit test for Servers...

Creating file [cakeのインストール先]/app/tests/cases/controllers/servers_controller.test.php
Wrote [cakeのインストール先]/app/tests/cases/controllers/servers_controller.test.php
</pre>
<li>Viewの作成</li>
<pre class="brush:bash">
What would you like to Bake? (D/M/V/C/P/Q)
> V
---------------------------------------------------------------
Bake View
Path: [cakeのインストール先]/app/views/
---------------------------------------------------------------
Possible Controllers based on your current database:
1. Servers
Enter a number from the list above, type in the name of another controller, or 'q' to exit
[q] > 1
Would you like to create some scaffolded views (index, add, view, edit) for this controller?
NOTE: Before doing so, you'll need to create your controller and model classes (including associated models). (y/n)
[n] > y
Would you like to create the views for admin routing? (y/n)
[y] > y

Creating file [cakeのインストール先]/app/views/servers/index.ctp
Wrote [cakeのインストール先]/app/views/servers/index.ctp

Creating file [cakeのインストール先]/app/views/servers/view.ctp
Wrote [cakeのインストール先]/app/views/servers/view.ctp

Creating file [cakeのインストール先]/app/views/servers/add.ctp
Wrote [cakeのインストール先]/app/views/servers/add.ctp

Creating file [cakeのインストール先]/app/views/servers/edit.ctp
Wrote [cakeのインストール先]/app/views/servers/edit.ctp

Creating file [cakeのインストール先]/app/views/servers/admin_index.ctp
Wrote [cakeのインストール先]/app/views/servers/admin_index.ctp

Creating file [cakeのインストール先]/app/views/servers/admin_view.ctp
Wrote [cakeのインストール先]/app/views/servers/admin_view.ctp

Creating file [cakeのインストール先]/app/views/servers/admin_add.ctp
Wrote [cakeのインストール先]/app/views/servers/admin_add.ctp

Creating file [cakeのインストール先]/app/views/servers/admin_edit.ctp
Wrote [cakeのインストール先]/app/views/servers/admin_edit.ctp
---------------------------------------------------------------

View Scaffolding Complete.
</pre>
<li>動作確認</li>
<p>http://[cakeをインストールしたサイト]/servers</p>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/111' rel='bookmark' title='Permanent Link: paginatorのSmarty化'>paginatorのSmarty化</a></li>
<li><a href='http://www.airgroove.com/tech/archives/39' rel='bookmark' title='Permanent Link: cakephp最初のコントローラー'>cakephp最初のコントローラー</a></li>
<li><a href='http://www.airgroove.com/tech/archives/64' rel='bookmark' title='Permanent Link: cakephpにsimpletest'>cakephpにsimpletest</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/60/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephpにsimpletest</title>
		<link>http://www.airgroove.com/tech/archives/64</link>
		<comments>http://www.airgroove.com/tech/archives/64#comments</comments>
		<pubDate>Thu, 06 Aug 2009 08:03:03 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=64</guid>
		<description><![CDATA[ダウンロード simpletestからダウンロードして、[cakeのインストール先]/app/vendors/simpletestに設置。 $ cd [cakeのインストール先]/app/vendors $ tar zxpf simpletest_1.0.1.tar.gz 動作確認 http://[cakeをインストール]したサーバ]/test.php Related posts:bakeで雛型を作る cakephpでSmartyを使う


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
<li><a href='http://www.airgroove.com/tech/archives/35' rel='bookmark' title='Permanent Link: cakephpでSmartyを使う'>cakephpでSmartyを使う</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<li>ダウンロード</li>
<p><a href="http://simpletest.sourceforge.net/">simpletest</a>からダウンロードして、[cakeのインストール先]/app/vendors/simpletestに設置。</p>
<pre class="brush:bash">
$ cd [cakeのインストール先]/app/vendors
$ tar zxpf simpletest_1.0.1.tar.gz
</pre>
<li>動作確認</li>
<p>http://[cakeをインストール]したサーバ]/test.php</p>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
<li><a href='http://www.airgroove.com/tech/archives/35' rel='bookmark' title='Permanent Link: cakephpでSmartyを使う'>cakephpでSmartyを使う</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephp smartyのテンプレートのパスを変更</title>
		<link>http://www.airgroove.com/tech/archives/47</link>
		<comments>http://www.airgroove.com/tech/archives/47#comments</comments>
		<pubDate>Wed, 05 Aug 2009 09:57:42 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=47</guid>
		<description><![CDATA[templateの場所を app/views/pages/smarty/display.tplからapp/views/pages/display.tplに変更する。 app/config/core.phpの最後に Configure::write('Smarty.subDir', ''); Configure::write('Smarty.layoutPath', ''); を追加。 Related posts:cakephp導入 cakephp最初のコントローラー


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/3' rel='bookmark' title='Permanent Link: cakephp導入'>cakephp導入</a></li>
<li><a href='http://www.airgroove.com/tech/archives/39' rel='bookmark' title='Permanent Link: cakephp最初のコントローラー'>cakephp最初のコントローラー</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>templateの場所を<br />
app/views/pages/smarty/display.tplからapp/views/pages/display.tplに変更する。</p>
<p>app/config/core.phpの最後に</p>
<pre class="brush:php">
    Configure::write('Smarty.subDir', '');
    Configure::write('Smarty.layoutPath', '');
</pre>
<p>を追加。</p>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/3' rel='bookmark' title='Permanent Link: cakephp導入'>cakephp導入</a></li>
<li><a href='http://www.airgroove.com/tech/archives/39' rel='bookmark' title='Permanent Link: cakephp最初のコントローラー'>cakephp最初のコントローラー</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephp最初のコントローラー</title>
		<link>http://www.airgroove.com/tech/archives/39</link>
		<comments>http://www.airgroove.com/tech/archives/39#comments</comments>
		<pubDate>Wed, 05 Aug 2009 09:39:10 +0000</pubDate>
		<dc:creator>outsider</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.airgroove.com/tech/?p=39</guid>
		<description><![CDATA[app/controllers/pages_controller.php class PagesController extends AppController{ var $name = 'Pages'; var $view = 'Smarty'; function display(){ } function admin_index(){ echo "admin_index"; } } app/models/page.php class Page extends AppModel { var $name = 'Page'; var $useTable = false; } app/views/pages/smarty/display.tpl this is display.tpl Related posts:cakephp smartyのテンプレートのパスを変更 bakeで雛型を作る paginatorのSmarty化


Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/47' rel='bookmark' title='Permanent Link: cakephp smartyのテンプレートのパスを変更'>cakephp smartyのテンプレートのパスを変更</a></li>
<li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
<li><a href='http://www.airgroove.com/tech/archives/111' rel='bookmark' title='Permanent Link: paginatorのSmarty化'>paginatorのSmarty化</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>app/controllers/pages_controller.php</p>
<pre class="brush:php">
class PagesController extends AppController{
        var $name = 'Pages';
        var $view = 'Smarty';
        function display(){
        }
        function admin_index(){
                echo "admin_index";
        }
}
</pre>
<p>app/models/page.php</p>
<pre class="brush:php">
class Page extends AppModel {
        var $name = 'Page';
        var $useTable = false;
}
</pre>
<p>app/views/pages/smarty/display.tpl</p>
<pre class="brush:html">
this is display.tpl
</pre>


<p>Related posts:<ol><li><a href='http://www.airgroove.com/tech/archives/47' rel='bookmark' title='Permanent Link: cakephp smartyのテンプレートのパスを変更'>cakephp smartyのテンプレートのパスを変更</a></li>
<li><a href='http://www.airgroove.com/tech/archives/60' rel='bookmark' title='Permanent Link: bakeで雛型を作る'>bakeで雛型を作る</a></li>
<li><a href='http://www.airgroove.com/tech/archives/111' rel='bookmark' title='Permanent Link: paginatorのSmarty化'>paginatorのSmarty化</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.airgroove.com/tech/archives/39/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

