CakePHP 3.0 and beyond

Post on 28-Jul-2015

1.687 views 0 download

Transcript of CakePHP 3.0 and beyond

3.0.0 & Beyond

May 15, 2005

3.0.0March 22 2015

Some Things Could Have Been Better

3 Years is a Long Time

Lots of Breaking Changes

The most we’ve ever had.

Upgrading is Hard

Missing Datasource Examples

Some Things Went Really Well

Community Involvement

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

Documentation Complete on Day 0

80K Downloads in 2 Months

The new ORM is Awesome

We can thank Jose Lorenzo

So, Now What?

2.7.xJuly 2015

3.1.xJuly 2015

3.2.xJanuary 2016

MailersSimple conventions for emails.

Mailers

namespace App\Controller;

use Cake\Mailer\MailerAwareTrait;

class UsersController extends AppController { use MailerAwareTrait;

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

Console Improvements

More formatting options

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();

ORM ImprovementsMore ways to load relations

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']); });

ElasticSearchA fully featured ODM

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'] ] ]);

PSR-7Http Client and Middleware

Continuous Plugin Releases

Bake, DebugKit, Migrations, ElasticSearch

Backwards Compatible

All the way through 3.x

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.

Upcoming Releases

What about PHP5.5?Or 5.6?

4.0

CleanupRemove deprecated features.

PHP7Typehints, return values

You can Help

Thanks!