Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CakePHP2と3の違い
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
sakuragawa
April 20, 2016
Programming
4.9k
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CakePHP2と3の違い
CakePHP2と3の違い
sakuragawa
April 20, 2016
More Decks by sakuragawa
See All by sakuragawa
CircleCI APIでプチ効率化
sakuragawa
1
600
PHP + GitHub + Azure Functions = ?
sakuragawa
0
270
今こそCakePHP3に乗り換えよう!/php_conference_fukuoka_2016
sakuragawa
0
1.2k
Other Decks in Programming
See All in Programming
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
120
Heart of Swift Concurrency
koher
0
1.2k
Are APIs Still Relevant in the AI Era?
soyuka
0
430
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
320
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
560
パーソナライズPodcastを作った話
repunit11
0
130
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2k
SREの越境 / SRE Collaboration
y0hgi
2
300
Agents on Rails - Rails at Scale 2026
irinanazarova
0
350
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
320
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
180
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
The Language of Interfaces
destraynor
162
27k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
690
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
The Curious Case for Waylosing
cassininazir
1
560
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
730
How GitHub (no longer) Works
holman
316
150k
Transcript
CakePHP2と3の違い 2016/4/13
自己紹介 株式会社Fusic 技術開発部 マネージャー 櫻川 幸三 https://github.com/kozo https://github.com/fusic http://qiita.com/kozo http://qiita.com/organizations/fusic
CakePHP利用歴:8年程度(CakePHP1.1から) Cake3用のプラグイン初リリース 2014/11/13(Cake3のリリースは2015/3) 2
3 使ってますか?
CakePHP3メリット PHP自体のバージョン 速度、使える機能が多い。 composer Cake自体、ライブラリのバージョン管理が容易 autoload namespace PSR-2 trait Cake自体を含めた可読性が上がった
デザインが少しかっこよくなった CakePHP2よりはましになった モデル周りが一新 出来ることが増えた!拡張性が大幅に向上! 4
5 新しい方が楽しい! モダンな書き方をしたい!
PHP等のバージョン変更 CakePHP2 CakePHP3 PHP 5.3以上 5.5.9以上 Extension mcrypt intl mbstring
openssl(オプション) PostgreSQL 7以上 ??? MySQL 4 & 5 5.1.10以上 SQL Server 2005以上 2008以上 SQLite ??? 3 6 • PHP5.4 • trait • short array syntax([]) • short open tag(<?=) • PHP5.5 • yield • password_hash • finally
composer経由でインストールが楽 composerが標準で対応 CakePHP自体 様々なライブラリ autoload(PSR-4)に対応 ファイル名 ディレクトリ構造 namespace PSR-2準拠 7
composer create-project --prefer-dist cakephp/app [アプリ名]
デザインがおしゃれに 8
モデル周りが大幅リニューアル! QueryBuilder Table Entity 9
QueryBuilder CakePHP2 10 $query = [ ‘conditions’ => [ ‘条件A’,
‘条件B’ ], ‘order’ => [ ‘ソート条件A’, ‘ソート条件B’ ], ‘fields’ => [‘取得フィールド’] ] $this->User->find(‘all’, $query); $this->Users->find() ->where(条件A) ->where(条件B) ->order(ソート条件A) ->order(ソート条件B) ->select(取得フィールド) ->all() • CakePHP3 配列地獄からは解消される!
Table、Entity Table DBのテーブルへアクセスする CakePHP2のModelクラスに近い動きをする 11 • Entity • DBのテーブル1レコードを表す •
カラムのデータ自体の加工等を担当する • CakePHP2までのModelクラスが、 TableとEntityの2つに分離された Tableクラス Entityクラス
デメリット 学習コスト namespace QueryBuilder プラグイン周り プラグイン周りは全滅 Controller、View周りは大きくは変更されてない Model関係は0から作りなおす必要がある PHP自体のバージョンが高い 5.5.9以上
12
まとめ 学習コストはあるが、 覚えてしまえば拡張性が非常に高く使いやすい! やっとモダンなフレームワークの仲間入り! 新しいものは楽しい! 13
ご清聴ありがとうございました Fusicはテクノロジーが 好きなエンジニアを募集しています https://fusic.github.io 14