<?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>PHPプログラマのバリ・ポジ情報ブログ &#187; PHP</title>
	<atom:link href="http://blog.veryposi.info/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.veryposi.info</link>
	<description>PHP,JavaScriptやサーバーの設定などのプログラミングに関する情報をバリ・ポジティブに発信しているプログラマのブログ、『バリ・ポジ』</description>
	<lastBuildDate>Thu, 10 May 2012 06:23:01 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CodeIgniter2.Xでのmemcacheを使用する場合の方法</title>
		<link>http://blog.veryposi.info/programing/php/codeigniter2-memcached/</link>
		<comments>http://blog.veryposi.info/programing/php/codeigniter2-memcached/#comments</comments>
		<pubDate>Thu, 12 May 2011 02:51:47 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1470</guid>
		<description><![CDATA[&#160;CodeIgniter2.Xになって新しくキャッシュドライバが追加されているので設定メモ &#160; application/config/memcached.phpを作成する 設定する項目は １．host [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;CodeIgniter2.Xになって新しくキャッシュドライバが追加されているので設定メモ</p>
<p>&nbsp;</p>
<p>application/config/memcached.phpを作成する</p>
<p>設定する項目は</p>
<p>１．hostname</p>
<p>２．port</p>
<p>３．weight</p>
<p>もし上記が指定されていない場合は、以下のデフォルト値が使用される</p>
<p>hostname =&gt; &#8217;127.0.0.1&#8242;,</p>
<p>port =&gt; 11211,</p>
<p>weight =&gt; 1,</p>
<p>設定の例</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
</pre>
</td>
<td class="code">
<pre class="php"><span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache01'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'hostname'</span><span style="color: #66cc66;">]</span> = <span style="color: #ff0000;">'192.168.1.101'</span>,
<span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache01'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'port'</span><span style="color: #66cc66;">]</span>     = <span style="color: #cc66cc;">11211</span>,
<span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache01'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'weight'</span><span style="color: #66cc66;">]</span>   = <span style="color: #cc66cc;">0</span>,
<span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache02'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'hostname'</span><span style="color: #66cc66;">]</span> = <span style="color: #ff0000;">'192.168.1.102'</span>,
<span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache02'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'port'</span><span style="color: #66cc66;">]</span>     = <span style="color: #cc66cc;">11211</span>,
<span style="color: #0000ff;">$config</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'memcache02'</span><span style="color: #66cc66;">]</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">'weight'</span><span style="color: #66cc66;">]</span>   = <span style="color: #cc66cc;">0</span>,</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>ちなみに、</p>
<p>Memcached::OPT_LIBKETAMA_COMPATIBLE</p>
<p>これを設定しておかないとサーバー台数の増減があった場合に、今までのキャッシュが有効的に使用されない。</p>
<p>このライブラリの中では何もオプションは設定されていないので、必要に応じて個人で設定する必要がある。</p>
<p>が・・・設定方法がないな・・・。</p>
<div>&nbsp;</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/codeigniter2-memcached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPでの正規表現のチェックが出来るサイト</title>
		<link>http://blog.veryposi.info/programing/php/php-regexp/</link>
		<comments>http://blog.veryposi.info/programing/php/php-regexp/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 07:09:24 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1450</guid>
		<description><![CDATA[&#160;PHPで正規表現を使用する場合に便利なサイト PHP正規表現チェッカー&#160;ver1.0.3 です。 このサイトを使用すると、PHPの正規表現のチェックが簡単にチェック出来ます。 便利だ]]></description>
			<content:encoded><![CDATA[<p>&nbsp;PHPで正規表現を使用する場合に便利なサイト</p>
<p>
<meta charset="utf-8"><a href="http://www.rider-n.sakura.ne.jp/regexp/regexp.php">PHP正規表現チェッカー&nbsp;ver1.0.3</a></meta>
</p>
<p>です。</p>
<p>このサイトを使用すると、PHPの正規表現のチェックが簡単にチェック出来ます。</p>
<p>便利だ<img alt="" src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sign01.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/php-regexp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>symfonyのアプリケーションの作成</title>
		<link>http://blog.veryposi.info/programing/php/symfony-generate-app/</link>
		<comments>http://blog.veryposi.info/programing/php/symfony-generate-app/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 04:59:48 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1426</guid>
		<description><![CDATA[&#160;symfonyでのアプリケーションの作成方法です。 &#160; 1 php symfony generate:app [アプリケーション名] &#160;]]></description>
			<content:encoded><![CDATA[<p>&nbsp;symfonyでのアプリケーションの作成方法です。</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php">
php symfony generate:app <span style="color: #66cc66;">[</span>アプリケーション名<span style="color: #66cc66;">]</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/symfony-generate-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>symfonyでのプロジェクトの作成</title>
		<link>http://blog.veryposi.info/programing/php/symfony-generate-project/</link>
		<comments>http://blog.veryposi.info/programing/php/symfony-generate-project/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 04:48:04 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1424</guid>
		<description><![CDATA[&#160;symfonyでのプロジェクトの作成方法 &#160; 1 php lib/vendor/symfony/data/bin/symfony generate:project [プロジェクト名] --orm=P [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;symfonyでのプロジェクトの作成方法</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php">
php lib/vendor/symfony/data/bin/symfony generate:project <span style="color: #66cc66;">[</span>プロジェクト名<span style="color: #66cc66;">]</span> --orm=Propel</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>ORMをPropelでプロジェクトを作成するにはこのようにするべし</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/symfony-generate-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>symfonyのコマンド一覧</title>
		<link>http://blog.veryposi.info/programing/php/symfony-cmd/</link>
		<comments>http://blog.veryposi.info/programing/php/symfony-cmd/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 04:39:11 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1420</guid>
		<description><![CDATA[&#160;symfonyのコマンド一覧です。 とりあえず備忘録 &#160; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;symfonyのコマンド一覧です。</p>
<p>とりあえず備忘録</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre>
</td>
<td class="code">
<pre class="bash">
Usage:
  symfony <span style="color: #7a0874; font-weight: bold;">[</span>options<span style="color: #7a0874; font-weight: bold;">]</span> task_name <span style="color: #7a0874; font-weight: bold;">[</span>arguments<span style="color: #7a0874; font-weight: bold;">]</span>
&nbsp;
Options:
  --<span style="color: #7a0874; font-weight: bold;">help</span>                   -H  Display this <span style="color: #7a0874; font-weight: bold;">help</span> message.
  --quiet                  -q  Do not log messages to standard output.
  --trace                  -t  Turn on invoke/execute tracing, <span style="color: #7a0874; font-weight: bold;">enable</span> full backtrace.
  --version                -V  Display the program version.
  --color                      Forces ANSI color output.
  --xml                        To output <span style="color: #7a0874; font-weight: bold;">help</span> <span style="color: #c20cb9; font-weight: bold;">as</span> XML
&nbsp;
Available tasks:
  :<span style="color: #7a0874; font-weight: bold;">help</span>               Displays <span style="color: #7a0874; font-weight: bold;">help</span> <span style="color: #000000; font-weight: bold;">for</span> a task
  :list               Lists tasks
app
  :routes             Displays current routes <span style="color: #000000; font-weight: bold;">for</span> an application
cache
  :<span style="color: #c20cb9; font-weight: bold;">clear</span>              Clears the cache <span style="color: #7a0874; font-weight: bold;">(</span><span style="color: #c20cb9; font-weight: bold;">cc</span><span style="color: #7a0874; font-weight: bold;">)</span>
configure
  :author             Configure project author
generate
  :app                Generates a new application
  :module             Generates a new module
  :project            Generates a new project
  :task               Creates a skeleton class <span style="color: #000000; font-weight: bold;">for</span> a new task
i18n
  :extract            Extracts i18n <span style="color: #c20cb9; font-weight: bold;">strings</span> from php files
  :<span style="color: #c20cb9; font-weight: bold;">find</span>               Finds non <span style="color: #ff0000;">&quot;i18n ready&quot;</span> <span style="color: #c20cb9; font-weight: bold;">strings</span> <span style="color: #000000; font-weight: bold;">in</span> an application
log
  :<span style="color: #c20cb9; font-weight: bold;">clear</span>              Clears log files
  :rotate             Rotates an application<span style="color: #ff0000;">'s log files
plugin
  :add-channel        Add a new PEAR channel
  :install            Installs a plugin
  :list               Lists installed plugins
  :publish-assets     Publishes web assets for all plugins
  :uninstall          Uninstalls a plugin
  :upgrade            Upgrades a plugin
project
  :clear-controllers  Clears all non production environment controllers
  :deploy             Deploys a project to another server
  :disable            Disables an application in a given environment
  :enable             Enables an application in a given environment
  : optimize           Optimizes a project for better performance
  :permissions        Fixes symfony directory permissions
  :send-emails        Sends emails stored in a queue
  :validate           Finds deprecated usage in a project
symfony
  :test               Launches the symfony test suite
test
  :all                Launches all tests
  :coverage           Outputs test code coverage
  :functional         Launches functional tests
  :unit               Launches unit tests</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/symfony-cmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPでAuthorizationヘッダーを取得する方法</title>
		<link>http://blog.veryposi.info/programing/php/php-authorization/</link>
		<comments>http://blog.veryposi.info/programing/php/php-authorization/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 10:42:15 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1323</guid>
		<description><![CDATA[PHPでAuthorizationヘッダーを取得しようと思って 1 var_dump($_SERVER); とかしてみたりしても取得できない・・・ まぁそりゃそうなんだけど、 でその場合に必要なのが、 1 getallh [...]]]></description>
			<content:encoded><![CDATA[<p>PHPでAuthorizationヘッダーを取得しようと思って</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/var_dump"><span style="color: rgb(0, 0, 102);">var_dump</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$_SERVER</span><span style="color: rgb(102, 204, 102);">)</span>;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>とかしてみたりしても取得できない・・・<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sweat01.gif" alt="" /></p>
<p>まぁそりゃそうなんだけど、</p>
<p>でその場合に必要なのが、</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/getallheaders"><span style="color: rgb(0, 0, 102);">getallheaders</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>という関数があります。</p>
<p>これで、Authorizationヘッダーの内容を無事取得できます。</p>
<p>これで、mixiモバイルアプリでの検証ができるようになります。</p>
<p>よかった。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/php-authorization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniterにmemcacheをsession使用するライブラリを作成しました</title>
		<link>http://blog.veryposi.info/programing/php/codeigniter-memcache-session-php/</link>
		<comments>http://blog.veryposi.info/programing/php/codeigniter-memcache-session-php/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 09:08:37 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1285</guid>
		<description><![CDATA[PHPのセッション管理にmemcacheを使用しようとしていて複数台のサーバーでmemcacheを利用しようとした場合に php.iniの設定だけではどうやってもできなかった・・・。（本当は出来るのかもしれないのだけど・ [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: rgb(255, 102, 0);"><span style="font-size: large;">P</span></span>HPのセッション管理にmemcacheを使用しようとしていて複数台のサーバーでmemcacheを利用しようとした場合に</p>
<p>php.iniの設定だけではどうやってもできなかった・・・。（本当は出来るのかもしれないのだけど・・・<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sweat02.gif" alt="" />）</p>
<p>&nbsp;</p>
<p>なので、ライブラリを作成しました。</p>
<p>今回はCodeIgniter用のライブラリです。</p>
<p>よかったら使ってみてください。</p>
<div class="syntax">
<table>
<tbody>
<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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
</pre>
</td>
<td class="code">
<pre class="php"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;?php</span>  <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> ! <a href="http://www.php.net/defined"><span style="color: rgb(0, 0, 102);">defined</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">'BASEPATH'</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <a href="http://www.php.net/exit"><span style="color: rgb(0, 0, 102);">exit</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">'No direct script access allowed'</span><span style="color: rgb(102, 204, 102);">)</span>;
<span style="color: rgb(128, 128, 128); font-style: italic;">/**
 *
 * memcacheを利用したsessionライブラリ
 *
 * memcacheを利用したsession管理処理を行う
 *
 * @access public
 * @varsion 1.00
 * @sinse 2009/06/03
 */</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">class</span> Memsession <span style="color: rgb(102, 204, 102);">{</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   * CodeIgniterインスタンス
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 255);">$CI</span> = <span style="color: rgb(0, 0, 0); font-weight: bold;">null</span>;
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   * memcacheインスタンス
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 255);">$memcache</span> = <span style="color: rgb(0, 0, 0); font-weight: bold;">null</span>;
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   * セッションキー
   */</span>
   <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 255);">$key</span> = <span style="color: rgb(255, 0, 0);">'memsess_'</span>;
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   * configファイル名
   */</span>
   <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> <span style="color: rgb(0, 0, 255);">$conf_name</span> = <span style="color: rgb(255, 0, 0);">'memcache_config'</span>;
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * コンストラクタ
   *
   * @access public
   * @return void
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> __construct<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">CI</span> = &amp; get_instance<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">CI</span>-&gt;<span style="color: rgb(0, 102, 0);">config</span>-&gt;<span style="color: rgb(0, 102, 0);">load</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">conf_name</span>,<span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>,<span style="color: rgb(0, 0, 0); font-weight: bold;">true</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">init_cache</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>;
    <a href="http://www.php.net/session_set_save_handler"><span style="color: rgb(0, 0, 102);">session_set_save_handler</span></a><span style="color: rgb(102, 204, 102);">(</span>
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;open&quot;</span><span style="color: rgb(102, 204, 102);">)</span>,
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;close&quot;</span><span style="color: rgb(102, 204, 102);">)</span>,
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;read&quot;</span><span style="color: rgb(102, 204, 102);">)</span>,
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;write&quot;</span><span style="color: rgb(102, 204, 102);">)</span>,
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;destroy&quot;</span><span style="color: rgb(102, 204, 102);">)</span>,
      <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span>&amp; <span style="color: rgb(0, 0, 255);">$this</span>, <span style="color: rgb(255, 0, 0);">&quot;gc&quot;</span><span style="color: rgb(102, 204, 102);">)</span>
    <span style="color: rgb(102, 204, 102);">)</span>;
    <a href="http://www.php.net/session_start"><span style="color: rgb(0, 0, 102);">session_start</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * memcache初期化処理
   *
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> init_cache<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span>!<a href="http://www.php.net/isset"><span style="color: rgb(0, 0, 102);">isset</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
      <span style="color: rgb(0, 0, 255);">$ret</span> = <span style="color: rgb(0, 0, 0); font-weight: bold;">false</span>;
      <span style="color: rgb(0, 0, 255);">$servers</span> = <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">CI</span>-&gt;<span style="color: rgb(0, 102, 0);">config</span>-&gt;<span style="color: rgb(0, 102, 0);">item</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">'servers'</span>, <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">conf_name</span><span style="color: rgb(102, 204, 102);">)</span>;
      <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span> =&amp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> Memcache<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>;
      <span style="color: rgb(177, 177, 0);">foreach</span> <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$servers</span> <span style="color: rgb(177, 177, 0);">as</span> <span style="color: rgb(0, 0, 255);">$server</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
        <span style="color: rgb(0, 0, 255);">$parts</span> = <a href="http://www.php.net/explode"><span style="color: rgb(0, 0, 102);">explode</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">':'</span>, <span style="color: rgb(0, 0, 255);">$server</span><span style="color: rgb(102, 204, 102);">)</span>;
        <span style="color: rgb(0, 0, 255);">$host</span>  = <span style="color: rgb(0, 0, 255);">$parts</span><span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">0</span><span style="color: rgb(102, 204, 102);">]</span>;
        <span style="color: rgb(0, 0, 255);">$port</span>  = <span style="color: rgb(204, 102, 204);">11211</span>;
        <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span><a href="http://www.php.net/isset"><span style="color: rgb(0, 0, 102);">isset</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$parts</span><span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">]</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
          <span style="color: rgb(0, 0, 255);">$port</span> = <span style="color: rgb(0, 0, 255);">$parts</span><span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">]</span>;
        <span style="color: rgb(102, 204, 102);">}</span>
        <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span>-&gt;<span style="color: rgb(0, 102, 0);">addServer</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$host</span>, <span style="color: rgb(0, 0, 255);">$port</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
          <span style="color: rgb(0, 0, 255);">$ret</span> = <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
        <span style="color: rgb(102, 204, 102);">}</span>
      <span style="color: rgb(102, 204, 102);">}</span>
      <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 255);">$ret</span>;
    <span style="color: rgb(102, 204, 102);">}</span>
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * open 関数
   *
   * @param string 保存パス
   * @param string セッション名
   * @return bool
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> open<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$save_path</span>, <span style="color: rgb(0, 0, 255);">$session_name</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">session_path</span> = <span style="color: rgb(0, 0, 255);">$save_path</span>;
    <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">session_name</span> = <span style="color: rgb(0, 0, 255);">$session_name</span>;
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * close 関数
   *
   * @return bool
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> close<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * read 関数
   *
   * @param string セッションID
   * @return string
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> read<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$id</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$sess_data</span> = <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span>-&gt;<span style="color: rgb(0, 102, 0);">get</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">key</span>.<span style="color: rgb(0, 0, 255);">$id</span><span style="color: rgb(102, 204, 102);">)</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
      <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 255);">$sess_data</span>;
    <span style="color: rgb(102, 204, 102);">}</span> <span style="color: rgb(177, 177, 0);">else</span> <span style="color: rgb(102, 204, 102);">{</span>
      <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(255, 0, 0);">''</span>;
    <span style="color: rgb(102, 204, 102);">}</span>
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * write 関数
   *
   * @param string セッションID
   * @param string データ
   * @retrun bool
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> write<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$id</span>, <span style="color: rgb(0, 0, 255);">$sess_data</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span><a href="http://www.php.net/trim"><span style="color: rgb(0, 0, 102);">trim</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$id</span><span style="color: rgb(102, 204, 102);">)</span> == <span style="color: rgb(255, 0, 0);">''</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
    <span style="color: rgb(0, 0, 255);">$compress</span> = <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">CI</span>-&gt;<span style="color: rgb(0, 102, 0);">config</span>-&gt;<span style="color: rgb(0, 102, 0);">item</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">'compress'</span>, <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">conf_name</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(0, 0, 255);">$expires</span>  = <a href="http://www.php.net/ini_get"><span style="color: rgb(0, 0, 102);">ini_get</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">&quot;session.gc_maxlifetime&quot;</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(0, 0, 255);">$ret</span> = <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span>-&gt;<span style="color: rgb(0, 102, 0);">set</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">key</span>.<span style="color: rgb(0, 0, 255);">$id</span>, <span style="color: rgb(0, 0, 255);">$sess_data</span>, <span style="color: rgb(0, 0, 255);">$compress</span>, <span style="color: rgb(0, 0, 255);">$expires</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 255);">$ret</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * destroy 関数
   *
   * @param string セッションID
   * @return bool
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> destroy<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$id</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(0, 0, 255);">$ret</span> = <span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">memcache</span>-&gt;<span style="color: rgb(0, 102, 0);">delete</span><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$this</span>-&gt;<span style="color: rgb(0, 102, 0);">key</span>.<span style="color: rgb(0, 0, 255);">$id</span><span style="color: rgb(102, 204, 102);">)</span>;
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 255);">$ret</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * ガベージコレクタ
   *
   * @return bool
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> gc<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$maxlifetime</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * SESSIONへの値の設定
   *
   * @param string キー
   * @param string 値
   * @return void
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> set<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$key</span>, <span style="color: rgb(0, 0, 255);">$value</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(0, 0, 255);">$_SESSION</span><span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(0, 0, 255);">$key</span><span style="color: rgb(102, 204, 102);">]</span> = <span style="color: rgb(0, 0, 255);">$value</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
  <span style="color: rgb(128, 128, 128); font-style: italic;">/**
   *
   * SESSIONからの値の取得
   *
   * @param string キー
   * @return mixed
   */</span>
  <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> get<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(0, 0, 255);">$key</span><span style="color: rgb(102, 204, 102);">)</span>
  <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(0, 0, 255);">$ret</span> = <span style="color: rgb(0, 0, 255);">$_SESSION</span><span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(0, 0, 255);">$key</span><span style="color: rgb(102, 204, 102);">]</span>;
    <span style="color: rgb(177, 177, 0);">return</span> <span style="color: rgb(0, 0, 255);">$ret</span>;
  <span style="color: rgb(102, 204, 102);">}</span>
&nbsp;
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/codeigniter-memcache-session-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CakePHPのfindの第1引数による戻り値の違い</title>
		<link>http://blog.veryposi.info/programing/php/cakephp-find-result/</link>
		<comments>http://blog.veryposi.info/programing/php/cakephp-find-result/#comments</comments>
		<pubDate>Wed, 13 May 2009 04:58:28 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1237</guid>
		<description><![CDATA[CakePHPでfindメソッドを使用した場合の戻り値についてです。 このようになテーブルを作成し、データを登録して検索します。 フィールド 種別 id int(11) name varchar(255) title v [...]]]></description>
			<content:encoded><![CDATA[<p>CakePHPでfindメソッドを使用した場合の戻り値についてです。</p>
<p>このようになテーブルを作成し、データを登録して検索します。</p>
<table border="1" class="layout">
<tbody>
<tr>
<td bgcolor="#99ccff" style="text-align: center;">フィールド</td>
<td bgcolor="#99ccff" style="text-align: center;">種別</td>
</tr>
<tr>
<td>id</td>
<td>int(11)</td>
</tr>
<tr>
<td>name</td>
<td>varchar(255)</td>
</tr>
<tr>
<td>title</td>
<td>varchar(255)</td>
</tr>
<tr>
<td>content</td>
<td>text</td>
</tr>
</tbody>
</table>
<p>&nbsp;findの第1引数が「all」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">0</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;Board&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">4</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;id&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;2&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;name&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">18</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;あんぱんまん&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;title&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
      <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;content&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
      string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;かれーぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">}</span>
  <span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;findの第1引数が「first」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;Board&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  <a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">4</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;id&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;2&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;name&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">18</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;あんぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;title&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
    <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(255, 0, 0);">&quot;content&quot;</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
    string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;かれーぱんまん&quot;</span>
  <span style="color: rgb(102, 204, 102);">}</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>findの第1引数が「list」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
</pre>
</td>
<td class="code">
<pre class="php"><a href="http://www.php.net/array"><span style="color: rgb(0, 0, 102);">array</span></a><span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">{</span>
  <span style="color: rgb(102, 204, 102);">[</span><span style="color: rgb(204, 102, 204);">2</span><span style="color: rgb(102, 204, 102);">]</span>=&gt;
  string<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">21</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(255, 0, 0);">&quot;しょくぱんまん&quot;</span>
<span style="color: rgb(102, 204, 102);">}</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>findの第1引数が「count」の場合</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="php">
int<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(204, 102, 204);">1</span><span style="color: rgb(102, 204, 102);">)</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/cakephp-find-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPを書くときに、vimでctagsを使用する方法</title>
		<link>http://blog.veryposi.info/programing/php/php-ctags-vim/</link>
		<comments>http://blog.veryposi.info/programing/php/php-ctags-vim/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 11:59:22 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ctags]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1229</guid>
		<description><![CDATA[symfonyで仕事していて、オブジェクト指向プログラミングなのでたくさんのファイルに処理が移動するので 処理を追いかけるだけでたいへん ということで、ctagsを使用することにしました。 まずは、インストール 1 su [...]]]></description>
			<content:encoded><![CDATA[<p>symfonyで仕事していて、オブジェクト指向プログラミングなのでたくさんのファイルに処理が移動するので</p>
<p>処理を追いかけるだけでたいへん<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/down.gif" alt="" /></p>
<p>ということで、ctagsを使用することにしました。</p>
<p>まずは、インストール</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="bash"><span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> apt-get <span style="color: rgb(194, 12, 185); font-weight: bold;">install</span> exuberant-ctags</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>これでインストール完了します。</p>
<p>で、ctagsを使用する為のtagsファイルの作成</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="bash">
ctags -a -f ~/.tags -R --<span style="color: rgb(0, 120, 0);">langmap=</span>PHP:.php.inc --php-<span style="color: rgb(0, 120, 0);">types=</span>c+f+d+v+i ./</pre>
</td>
</tr>
</tbody>
</table>
</div>
<ul>
<li>-a：既存のtagsファイルが存在した場合、追加登録します。</li>
<li>-f：tagsファイルの名前を指定します。</li>
<li>&#8211;langmap：対象にする拡張子を設定します。<br />
    デフォルト値は</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="div">
ctags --list-maps</pre>
</td>
</tr>
</tbody>
</table></div>
<p>    で調べることができます。</li>
<li>&#8211;php-types：tagsファイルを作成する時の種類を指定します。<br />
    種類は</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="div">
ctags --list-kinds=php</pre>
</td>
</tr>
</tbody>
</table></div>
<p>    で調べることができます。</li>
<li>-R：再帰的に処理を行います。</li>
</ul>
<p>これで、tagsファイルを使用できます。</p>
<p>上記内容でtagsファイルを作成した場合、「~/.tags」に内容が書き込まれます。</p>
<p>ですのでvimでそのファイルを使用できるように.vimrcに以下の設定を追加します。</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
</pre>
</td>
<td class="code">
<pre class="div">
set tags+=~/.tags</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;これでvimで作成したtagsファイルを読み込むことができます。</p>
<h3>vimでの使用方法</h3>
<p>Ctrl＋]：タグを進む</p>
<p>Ctrl＋T：タグを戻る</p>
<p>:pop：タグを戻る</p>
<p>:tags：移動経路を確認</p>
<p>:ts：他の候補を呼び出す</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/php/php-ctags-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails 対 symfony</title>
		<link>http://blog.veryposi.info/programing/ruby/ruby-on-rails-symfony/</link>
		<comments>http://blog.veryposi.info/programing/ruby/ruby-on-rails-symfony/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 11:57:45 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=1164</guid>
		<description><![CDATA[以前、一緒に仕事をしていた人がRuby on Rails は楽しいという話を聞いた、 んで、バイトで仕事を受けたらsymfonyでシステムが作られていた &#160; これは、神の啓示なのかなと思うので この休みの間にR [...]]]></description>
			<content:encoded><![CDATA[<p>以前、一緒に仕事をしていた人がRuby on Rails は楽しいという話を聞いた、</p>
<p>んで、バイトで仕事を受けたらsymfonyでシステムが作られていた</p>
<p>&nbsp;</p>
<p>これは、神の啓示なのかなと思うので</p>
<p>この休みの間にRuby on Railsとsymfonyで簡単なシステムを作ってどっちが優れているのか自分で比較してみようと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/ruby/ruby-on-rails-symfony/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: blog.veryposi.info @ 2026-04-16 06:52:46 -->