CakePHP 3.0 and beyond

36
3.0.0 & Beyond

Transcript of CakePHP 3.0 and beyond

Page 1: CakePHP 3.0 and beyond

3.0.0 & Beyond

Page 2: CakePHP 3.0 and beyond

May 15, 2005

Page 3: CakePHP 3.0 and beyond

3.0.0March 22 2015

Page 4: CakePHP 3.0 and beyond

Some Things Could Have Been Better

Page 5: CakePHP 3.0 and beyond

3 Years is a Long Time

Page 6: CakePHP 3.0 and beyond

Lots of Breaking Changes

The most we’ve ever had.

Page 7: CakePHP 3.0 and beyond

Upgrading is Hard

Page 8: CakePHP 3.0 and beyond

Missing Datasource Examples

Page 9: CakePHP 3.0 and beyond

Some Things Went Really Well

Page 10: CakePHP 3.0 and beyond

Community Involvement

From the very first dev release, the community was helping.

Page 11: CakePHP 3.0 and beyond

Documentation Complete on Day 0

Page 12: CakePHP 3.0 and beyond

80K Downloads in 2 Months

Page 13: CakePHP 3.0 and beyond

The new ORM is Awesome

We can thank Jose Lorenzo

Page 14: CakePHP 3.0 and beyond

So, Now What?

Page 15: CakePHP 3.0 and beyond

2.7.xJuly 2015

Page 16: CakePHP 3.0 and beyond

3.1.xJuly 2015

Page 17: CakePHP 3.0 and beyond

3.2.xJanuary 2016

Page 18: CakePHP 3.0 and beyond

MailersSimple conventions for emails.

Page 19: CakePHP 3.0 and beyond

Mailers

namespace App\Controller;

use Cake\Mailer\MailerAwareTrait;

class UsersController extends AppController { use MailerAwareTrait;

public function register() { ... $this->getMailer('User')->send('welcome', [$user]); } }

Page 20: CakePHP 3.0 and beyond

Console Improvements

More formatting options

Page 21: CakePHP 3.0 and beyond

Shell Helpers

$func = function ($progress) { // Do work $progress->increment(); }; $this->helper(‘progress’)->output($func);

$progress = $this->helper('progress'); // Progress through 300 things $progress->init(['total' => 300]); $progress->increment($i); $progress->draw();

Page 22: CakePHP 3.0 and beyond

ORM ImprovementsMore ways to load relations

Page 23: CakePHP 3.0 and beyond

ORM Improvements// Lazy eager loading $articles = $this->Articles->find()->all(); $enrichedArticles = $this->Articles->eagerLoad( $articles, ['Users', 'Tags'] );

// Not matching - find bookmarks not tagged with X $query = $this->Bookmarks->find() ->notMatching('Tags', function ($q) { return $q->where(['Tags.name' => 'Awesome']); });

Page 24: CakePHP 3.0 and beyond

ElasticSearchA fully featured ODM

Page 25: CakePHP 3.0 and beyond

ElasticSearch

use Cake\ElasticSearch\Type;

$invoices = new Type('invoices'); $query = $invoices->find() ->where([ 'name.first' => 'jose', 'age >' => 29, 'or' => [ 'tags in' => ['cake', 'php'], 'interests not in' => ['c#', 'java'] ] ]);

Page 26: CakePHP 3.0 and beyond

PSR-7Http Client and Middleware

Page 27: CakePHP 3.0 and beyond

Continuous Plugin Releases

Bake, DebugKit, Migrations, ElasticSearch

Page 28: CakePHP 3.0 and beyond

Backwards Compatible

All the way through 3.x

Page 29: CakePHP 3.0 and beyond

Backwards Compatible

• Public methods won’t change their signatures.

• Public properties will continue to be available.

• Protected methods may change signatures.

• Protected properties may change.

Page 30: CakePHP 3.0 and beyond

Upcoming Releases

Page 31: CakePHP 3.0 and beyond

What about PHP5.5?Or 5.6?

Page 32: CakePHP 3.0 and beyond

4.0

Page 33: CakePHP 3.0 and beyond

CleanupRemove deprecated features.

Page 34: CakePHP 3.0 and beyond

PHP7Typehints, return values

Page 35: CakePHP 3.0 and beyond

You can Help

Page 36: CakePHP 3.0 and beyond

Thanks!