<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7443135140656968821</id><updated>2024-09-20T03:09:40.835+09:00</updated><category term="CakePHP2"/><category term="PHP"/><category term="FreeBSD"/><category term="Netbeans"/><category term="Haskell"/><category term="Apache"/><category term="Blogger"/><category term="Composer"/><category term="Debian"/><category term="MAMP"/><category term="OpenDNS"/><category term="PHPUnit"/><category term="SQL"/><category term="Shell"/><category term="Skype"/><category term="Twitter"/><category term="Wordpress"/><title type='text'>雑記</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yyamashita.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-6654794068307926944</id><published>2017-05-01T16:32:00.000+09:00</published><updated>2017-05-01T16:32:07.362+09:00</updated><title type='text'>[MAMP]PHPのバージョンが2つしか表示されない</title><content type='html'>備忘録。タイトルが答です。

&lt;br /&gt;
&lt;blockquote&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/42281405/mamp-phpmyadmin-is-not-active#42287871&quot;&gt;http://stackoverflow.com/questions/42281405/mamp-phpmyadmin-is-not-active#42287871&lt;/a&gt; &lt;/blockquote&gt;
&lt;blockquote&gt;
MAMP shows only two versions of PHP&lt;/blockquote&gt;
PHP7系が2つ表示されていたので、/Applications/MAMP/bin/php/ 内のフォルダを整理して(どうも降順で選択されるぽい)、無事php5系が表示されました。&lt;br /&gt;
正解に辿りつくのにめちゃくちゃ時間がかかった…</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6654794068307926944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6654794068307926944'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2017/05/mampphp2.html' title='[MAMP]PHPのバージョンが2つしか表示されない'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-6163539950236784525</id><published>2017-04-03T14:09:00.000+09:00</published><updated>2017-04-03T14:09:00.147+09:00</updated><title type='text'>[Cakephp2] cakedc/users プラグインと ACL ビヘイビアを併用するために必要な事</title><content type='html'>CakePHP2なんて、本当に今更ですが、2017年4月現在、cakedc/users とACLビヘイビアを併用するには、それぞれのチュートリアルに沿って変更をする点の他に、&lt;br /&gt;
例えばAppController.php の中の $components の設定に以下の一行を書き加える必要があります。&lt;br /&gt;
&lt;pre&gt;     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,&lt;/pre&gt;
該当ブロックは以下の様になります。 &lt;br /&gt;
&lt;pre&gt; public $components = array(
  &#39;Session&#39;,
  &#39;Flash&#39;,
  &#39;Acl&#39;,
  &#39;Auth&#39; =&amp;gt; array(
   &#39;loginAction&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;app_users&#39;,
    &#39;action&#39; =&amp;gt; &#39;login&#39;,
    &#39;plugin&#39; =&amp;gt; false
   ),
   &#39;loginRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;posts&#39;,
    &#39;action&#39; =&amp;gt; &#39;index&#39;
   ),
   &#39;logoutRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;pages&#39;,
    &#39;action&#39; =&amp;gt; &#39;display&#39;,
    &#39;home&#39;
   ),
   &#39;flash&#39; =&amp;gt; array(
    &#39;element&#39; =&amp;gt; &#39;alert&#39;,
    &#39;key&#39; =&amp;gt; &#39;auth&#39;,
    &#39;params&#39; =&amp;gt; array(
     &#39;plugin&#39; =&amp;gt; &#39;BoostCake&#39;,
     &#39;class&#39; =&amp;gt; &#39;alert-error&#39;
    )
   ),
   &#39;authorize&#39; =&amp;gt; array(
    &#39;Actions&#39; =&amp;gt; array(
     &#39;actionPath&#39; =&amp;gt; &#39;controllers&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
    ),
   ),
   //&#39;authError&#39; =&amp;gt; &#39;Did you really think you are allowed to see that?&#39;,
   &#39;authenticate&#39; =&amp;gt; array(
    &#39;Form&#39; =&amp;gt; array(
     &#39;passwordHasher&#39; =&amp;gt; &#39;Blowfish&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
     &#39;fields&#39; =&amp;gt; array(
      &#39;username&#39; =&amp;gt; &#39;username&#39;, //Default is &#39;username&#39; in the userModel
      &#39;password&#39; =&amp;gt; &#39;password&#39;  //Default is &#39;password&#39; in the userModel
     ),
    ),
   ),
  ),
  &#39;DebugKit.Toolbar&#39;
 );
&lt;/pre&gt;
&#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,&lt;br /&gt;
at your settings for Auth Component Section in AppContoroller.php.&lt;br /&gt;
whole block would be: &lt;br /&gt;
&lt;pre&gt; public $components = array(
  &#39;Session&#39;,
  &#39;Flash&#39;,
  &#39;Acl&#39;,
  &#39;Auth&#39; =&amp;gt; array(
   &#39;loginAction&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;app_users&#39;,
    &#39;action&#39; =&amp;gt; &#39;login&#39;,
    &#39;plugin&#39; =&amp;gt; false
   ),
   &#39;loginRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;posts&#39;,
    &#39;action&#39; =&amp;gt; &#39;index&#39;
   ),
   &#39;logoutRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;pages&#39;,
    &#39;action&#39; =&amp;gt; &#39;display&#39;,
    &#39;home&#39;
   ),
   &#39;flash&#39; =&amp;gt; array(
    &#39;element&#39; =&amp;gt; &#39;alert&#39;,
    &#39;key&#39; =&amp;gt; &#39;auth&#39;,
    &#39;params&#39; =&amp;gt; array(
     &#39;plugin&#39; =&amp;gt; &#39;BoostCake&#39;,
     &#39;class&#39; =&amp;gt; &#39;alert-error&#39;
    )
   ),
   &#39;authorize&#39; =&amp;gt; array(
    &#39;Actions&#39; =&amp;gt; array(
     &#39;actionPath&#39; =&amp;gt; &#39;controllers&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
    ),
   ),
   //&#39;authError&#39; =&amp;gt; &#39;Did you really think you are allowed to see that?&#39;,
   &#39;authenticate&#39; =&amp;gt; array(
    &#39;Form&#39; =&amp;gt; array(
     &#39;passwordHasher&#39; =&amp;gt; &#39;Blowfish&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
     &#39;fields&#39; =&amp;gt; array(
      &#39;username&#39; =&amp;gt; &#39;username&#39;, //Default is &#39;username&#39; in the userModel
      &#39;password&#39; =&amp;gt; &#39;password&#39;  //Default is &#39;password&#39; in the userModel
     ),
    ),
   ),
  ),
  &#39;DebugKit.Toolbar&#39;
 );
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6163539950236784525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6163539950236784525'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2017/04/cakephp2-cakedcusers-acl.html' title='[Cakephp2] cakedc/users プラグインと ACL ビヘイビアを併用するために必要な事'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-8220412186604019273</id><published>2017-04-03T14:03:00.003+09:00</published><updated>2017-04-03T14:09:17.738+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[CakePHP2] Using ACL Behaviar with cakedc/users</title><content type='html'>As of April, 2017, with cake 2.9.7 and the newest plugins, &lt;br /&gt;
You will need&amp;nbsp; &lt;br /&gt;
&lt;pre&gt;     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,&lt;/pre&gt;
at your settings for Auth Component Section in AppController.php.&lt;br /&gt;
whole block would be: &lt;br /&gt;
&lt;pre&gt; public $components = array(
  &#39;Session&#39;,
  &#39;Flash&#39;,
  &#39;Acl&#39;,
  &#39;Auth&#39; =&amp;gt; array(
   &#39;loginAction&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;app_users&#39;,
    &#39;action&#39; =&amp;gt; &#39;login&#39;,
    &#39;plugin&#39; =&amp;gt; false
   ),
   &#39;loginRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;posts&#39;,
    &#39;action&#39; =&amp;gt; &#39;index&#39;
   ),
   &#39;logoutRedirect&#39; =&amp;gt; array(
    &#39;controller&#39; =&amp;gt; &#39;pages&#39;,
    &#39;action&#39; =&amp;gt; &#39;display&#39;,
    &#39;home&#39;
   ),
   &#39;flash&#39; =&amp;gt; array(
    &#39;element&#39; =&amp;gt; &#39;alert&#39;,
    &#39;key&#39; =&amp;gt; &#39;auth&#39;,
    &#39;params&#39; =&amp;gt; array(
     &#39;plugin&#39; =&amp;gt; &#39;BoostCake&#39;,
     &#39;class&#39; =&amp;gt; &#39;alert-error&#39;
    )
   ),
   &#39;authorize&#39; =&amp;gt; array(
    &#39;Actions&#39; =&amp;gt; array(
     &#39;actionPath&#39; =&amp;gt; &#39;controllers&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
    ),
   ),
   //&#39;authError&#39; =&amp;gt; &#39;Did you really think you are allowed to see that?&#39;,
   &#39;authenticate&#39; =&amp;gt; array(
    &#39;Form&#39; =&amp;gt; array(
     &#39;passwordHasher&#39; =&amp;gt; &#39;Blowfish&#39;,
     &#39;userModel&#39; =&amp;gt; &#39;AppUser&#39;,
     &#39;fields&#39; =&amp;gt; array(
      &#39;username&#39; =&amp;gt; &#39;username&#39;, //Default is &#39;username&#39; in the userModel
      &#39;password&#39; =&amp;gt; &#39;password&#39;  //Default is &#39;password&#39; in the userModel
     ),
    ),
   ),
  ),
  &#39;DebugKit.Toolbar&#39;
 );
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8220412186604019273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8220412186604019273'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2017/04/cakephp2-using-acl-behaviar-with.html' title='[CakePHP2] Using ACL Behaviar with cakedc/users'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-6693018869314185275</id><published>2015-07-10T01:16:00.001+09:00</published><updated>2015-07-10T21:14:19.206+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><title type='text'>[CakePHP2]使用を避けるべきModel の名前、それは Folder</title><content type='html'>あまりにも長い間いろいろ試して判明したのがこれ。&lt;br /&gt;
&lt;br /&gt;
タイトルで終了しますが、CakePHP の bake でコード生成をする際避けるべきデータベーステーブルの名前は、 &lt;b&gt;folders&lt;/b&gt; です。&lt;br /&gt;
&lt;br /&gt;
理由はUtility::Folderと名前空間がかぶるから。自動生成つかってなくても、普通にぶつかって一見原因不明のエラーが出ます。 &lt;br /&gt;
&lt;br /&gt;
ほかにもモジュール名でかぶりそうなものもありそうですが、ひとまず。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6693018869314185275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6693018869314185275'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/07/cakephp2model-folder.html' title='[CakePHP2]使用を避けるべきModel の名前、それは Folder'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-5653367280566875883</id><published>2015-04-16T17:56:00.001+09:00</published><updated>2015-07-10T21:31:30.422+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><title type='text'>[CakePHP2]モデル内で別のモデルを参照する(追記あり)</title><content type='html'>別のファイルを参照するのは3通りあるそうです。

&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
参照元:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/980556/can-i-use-one-model-inside-of-a-different-model-in-cakephp&quot;&gt;http://stackoverflow.com/questions/980556/can-i-use-one-model-inside-of-a-different-model-in-cakephp&lt;/a&gt;&lt;/blockquote&gt;
から説明を抜粋。
&lt;br /&gt;
&lt;blockquote&gt;
App::import() ファイルを見つけてインポートします(それだけしかしません)。クラスを使用するにはインスタンスを作製する必要があります。

ClassRegistry::init() ファイルをロードして、インスタンスを作製します。何かをロードするにはimportよりもベターです。なぜならCakePHPが通常呼び出しの際に内部で行う手続きも実行されるからです。またクラスネームにエイリアスをつけることができます。便利です。

Controller::loadModel() 前述の ClassRegistry::init() を使用してモデルをロードします。$persistModel を使用したキャッシングにも対応します(する予定です？)。コントローラ内部でのみ動作します。&lt;/blockquote&gt;
&lt;strike&gt;と上記では書いてありますが、Model内でも Controller::loadModelは作動する模様。
&lt;br /&gt;
&lt;/strike&gt;&lt;br /&gt;
&lt;pre&gt;&lt;strike&gt;Controller::loadModel(&#39;AnotherModel&#39;);
$data = $this-&amp;gt;AnotherModel-&amp;gt;read(null, $id);
&lt;/strike&gt;&lt;/pre&gt;
(追記7/7)やっぱりだめっぽい。以下のやりかたが良いようです。
&lt;br /&gt;
&lt;pre&gt;$anotherModel = ClassRegistry::init(&#39;AnotherModel&#39;);
data = $anotherModel-&amp;gt;read(null, $id);
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5653367280566875883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5653367280566875883'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/04/cakephp2.html' title='[CakePHP2]モデル内で別のモデルを参照する(追記あり)'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-5672879551525442779</id><published>2015-03-06T18:48:00.002+09:00</published><updated>2015-03-06T18:48:32.546+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Haskell"/><title type='text'>[Haskell] CSV Library cassava</title><content type='html'>確定申告の時期、銀行やらカードやらの明細を自分のソフトで読み込めるように変換してますが、Haskellでやるにはどうしたものかと思いいろいろ検索。&lt;br /&gt;&lt;br /&gt;Cassavaというライブラリがあるようです。&lt;br /&gt;
&lt;br /&gt;
&lt;p class=&quot;title entry-title&quot; itemprop=&quot;name&quot;&gt;
&lt;a href=&quot;http://blog.johantibell.com/2012/08/a-new-fast-and-easy-to-use-csv-library.html&quot; itemprop=&quot;url&quot; rel=&quot;bookmark&quot;&gt;A new fast and easy to use CSV library&lt;/a&gt;&lt;/p&gt;

Bitstringでなしに、各フィールドの型を決めて読みこめるみたいですが、ひとまず触ってみることにします。</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5672879551525442779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5672879551525442779'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/03/haskell-csv-library-cassava.html' title='[Haskell] CSV Library cassava'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-4376424680621913444</id><published>2015-02-14T00:32:00.001+09:00</published><updated>2015-02-14T00:32:09.254+09:00</updated><title type='text'>Buffalo無線ルータで 無線LANをブリッジ接続で中継する手順について</title><content type='html'>こんなことに半日費したので記録しておく。&lt;br /&gt;
中継機に使おうとしたのは Buffalo WHR-600Dでした&lt;br /&gt;
そもそもは元ルータのAterm WH862A から、DHCPの割り振りがチェックできないので、中継器にアクセスできないのがこんなに時間がかかった原因でした。マニュアルに書いてある 192.168.11.1 には、アクセスできないし…。
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
BUFFALOの無線LANルーター(WHR-G301N等）でブリッジ接続を設定するときの手順&lt;br /&gt;
&lt;a href=&quot;http://wp2.trojanbear.net/1286.html&quot;&gt;http://wp2.trojanbear.net/1286.html&lt;/a&gt;
&lt;br /&gt;
&quot;今回の設定で一番厄介なのは、BUFFALOの無線LANルーターのディップスイッチをOFFにすると(筆者註：ブリッジモードにする時も)問答無用で無線LANルーターのIPアドレスが192.168.11.100 になってしまう事です。&quot;
&lt;/blockquote&gt;
この記述が救いでした。

有線で中継器に192.168.11.100にアクセスして無事に設定ができました。&lt;br /&gt;
&lt;br /&gt;
めでたし。 </content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/4376424680621913444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/4376424680621913444'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/02/buffalo-lan.html' title='Buffalo無線ルータで 無線LANをブリッジ接続で中継する手順について'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-8918152440370869876</id><published>2015-02-10T03:46:00.000+09:00</published><updated>2015-02-10T03:46:00.601+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><title type='text'>[CakePHP2] date / datetime / year フィールドで和暦の年を併記する </title><content type='html'>CakePHPのフォーム自動生成、超便利です。&lt;br /&gt;
日付に和暦が表示されて欲しいとき、この自動生成の中で勝手に変換されたら、最高です。&lt;br /&gt;
要はこんな感じで。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhsV2n4Z0ueOvF8t3QfVHMmoQVkkdPmO8ALCwe7UqCUpyDAccls0emFac0VjlKVkaClIcDz4gb4MBHoBYfTWTCCbIVAmnMiFjZYdoV_A8RawihQh6cmBkEP6hAhjcDNfw8dbGzP-3I2gA/s1600/Screen+Shot+2015-02-10+at+3.29.49+AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhsV2n4Z0ueOvF8t3QfVHMmoQVkkdPmO8ALCwe7UqCUpyDAccls0emFac0VjlKVkaClIcDz4gb4MBHoBYfTWTCCbIVAmnMiFjZYdoV_A8RawihQh6cmBkEP6hAhjcDNfw8dbGzP-3I2gA/s1600/Screen+Shot+2015-02-10+at+3.29.49+AM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
相変わらずでっちあげですが、&lt;br /&gt;
/app/View/Helper フォルダにFormHelper.php をコピーします。&lt;br /&gt;
_generateOptions というのがオプションを生成してる箇所になるんで、&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;case &#39;year&#39;:
(中略)
    for ($i = $min; $i &amp;lt;= $max; $i++) {
        $data[$i] = $i;
    }
(中略)
    break;
&lt;/pre&gt;
の箇所を
&lt;br /&gt;
&lt;pre&gt;for ($i = $min; $i &amp;lt;= $max; $i++) {
    $wareki = 0;
    if ($i &amp;gt; 1988) {
        $wareki = $i - 1988;
        $data[$i] = &quot;${i}年(平成${wareki}年)&quot;;
    } elseif ($i &amp;gt; 1925) {
        $wareki = $i - 1925;
        $data[$i] = &quot;${i}年(昭和${wareki}年)&quot;;
    } elseif ($i &amp;gt; 1911) {
        $wareki = $i - 1911;
        $data[$i] = &quot;${i}年(大正${wareki}年)&quot;;
    } elseif ($i &amp;gt; 1867) {
        $wareki = $i - 1867;
        $data[$i] = &quot;${i}年(明治${wareki}年)&quot;;
    } else {
        $data[$i] = &quot;${i}年&quot;;
    }
}
&lt;/pre&gt;
に置き換えます。&lt;br /&gt;&lt;br /&gt;表示はお好みで。</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8918152440370869876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8918152440370869876'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/02/cakephp2-date-datetime-year.html' title='[CakePHP2] date / datetime / year フィールドで和暦の年を併記する '/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhsV2n4Z0ueOvF8t3QfVHMmoQVkkdPmO8ALCwe7UqCUpyDAccls0emFac0VjlKVkaClIcDz4gb4MBHoBYfTWTCCbIVAmnMiFjZYdoV_A8RawihQh6cmBkEP6hAhjcDNfw8dbGzP-3I2gA/s72-c/Screen+Shot+2015-02-10+at+3.29.49+AM.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-5613743412001405029</id><published>2015-01-03T14:30:00.001+09:00</published><updated>2015-01-03T14:31:05.836+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[CakePHP2] データベースにログをとる</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
Logging(CakePHP official)&lt;br /&gt;
&lt;a href=&quot;http://book.cakephp.org/2.0/en/core-libraries/logging.html&quot;&gt;http://book.cakephp.org/2.0/en/core-libraries/logging.html&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Database logging in CakePHP
&lt;a href=&quot;http://blog.jandorsman.com/blog/database-logging-in-cakephp&quot;&gt;&lt;br /&gt;http://blog.jandorsman.com/blog/database-logging-in-cakephp&lt;/a&gt;&lt;/blockquote&gt;
一つ目の記事に書いてあることはCake2.*でもそのままつかえます。ファイルの場所が &#39;app/libs/log/database_logger.php&#39;(for CakePHP 1.*) から &#39;app/Lib/Log/Engine/DatabaseLog.php&#39; (for CakePHP 2.*)になるぐらいです。素晴しい。&lt;br /&gt;
&lt;br /&gt;
たとえばログにセッション情報(ユーザＩＤとかね)を記録したい、みたいな事になったら、ユーザがログインしてるのか確かめないと、ログインしてない時に上手くログに入りません。例えばログイン失敗しました、みたいなログがきちんと取られないことになります。
&lt;br /&gt;
&lt;pre&gt;public function write($type, $message) {
 $log[&#39;type&#39;] = ucfirst($type);
 $log[&#39;created&#39;] = date(&#39;Y-m-d H:i:s&#39;);
 $log[&#39;content&#39;] = $message;
 if ($login = CakeSession::read(&#39;Auth.User&#39;)) {
  $log[&#39;user_id&#39;] = $login[&#39;id&#39;];
 }


 return $this-&amp;gt;Log-&amp;gt;save($log);
}
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5613743412001405029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5613743412001405029'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/01/cakephp2.html' title='[CakePHP2] データベースにログをとる'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-1778310745934924563</id><published>2015-01-03T14:25:00.001+09:00</published><updated>2015-01-03T14:32:25.216+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[CakePHP2]Database logging (with some Cakesession Object)</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
Logging(CakePHP official)&lt;br /&gt;
&lt;a href=&quot;http://book.cakephp.org/2.0/en/core-libraries/logging.html&quot;&gt;http://book.cakephp.org/2.0/en/core-libraries/logging.html&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Database logging in CakePHP
&lt;a href=&quot;http://blog.jandorsman.com/blog/database-logging-in-cakephp&quot;&gt;&lt;br /&gt;http://blog.jandorsman.com/blog/database-logging-in-cakephp&lt;/a&gt;&lt;/blockquote&gt;
Well, Jan&#39;s article is totally usable even in CakePHP 2.4 except one location &#39;app/libs/log/database_logger.php&#39;(for CakePHP 1.*) to &#39;app/Lib/Log/Engine/DatabaseLog.php&#39; (for CakePHP 2.*).
&lt;br /&gt;
&lt;br /&gt;
When you want log some information via Cakesession Object (i.e. user ID), you should check the object first in case the user not logging in.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;public function write($type, $message) {
 $log[&#39;type&#39;] = ucfirst($type);
 $log[&#39;created&#39;] = date(&#39;Y-m-d H:i:s&#39;);
 $log[&#39;content&#39;] = $message;
 if ($login = CakeSession::read(&#39;Auth.User&#39;)) {
  $log[&#39;user_id&#39;] = $login[&#39;id&#39;];
 }


 return $this-&amp;gt;Log-&amp;gt;save($log);
}
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/1778310745934924563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/1778310745934924563'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2015/01/cakephp2database-logging-with-some.html' title='[CakePHP2]Database logging (with some Cakesession Object)'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-9182700013348363922</id><published>2014-11-19T09:02:00.000+09:00</published><updated>2014-11-19T09:02:14.406+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[PHP]時間を15分刻みに変換する</title><content type='html'>覚え書きの殴り書き。
時間を15分刻みに変換する。切り上げ、切り捨てありです。
&lt;br /&gt;
&lt;pre&gt;/*
 * dateBy15Minutes
 * @assert (&quot;2001-03-10 17:16:18&quot;) == &quot;2001-03-10 17:15:00&quot;
 * @assert (&quot;2001-03-10 17:00:00&quot;) == &quot;2001-03-10 17:00:00&quot;
 * @assert (&quot;2001-03-10 17:59:59&quot;) == &quot;2001-03-10 17:45:00&quot;
 * @assert (&quot;2001-03-10 17:40:18&quot;) == &quot;2001-03-10 17:30:00&quot;
 */

 protected function _dateBy15Minutes($mode = &#39;ceil&#39;,$time = NULL) {
  if (\is_null($time)) {
   $time = time();
  } else {
   $time = \strtotime($time);
  }
  if ($mode == &#39;ceil&#39;) {
   $minute = \sprintf(&quot;%02s&quot;, \ceil(\date(&#39;i&#39;) / 15) * 15);
  } else {
   $minute = \sprintf(&quot;%02s&quot;, \floor(\date(&#39;i&#39;) / 15) * 15);
  }
  $time_string = \date(&quot;Y-m-d H:i:s&quot;, \mktime(\date(&#39;H&#39;), $minute));
  return $time_string;
 }
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/9182700013348363922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/9182700013348363922'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/11/php15.html' title='[PHP]時間を15分刻みに変換する'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-5705593998330545342</id><published>2014-11-12T13:53:00.002+09:00</published><updated>2015-06-19T04:29:04.856+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><category scheme="http://www.blogger.com/atom/ns#" term="Composer"/><title type='text'>[CakePHP2][Composer] プラグインもComposer経由でインストールするときにapp/Plugin フォルダに入れたい。</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
参考資料&lt;br /&gt;
&lt;a href=&quot;https://github.com/composer/installers&quot;&gt;https://github.com/composer/installers&lt;/a&gt;&lt;/blockquote&gt;
増減するプラグインのために一個一個設置場所を書いていたのですが、うまいことでっちあげたんで、ログとして。
&lt;br /&gt;
&lt;i&gt;composer.json:
&lt;/i&gt;&lt;br /&gt;
&lt;pre&gt;{
    &quot;name&quot;: &quot;app&quot;,
    &quot;config&quot;: {
        &quot;vendor-dir&quot;: &quot;Vendor/&quot;
    },
    &quot;extra&quot;: {
        &quot;installer-paths&quot;: {
            &quot;app/Plugin/{$name}/&quot;: [&quot;type:cakephp-plugin&quot;]
        }
    },
    &quot;require&quot;: {
        &quot;php&quot;: &quot;&gt;=5.3&quot;,
        &quot;cakephp/cakephp&quot;: &quot;~2&quot;,
        &quot;composer/installers&quot;: &quot;~1&quot;,
        &quot;cakephp/debug_kit&quot;: &quot;~2&quot;,
        &quot;cakephp/localized&quot;: &quot;~2&quot;
   }
}
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5705593998330545342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/5705593998330545342'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/11/cakephp2composer-composerappplugin.html' title='[CakePHP2][Composer] プラグインもComposer経由でインストールするときにapp/Plugin フォルダに入れたい。'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-3785277184825318049</id><published>2014-10-03T15:18:00.001+09:00</published><updated>2014-10-03T18:23:01.225+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Skype"/><title type='text'>[Skype] オフラインにしてもオンラインのまま</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;a href=&quot;http://community.skype.com/t5/%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A9%E3%83%A0/%E3%82%AA%E3%83%95%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%AB%E3%81%97%E3%81%A6%E3%82%82%E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%AE%E3%81%BE%E3%81%BE/td-p/3028154&quot; target=&quot;_blank&quot;&gt;オフラインにしてもオンラインのまま&lt;/a&gt;&lt;/blockquote&gt;
&lt;br&gt;
(2014/10/03 時点)&lt;br&gt;結果からいくと、複数でログインしている場合、その全てで、上記にある「ステータスを [ログイン状態を隠す]か[オフライン] に変更」すれば、オフラインとして表示されます。(自分の場合はpc二つと、iPhoneのもの)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3785277184825318049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3785277184825318049'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/10/skype.html' title='[Skype] オフラインにしてもオンラインのまま'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-3588023273849302339</id><published>2014-07-08T19:20:00.000+09:00</published><updated>2015-06-19T04:08:20.244+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CakePHP2"/><category scheme="http://www.blogger.com/atom/ns#" term="MAMP"/><title type='text'>[CakePHP2]サブディレクトリにCakePHPを配置</title><content type='html'>CakePHPをサブディレクトリで動かすのは、一工夫いるみたいですが、&lt;br /&gt;
&lt;a href=&quot;http://www.webengineeer.com/cakephp%E3%81%A7%E3%82%B5%E3%83%96%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%A7%E9%81%8B%E7%94%A8%E3%81%99%E3%82%8B%E8%A8%AD%E5%AE%9A/&quot; target=&quot;_blank&quot;&gt;cakePHPでサブディレクトリで運用する設定&lt;/a&gt;あたりを参考にして、.htacess ファイルに変更を加えてみましたがうまくいかず。Composerを使えて構築してるからなのかとも思ったのですが、、&lt;br /&gt;
&lt;br /&gt;
とりあえず&lt;a href=&quot;http://www.mamp.info/&quot; target=&quot;_blank&quot;&gt;MAMP&lt;/a&gt;での話。CakePHPのバージョンは2.5.2です。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://www.webengineeer.com/cakephp%E3%81%A7%E3%82%B5%E3%83%96%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%A7%E9%81%8B%E7%94%A8%E3%81%99%E3%82%8B%E8%A8%AD%E5%AE%9A/&quot; target=&quot;_blank&quot;&gt;cakePHPでサブディレクトリで運用する設定&lt;/a&gt;&lt;br /&gt;
http://localhost/test/&lt;br /&gt;
のようにtestディレクトリ下でcakeを展開したい場合&lt;br /&gt;
各フォルダの3つの.htacessに下記を追加&lt;br /&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;RewriteBase    /test
&lt;/pre&gt;
1./test/直下にある.htaccess&lt;br /&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
   RewriteBase /test
&amp;lt;/IfModule&amp;gt;
&lt;/pre&gt;
2.appディレクトリ直下の.htaccess&lt;br /&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
    RewriteBase /test/app
&amp;lt;/IfModule&amp;gt;
&lt;/pre&gt;
3.webrootディレクトリ直下の.htaccess&lt;br /&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
 RewriteBase /test/app/webroot
&amp;lt;/IfModule&amp;gt;
&lt;/pre&gt;
&lt;/blockquote&gt;
に加えて、&lt;br /&gt;
app/Config/route.phpに下の2文を加える。&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::connect(&#39;/test/:controller&#39;, array(&#39;action&#39; =&amp;gt; &#39;index&#39;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::connect(&#39;/test/:controller/:action/*&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Router::connect(&#39;/test/&#39;, array(&#39;controller&#39; =&amp;gt; &#39;pages&#39;, &#39;action&#39; =&amp;gt; &#39;display&#39;, &#39;home&#39;));</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3588023273849302339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3588023273849302339'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/07/cakephp.html' title='[CakePHP2]サブディレクトリにCakePHPを配置'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-3618254362336758012</id><published>2014-05-28T16:32:00.001+09:00</published><updated>2014-05-28T16:33:22.449+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="PHPUnit"/><title type='text'>[phpunit][NetBeans] Command &quot;Calculator&quot; is not defined.</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
NetBeansの設定を終えて、チュートリアルへ。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://netbeans.org/kb/docs/php/phpunit.html&quot; target=&quot;_blank&quot;&gt;https://netbeans.org/kb/docs/php/phpunit.html&lt;/a&gt;&lt;br /&gt;
テストを作成しようとすると、うまくいかない。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://netbeans.org/images_www/articles/72/php/phpunit/create-tests.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Context menu for Source Files node of PHP Project, showing Create PHPUnit Tests option&quot; border=&quot;0&quot; class=&quot;margin-around&quot; src=&quot;https://netbeans.org/images_www/articles/72/php/phpunit/create-tests.png&quot; title=&quot;&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
エラーメッセージが。
&lt;br /&gt;
&lt;pre&gt;&quot;/usr/bin/php&quot; &quot;/Users/xxxx/local/bin/phpunit-skelgen&quot; &quot;--test&quot; &quot;--&quot; &quot;Calculator&quot; &quot;/Users/xxxx/NetBeansProjects/Calculator-PHPUnit/src/Calculator.php&quot; &quot;CalculatorTest&quot; &quot;/Users/xxxx/NetBeansProjects/Calculator-PHPUnit/test/CalculatorTest.php&quot;
phpunit-skelgen 2.0.1 by Sebastian Bergmann.
          
  [InvalidArgumentException]            
  Command &quot;Calculator&quot; is not defined.  

Done.&lt;/pre&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKQEFg15BlS49MqiPOHvvT5pnclbkd_P-JYfIDnzgmWRknkIyZWSiQnyyMScnmsbv2V-fFhn-sAp-gKrpaALGJEDol24HRzIdu9cY0hRxJ7dEQiltVpmaCix8laNy5mnQQlaCDVRFfSA0/s1600/Screen+Shot+2014-05-28+at+4.31.12+PM.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKQEFg15BlS49MqiPOHvvT5pnclbkd_P-JYfIDnzgmWRknkIyZWSiQnyyMScnmsbv2V-fFhn-sAp-gKrpaALGJEDol24HRzIdu9cY0hRxJ7dEQiltVpmaCix8laNy5mnQQlaCDVRFfSA0/s1600/Screen+Shot+2014-05-28+at+4.31.12+PM.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
どうやらバージョンが変わってコマンド体系が変わっている模様。
しばらく手動で作成かな…
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3618254362336758012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/3618254362336758012'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/phpunitnetbeans-command-calculator-is.html' title='[phpunit][NetBeans] Command &quot;Calculator&quot; is not defined.'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKQEFg15BlS49MqiPOHvvT5pnclbkd_P-JYfIDnzgmWRknkIyZWSiQnyyMScnmsbv2V-fFhn-sAp-gKrpaALGJEDol24HRzIdu9cY0hRxJ7dEQiltVpmaCix8laNy5mnQQlaCDVRFfSA0/s72-c/Screen+Shot+2014-05-28+at+4.31.12+PM.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-1976062961497195403</id><published>2014-05-27T18:02:00.003+09:00</published><updated>2014-05-27T18:02:46.914+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><title type='text'>[NetBeans][CSS][PHP]NetBeans 設定録 2</title><content type='html'>環境設定のそれぞれの箇所に適切なソフトをあてはめていきます。&lt;br /&gt;
&lt;h2&gt;
PHP&lt;/h2&gt;
&lt;h3&gt;
PHPUnit&lt;/h3&gt;
&lt;h4&gt;
phpunit&lt;/h4&gt;
&lt;a href=&quot;http://phpunit.de/&quot; target=&quot;_blank&quot;&gt;http://phpunit.de/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
phpunit-skelgen&lt;/h4&gt;
&lt;pre&gt;curl -O https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
&lt;/pre&gt;
osxにはwgetがないので curl -O で代用&lt;br /&gt;
&lt;h3&gt;
&amp;nbsp;WordPress&lt;/h3&gt;
&lt;h4&gt;
wp-cli &lt;/h4&gt;
&lt;a href=&quot;http://wp-cli.org/&quot; rel=&quot;nofollow&quot;&gt;http://wp-cli.org/&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;
Code Analysis&lt;/h3&gt;
&lt;h4&gt;
PHP_CodeSniffer &lt;/h4&gt;
&lt;pre&gt;pear install PHP_CodeSniffer&lt;/pre&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div class=&quot;post-title&quot;&gt;
&lt;a href=&quot;http://mawatari.jp/archives/introduction-of-cakephp-codesniffer&quot; title=&quot;CodeSnifferを導入しCakePHPコーディング規約をチェックする&quot;&gt;CodeSnifferを導入しCakePHPコーディング規約をチェックする&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href=&quot;http://mawatari.jp/archives/introduction-of-cakephp-codesniffer&quot;&gt;http://mawatari.jp/archives/introduction-of-cakephp-codesniffer&lt;/a&gt;&lt;/blockquote&gt;
を参考にCakePHPコーディング規約をインストール &lt;br /&gt;
&lt;h4&gt;
Pear &lt;/h4&gt;
pear が 入ってなかったのでこれもインストールした。
&lt;br /&gt;
&lt;pre&gt;$ curl -O http://pear.php.net/go-pear.phar
$ php -d detect_unicode=0 go-pear.phar&lt;/pre&gt;
&lt;h4&gt;
Mess Detector&amp;nbsp;&lt;/h4&gt;
&lt;a href=&quot;http://phpmd.org/&quot; target=&quot;_blank&quot;&gt;http://phpmd.org/&lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/1976062961497195403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/1976062961497195403'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/netbeanscssphpnetbeans-2.html' title='[NetBeans][CSS][PHP]NetBeans 設定録 2'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-8955978987022945295</id><published>2014-05-27T15:08:00.000+09:00</published><updated>2014-05-27T16:16:19.577+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><title type='text'>[Netbeans]設定録 1</title><content type='html'>CakePHPで、PHPUnitを使って、ユニットテストをしたい、というのがひとまずの最終目標ですが、&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;キーバインドはviで&lt;/li&gt;
&lt;li&gt;Composerを使用して構成&lt;/li&gt;
&lt;li&gt;Gitレポジトリで管理&lt;/li&gt;
&lt;li&gt;PHPUnitでユニットテスト&lt;/li&gt;
&lt;/ul&gt;
あたりを実現すべく、作業していきます。&lt;br /&gt;
(現時点でのNetBeansIDEのバージョンは8.0)&lt;br /&gt;
&lt;br /&gt;
NetBeansIDE Download&lt;br /&gt;
&lt;a href=&quot;https://netbeans.org/downloads/index.html&quot;&gt;https://netbeans.org/downloads/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;Introduction&quot;&gt;
jVi - vi editor clone&lt;br /&gt;
Tool &amp;gt; plugin からインストールできるのか。&lt;/div&gt;
&lt;div id=&quot;Introduction&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div class=&quot;entry-title&quot;&gt;
NetBeans に vi プラグインをインストール&lt;br /&gt;
&lt;a href=&quot;http://www.applelife100.com/2012/06/19/netbeans-vi-plugin-install/&quot;&gt;http://www.applelife100.com/2012/06/19/netbeans-vi-plugin-install/&lt;/a&gt;&lt;/div&gt;
&lt;/blockquote&gt;
以下のプラグインもインストール &lt;br /&gt;
&lt;div id=&quot;Introduction&quot;&gt;
&lt;br /&gt;
CakePHP, Wordpress, EditorWhitespace, gitignore.io, Git Toolbar, JS CSS Minify Compress&lt;/div&gt;
&lt;div id=&quot;Introduction&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;Introduction&quot;&gt;
&lt;br /&gt;
&lt;a href=&quot;http://docs.emmet.io/&quot; target=&quot;_blank&quot;&gt;Emmet&lt;/a&gt;に興味があるけど、端境どきなのか、プラグインセンターからインストールできないので、あとまわし。&lt;br /&gt;
&lt;br /&gt;
[追記]&lt;br /&gt;
とりあえずjViがうまく動いてないみたいなので、ひとまず7.4にして設定します。&lt;br /&gt;
&lt;br /&gt;
[追記2]&lt;br /&gt;Emmentもインストールできました。&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8955978987022945295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8955978987022945295'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/netbeans-1.html' title='[Netbeans]設定録 1'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-6798916618878073403</id><published>2014-05-21T14:53:00.002+09:00</published><updated>2014-05-21T16:17:45.851+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OpenDNS"/><title type='text'>[OpenDNS]設定おぼえがき</title><content type='html'>自宅のネット回線の契約を新しいものに変更したら、繋り具合が悪くなったり、facetimeがwi-fiごしにうまく繋らなくなったりしたので、ルータのDNSをOpenDNSのアドレスにしたら、不具合がなくなった。という覚え書き。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://www.opendns.com/&quot; target=&quot;_blank&quot;&gt;http://www.opendns.com/ &lt;/a&gt;&lt;/blockquote&gt;
細かい設定は抜きにして、DNSの参照だけに使うなら、&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;208.67.222.222&lt;/li&gt;
&lt;li&gt;208.67.220.220&lt;/li&gt;
&lt;/ul&gt;
に設定すると変更できます。&lt;br /&gt;
ルータの方で設定すれば細かいセッティングを機器ごとに行わなくて良くて幸せ。&lt;br /&gt;
[追記]&lt;br /&gt;
結構早くなるのかな？ &lt;br /&gt;
&lt;a href=&quot;http://sourceforge.jp/magazine/07/02/02/0130245/2&quot;&gt;http://sourceforge.jp/magazine/07/02/02/0130245/2&lt;/a&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6798916618878073403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6798916618878073403'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/opendns.html' title='[OpenDNS]設定おぼえがき'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-4350772049838954761</id><published>2014-05-15T16:49:00.001+09:00</published><updated>2014-05-15T16:50:45.227+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress"/><title type='text'>[Wordpress]現在のページURLを取得する</title><content type='html'>the_permalinkだけでは、indexページでうまくいきません。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
参考サイト：&lt;a href=&quot;http://wordpress.org/support/topic/get-the-current-url&quot; target=&quot;_blank&quot;&gt;http://wordpress.org/support/topic/get-the-current-url &lt;/a&gt;&lt;/blockquote&gt;
&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;a href=&quot;&amp;gt;&amp;lt;?php
if(is_home()){
    bloginfo(&#39;url&#39;);
} else {
    the_permalink();
}
?&amp;gt;&quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/4350772049838954761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/4350772049838954761'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/wordpressurl.html' title='[Wordpress]現在のページURLを取得する'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-6170757464925335075</id><published>2014-05-07T14:23:00.002+09:00</published><updated>2014-05-07T14:24:18.138+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FreeBSD"/><title type='text'>[FreeBSD] VM作成記 X - installed ports</title><content type='html'>随時変更、する予定です。&lt;br /&gt;
shells/zsh&lt;br /&gt;
editors/vim&lt;br /&gt;
x11/xorg&lt;br /&gt;
dev/llvm&lt;br /&gt;
lang/clang
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6170757464925335075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/6170757464925335075'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/freebsd-vm-x-installed-ports.html' title='[FreeBSD] VM作成記 X - installed ports'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-668953466794675113</id><published>2014-05-07T12:25:00.001+09:00</published><updated>2014-05-07T12:25:54.905+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FreeBSD"/><title type='text'>[FreeBSD] VM作成記 2 - pkg/port管理ソフト</title><content type='html'>&lt;h2&gt;pkg/port管理ソフト&lt;/h2&gt;
&lt;h3&gt;pkg&lt;/h3&gt;
最初の一回のみ
&lt;pre&gt;# pkg2ng
&lt;/pre&gt;
&lt;pre&gt;# pkg install editors/vim
&lt;/pre&gt;
&lt;h3&gt;
portmaster
&lt;/h3&gt;
&lt;pre&gt;# cd /usr/ports/ports-mgmt/portmaster
# make install clean
&lt;/pre&gt;
パッケージをアップグレード
&lt;br /&gt;
&lt;pre&gt;# portmaster -a
&lt;/pre&gt;
&lt;pre&gt;# portmaster shells/zsh
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/668953466794675113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/668953466794675113'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/freebsd-vm-2-pkgport.html' title='[FreeBSD] VM作成記 2 - pkg/port管理ソフト'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-2755637729189713964</id><published>2014-05-02T11:39:00.001+09:00</published><updated>2014-05-02T12:07:04.849+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FreeBSD"/><title type='text'>[FreeBSD] VM作成記 1 - インストール</title><content type='html'>自分用のメモとして、作業順にメモしていきます。&lt;br /&gt;
&lt;br /&gt;
isoファイルをダウンロード&lt;br /&gt;
&lt;a href=&quot;http://www.freebsd.org/where.html&quot;&gt;http://www.freebsd.org/where.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
インストール後に登録したユーザがsu が使えるようにしておく。(参考：&lt;a href=&quot;http://d.hatena.ne.jp/torazuka/20110505/wheel&quot; name=&quot;wheel&quot;&gt;メモ: FreeBSDでsuを使うにはユーザをwheelグループに所属させる&lt;/a&gt;)&lt;br /&gt;
&lt;pre&gt;vi /etc/group

（変更前）
wheel:*:0:root

（変更後）
wheel:*:0:root,hoge&lt;/pre&gt;
&lt;br /&gt;
Ports Collection を取得 (参考：&lt;a href=&quot;http://www.freebsd.org/doc/ja_JP.eucJP/books/handbook/ports-using.html&quot;&gt;http://www.freebsd.org/doc/ja_JP.eucJP/books/handbook/ports-using.html&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;# portsnap fetch extract&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/2755637729189713964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/2755637729189713964'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/freebsd-vm-1.html' title='[FreeBSD] VM作成記 1 - インストール'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-2906187707020035440</id><published>2014-05-01T03:57:00.004+09:00</published><updated>2014-05-02T12:07:42.612+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>[Shell] 複数ファイルの改行コードを変換したい。</title><content type='html'>一括で改行コードを変換しなくちゃならなかったので作業メモ&lt;br /&gt;
&lt;br /&gt;
参考にしたサイトは、 
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
改行コードの変換&lt;br /&gt;
&lt;a href=&quot;http://osksn2.hep.sci.osaka-u.ac.jp/~taku/osx/crlf.html&quot; target=&quot;_blank&quot;&gt;http://osksn2.hep.sci.osaka-u.ac.jp/~taku/osx/crlf.html&amp;nbsp;&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
find／xargsを使った検索に便利なコマンド一覧&lt;br /&gt;
&lt;a href=&quot;http://uguisu.skr.jp/Windows/find_xargs.html&quot; target=&quot;_blank&quot;&gt;http://uguisu.skr.jp/Windows/find_xargs.html&lt;/a&gt;&lt;/blockquote&gt;
oldMac, Windows -&amp;gt; Unix
     &lt;br /&gt;
&lt;pre class=&#39;brush: shell&#39;&gt;find . -type f -print0 | xargs -0 nkf -Lu --in-place&lt;/pre&gt;
&lt;br /&gt;
oldMac, Unix -&amp;gt; Windows
     &lt;br /&gt;
&lt;pre class=&#39;brush: shell&#39;&gt;find . -type f -print0 | xargs -0 nkf -Lw --in-place&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/2906187707020035440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/2906187707020035440'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/05/shell.html' title='[Shell] 複数ファイルの改行コードを変換したい。'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-7257973443592610394</id><published>2014-04-30T14:18:00.001+09:00</published><updated>2014-05-07T14:32:42.440+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache"/><category scheme="http://www.blogger.com/atom/ns#" term="Debian"/><title type='text'>[Apache][Debian] Debian マシンを MAMP みたいに使いたい</title><content type='html'>&lt;a href=&quot;https://www.mamp.info/&quot; target=&quot;_blank&quot;&gt;MAMP&lt;/a&gt;便利ですね。さくさく実行環境動かせるし。&lt;br /&gt;
Debianラップトップでも同じことができたらとってもうれしい。&lt;br /&gt;
&lt;br /&gt;
aptitudeなり、パッケージマネージャを使えば、MySQLもPerlもPHPもさくさくはいる。PHPMyAdminも楽々です。&lt;br /&gt;
&lt;br /&gt;
問題はApache。&lt;br /&gt;
&lt;br /&gt;
個人的には http://localhost/foo/ とかじゃなくて、 http://localhost/ が参照するところを自由に変えられたら嬉しいのです。&lt;br /&gt;
&lt;br /&gt;
以外に簡単なハックで実現しました。Apacheなんてこれまで使ってないよーって人限定ですが。&lt;br /&gt;
(参考：&lt;a href=&quot;http://www.linux.net-japan.info/install08.html&quot;&gt;http://www.linux.net-japan.info/install08.html&lt;/a&gt;)&lt;br /&gt;
1 /etc/apache2/site-available/default を コピー&lt;br /&gt;
&lt;pre&gt;sudo cp /etc/apache2/site-available/default /etc/apache2/site-available/foo&lt;/pre&gt;
2 コピーした設定ファイルを編集&lt;br /&gt;
/var/www にあたる部分を 任意の階層に指定します。/home/foo/sitedata とか。&lt;br /&gt;
3 コピーした設定ファイルを有効化&lt;br /&gt;
&lt;pre&gt;sudo a2ensite foo&lt;/pre&gt;
4 もともとの設定ファイルを無効化&lt;br /&gt;
&lt;pre&gt;sudo a2desite 00-default&lt;/pre&gt;
もともとのdefaultファイルは特例で一番最初に読み込まれるので、000なんちゃら、と名前を付けるか、無効化します。&lt;br /&gt;
だいたいこれで、http://localhost/ を呼べば、うまく応えてくれます。 &lt;br /&gt;
5 mod_rewrite が必要な場合、&lt;br /&gt;
&lt;pre&gt;sudo a2enmod rewrite&lt;/pre&gt;
を実行する。
&lt;br /&gt;
&lt;br /&gt;
apache2ctl status とかが正しい結果を返してくれなくなりますので、あくまで、ハックですが、お手軽にルートが切り替えられます。</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/7257973443592610394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/7257973443592610394'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/04/apachedebian-debian-mamp.html' title='[Apache][Debian] Debian マシンを MAMP みたいに使いたい'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7443135140656968821.post-8738329636678132659</id><published>2014-03-18T12:37:00.001+09:00</published><updated>2014-05-02T12:09:10.333+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>[SQL]30日間のキャンペーン期間が、当月内に存在するか。</title><content type='html'>人によって開始日の異なる、30日間のキャンペーン期間が、当月内に存在するか。&lt;br /&gt;
また当月内のキャンペーン期間の該当日数の合計を求めたい。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;おぼえがき&lt;br /&gt;
&lt;br /&gt;
CASE文で集約する
&lt;br /&gt;
&lt;pre class=&#39;brush: sql&#39;&gt;SELECT 
SUM(
CASE 
   WHEN LAST_DAY(CURDATE()) = LAST_DAY(start_date) THEN DATEDIFF(LAST_DAY(CURDATE()), start_date)
   WHEN DATE_FORMAT(LAST_DAY(CURDATE() - INTERVAL 1 MONTH),&quot;%Y%m&quot;) = DATE_FORMAT(start_date,&quot;%Y%m&quot;) THEN 30 - DATEDIFF(LAST_DAY(CURDATE() - INTERVAL 1 MONTH ), start_date)
   ELSE 0 END 
) as days
&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8738329636678132659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7443135140656968821/posts/default/8738329636678132659'/><link rel='alternate' type='text/html' href='http://yyamashita.blogspot.com/2014/03/sql30.html' title='[SQL]30日間のキャンペーン期間が、当月内に存在するか。'/><author><name>Yoshitaka Yamashita</name><uri>http://www.blogger.com/profile/04967949387161096643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>