http://bakery.cakephp.org/articles/markstory/2014/07/21/cakephp_2_5_3_and_1_3_20_released 7/21に久々に1.3系を含むCakeのアップデートがリリースされました。 1.3系も更新されるやつは大体やばいやつ、ということで今回も何やらやばそうな事が書いてあります。 The 1.3.20 release contains an important fix to address a potential race condition in Model::save() that can cause data loss when records are deleted during concurrent updates. data lossとはどういうことか、実際に試して確認してみました。 結論 save(upd
In this post I will describe how to upload and store a file in the database. Yes, you read correct, I will describe how to store a file in the database. I know, a lot of people do not recommend storing files in a database due to performance reasons. Of course, this is an important point you have to consider when you design your application. The reasons why I store files often in the database are:
2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。本件に関する詳細は、プレスリリースをご確認ください。 2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。 本件に関する詳細は、プレスリリースをご確認ください。
CakePHP2系の最新版を利用しながら、3系への以降を少しでもスムーズにさせるためのメモです。 実際には非常に多くの作業を伴うことが予想されますが、可能な部分だけでも対応しておきたいところです。 このエントリは随時更新中です。気づいた時&暇な時に追加・更新していきます。 PSR-4 に準拠した名前空間の導入 CakePHP3.0 から namespase が導入され、同時に PSR-4 準拠となります。それに関連してディレクトリ構造やクラス名、ファイル名が変更されます。 これに備えたアプリケーションコードの変更は2系では基本的に不可能と思われますが、準備のために整理しておきます。 APIの廃止、変更、代替案 クラス、メソッド、変数の廃止、メソッド引数の扱いの変更、推奨されている代替案などをまとめていきます。 中には 2.x のかなり初期の段階で移行を促しているものなど、あえて書くまでもな
こんにちは、株式会社CFlatです。 ※ CakePHPのコアライブラリを弄ります。CakePHPのアップデート時などには注意して下さい。また、修正は自己責任でお願いします。 PHP用のフレームワークは数多かれど、中でもそこそこ名前の挙がるCakePHP[1]。単純なWebアプリケーション(とも言えない程度のHP)を作るなら素早く実装できるのですが、ちょこっと真面目にSQLを弄り出すと、途端に不満が続出してきます[2]。 行ロックくらいは寄越せや、ってことで、微妙に古めですが手元のCakePHP2.3.1をいろいろ弄ってみることにしました[3]。DBにはMySQLを使います。 方針 ・$this->Model->find()の第二引数に 'lock' => ... という項目を追加すれば、ロックができるようにする ・'lock' => 'read' では、読み取ったデータの一貫性を保証する
グローバル定数およびグローバル関数¶ CakePHP を使った皆さんの日常のほとんどの業務ではコアクラスやメソッドを用いることになるでしょうが、 ちょっとした役に立つ便利なグローバル関数も CakePHP にはたくさんあります。この関数のほとんどは CakePHP のクラスと一緒に使うためのもの(モデルやコンポーネントクラスのローディングなど)ですが、 他の多くは、配列や文字列の扱いを少し楽にしてくれるものです。 また、CakePHP のアプリケーションで利用可能な定数も同時におさえておきましょう。 これらの定数を用いることはよりスムースなアップグレードの助けになるだけでなく、 CakePHP アプリケーション内の特定のファイルやディレクトリを指し示す便利なやり方でもあります。 グローバル関数¶ 以下、CakePHP の使用可能なグローバル関数です。その多くは、デバッグしたり内容を翻訳した
1. 実"戦" CakePHP Plugin Kenichirou Oyama (k1LoW) CakePHP勉強会#5@Tokyo 福岡サテライト 1 2. Agenda • About Me • 実"戦"で使うPlugin/Component • About 'futil' CakePHP勉強会#5@Tokyo 福岡サテライト 2 4. About Me • name: – Kenichirou Oyama (id:k1LoW) • from Fukuoka JAPAN • membership: – – 101000code/101000LAB – codecheck.in • “cake.el” maintener – CakePHP Emacs Minor Mode CakePHP勉強会#5@Tokyo 福岡サテライト 4
久しぶりにCakePHP本体のTipsなんかを。 現在ちょっとトリッキー(?)なバリデーションの利用を想定していまして、Model内の$validateプロパティでの指定以外で同機能が使えないものかと調べていました。 組み込みバリデーションは、全て「cake/libs/validation.php内にあるようで、こいつをインポートして直接メソッドを呼び出すだけで何処でも使えるようです。 App::import('Core', 'Validation'); class FooController extends AppController { var $name = 'Foo'; //省略 function hoge(){ //バリデーションの利用 if(Validation::alphaNumeric($check)){ echo "OK牧場"; } } なお、場所によってはimport(
こんにちは、管理課でありながらエンジニア(?)のtetsuです。 今回はBitbucketというサービスのAPIをCakePHPで利用する方法を紹介します。 Bitbucketとは? BitbucketとはAtlassianが提供する分散バージョン管理システムサービスです。 公式サイトでは以下のように説明されています。 Bitbucketは Mercurialという分散バージョン管理システム(DVCS)を使っているコードをホストするサイトです。Mercurialを使うことで、あなたのデータは分散されつつも、共有し、開発を継続できます。 https://bitbucket.org/ LIGでは様々なお客様のお仕事をさせていただいているので、案件毎に複数の開発者(プログラマーやデザイナー)が関わるため、このサービスを利用することで開発者同士の共有が容易になっています。 今回は、CakePHPで
2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。本件に関する詳細は、プレスリリースをご確認ください。 2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。 本件に関する詳細は、プレスリリースをご確認ください。
エラーとの戦いを何時間も続けているそこのあなた☆僕もその一人です。この木の下で一休みしてください。ふと見上げると解決策がみつかるかもです。PHP,Flex,MySQLなどのエラー回避を実らせていきます。 [cakephp]selectのoptgroupのlabel表示と同じoptionが出ない問題 Selectボックスのグループ分けを使うときに、labelにくる文字とoptionにくる文字が同じ時は、 デフォルトだと表示されない。 $optAry = array( 'やさい' => array( 1 => 'キャベツ', 2 => 'きゅうり' ), 'くだもの' => array( 3 => 'くだもの',//これが表示されない 4 => 'みかん', ), ); そんなときは、このようにしよう。 $this->Form->select('id',$optAry,null,array('
Home»CakePHP»CakePHPで使えるテンプレートエンジンまとめ (CakePHP Advent Calendar 2011 17日目) こんにちは、nojimageです。この記事は CakePHP Advent Calendar 2011 17日目の記事として書いています。前日は @BiMihoujyunさんの「BMB » CakePHP2から追加されたCakeEmailをおいしく頂く。」というエントリーでした。CakePHP2.0ではメール周りに関してかなり改善されていますので、ぜひ先の記事を参考にして試してみてください。 さて、今日はCakePHPで表示部分を作るテンプレートエンジンのお話をします。 CakePHPでは通常、生のPHPを用いて表示のためのテンプレートを記述します。 効率よくテンプレートを書くためのヘルパーやエレメントと呼ばれる機能があるため、定型の表示処理な
はじめまして、@mikedaと同じく4月からイタンジにジョインした横沢(@yoko_net)と申します。 個人的にもブログをやっているので、何を書くか悩んでいたのですがこちらには主に業務や会社についての話を書きたいと思います。 さて早速私の業務についてですが、私はあるプロダクトの完全リニューアルを行うプロジェクトを担当しております。イタンジでは既存プロダクトはすべてcakephpで作られているので、リニューアルプロダクトも当然のようにcakephpで開発を進めておりました。 開発を進めて三週間ほどでしょうか、全員の意見が一致した事によりcakephpの採用はやめて、今後はrailsを採用する事が決定しました。三週間書いてきたcakephpのソースはタイトル通り窓から投げ捨てました。最初の三週間はどちらかと言うと設計をメインで進めており、書いてる部分はそこまで大きく無かったのが唯一の救いです
データのバリデーション(Data Validation)¶ あらゆるアプリケーションにおいて、データのバリデーションは重要です。これは、モデルのデータがアプリケーションのビジネスルールに必ず従うようにすることに役立ちます。例えば、パスワードは8文字以上であるとか、ユーザ名は必ずユニークにするといったことが挙げられます。バリデーションを定義することは、フォームの取り扱いをとても簡単にします。 バリデーションの仕組みは多くの異なる場面で使います。 この章ではモデルでの利用、基本的には save() メソッドを呼び出した時の振る舞いについてを説明します。バリデーションエラーをどのように取り扱うかについての詳細な情報は、FormHelperについての項目を参照してください。 データのバリデーションを行うには、まずモデルにバリデーションのルールを作成します。これは、モデルの定義の中の Model::
New ORM Designer 3 called Skipper is available on our new site www.skipper18.com visual editor for ORM frameworks Create your visual model and let ORM Designer to export schema definition files for you. Save up to 75 % of your time thanks to automatic export, error elimination and other improvements.
遅くなりましたが、前回の続きです。 前回は投稿の一覧が表示できるようになったところまでをやりました。 投稿の詳細画面を作る 一覧のタイトルをクリックしたらその詳細が確認できるようにします。まずは一覧のタイトルにリンクをつけます。action は view とします。 タイトルを echo してた箇所を下記のように変更します。 - <td><?php echo $post->title; ?></td> + <td><?php echo $this->Html->link($post->title, array('controller' => 'posts', 'action' => 'view', $post->id)); ?></td> そして、詳細ページのビューを作ります。 <!-- App/Template/Posts/view.ctp --> <h1><?php echo h($p
色々と改善されていると噂の CakePHP 3 をもくもく勉強する会その2にお邪魔してきました。 CakePHP 3.0.0 もくもく会(勉強会) #2 - Co-Edo CakePHP | Doorkeeper そこでやったことをメモ。 今回の目標 環境構築を終わらせる ブログチュートリアルをやってみる という感じのながれになりました。 環境構築 Co-Edo の田中さんが Vagrantfile を用意してくれていました。(素敵!)ので、それを利用させていただくことに。 Vagrantfile の内容はこちら コマンドとしては下記のような感じで # まず VirtualBox の GuestTool を更新するプラグインをいれておく $ vagrant plugin install vagrant-vbguest # vagrant を実行する適当なフォルダを作る $ mkdir -p
プラグインにするメリット ・ライブラリの管理が楽 ・公開すれば、ツッコミが入るかも 話題に上がったプラグイン Debug Kit – CakePHPオフィシャルのデバッグツール TransitionComponent – ページ遷移を制御してくれるプラグイン UserVoice – Webページの横に「あなたのご意見をお聞かせください。」などのボックスを出せるプラグイン 安藤 祐介さん 「プラグイン作成の登竜門 CandyCane」 CandyCaneとはRubyで書かれているバグ管理システムRedmineをCakePHPで書きなおすプロジェクト。 導入の容易さはWordPressと同じくらいです。詳細はコチラ。 この中で使われているプラグインの紹介 プラグインをつくるのは簡単だ! という事でなんとプラグインをその場でライブコーディングして頂きました。 ネタはうるるの会社紹介の時に、石原さ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く