Interview with Makarov about Yii Framework 3

Hi folks, how are you? I hopefully well =D

I had a awesome chat with Alexander Makarok (aka samdark), the Yii Core Team Lead, in Yii Slack and he said many things about the Yii 3 version. And YES, he’s a incrible dude, solicitous and very humble. We’re practically partners hahahaha. (but I think he doesn’t know that)

Hi Five Yes GIF by Wilson Tennis

I just asked to him 5 or 10 main things about Yii 3:

…. and he was awesome in your reply. And in this post you’ll see all the talk more organized and structured.

PS: anyone who wants to chat live with the official Yii community, just enter in Yii Slack and enjoy! So, let’s go ahead to the interview with Makarov.

Interview

General

Firstly thanks for your time to this interview. Please Makarov, talk a fast resume about Yii 3

The idea of Yii 3 is a set of general purpose libraries + glue-package that could be considered a “framework” + application template + guide. It is created according to this guide. PHP 7.4 is a minimal required version. We’re using many of its features: return types, typed properties, modern crypto… all that.

Talking About Yii 2

In general, what comparison can you make between version 2 and 3?

Yii 2 was isolated from the rest of PHP community because of unique base: extensions, its own opinionated configuration, magic properties, behaviors. Yii 3 is different. It’s PHP without any “interesting” additions. So there’s no need for extensions layer for everything.

Expectative with Yii 3

What the expectation over the 3 version ?

When it will be released I hope that we’ll integrate way better into PHP community.

Highlights

Makarov, in your opinion, what the most highlights of the Yii 3? Those who will make a big difference to the community at large. The word is now yours!

PSR’s

The framework itself uses PSR standards so many parts are simply replace-able. If you don’t like cache or logger or anything you’re able to use different non-Yii ones.

PSR-7 request-response abstraction allowed us to work well with alternative runtime modes.

We’re using PSR-15 (Middleware) as well.

Configurations news

For configuration we’re using a special Composer plugin. It builds a config file on composer update or composer dump-autoload so we’re getting ready to use .php

That’s the only part that builds this way. Everything else works runtime. And works quite fast, I can say.

DI (Dependency Injection)

In order to use any third party code, we’ve created a good DI container that could be used to configure anything. For example: if you don’t like cache or logger or anything you’re able to use different non-Yii ones.

You’ll be able to intercept ANY call in ANY service registered in container w/o modifying the service itself.

Black magic involved.

shia labeouf magic GIF

Without Service Locators

For example, you can’t do Yii::$app anymore. No service locator is available at all. There are places such as controller actions, widgets or console commands where you type-hinting method signature and receiving services from container, No other way to access them. As a result, you have to write code that uses composition.

That is not easy after Yii 2. It results in way more test-able code and code that breaks way less.

There’re no Action Filters anymore

These are configured in the router. You can create a group, for example /api and then attach authentication middleware for it, that’s very flexible.

DB Layer

Framework isn’t tied to any. You can use Cycle (our default choice for now), Doctrine or even PDO.

We were going to drop AR and our own DB layer…

OH MY GOSH! I don’t believe, this is awesome! Are you serious?

…but Wilmer Arambula said NO WAY and ported it.


sad ben affleck GIF

hahahahaha. So now we have both ability to use Yii 2-style AR or anything else.

Router System

I personally don’t like the Yii 2 router system. Will there be any changes to this part of Yii 3?

Routing is different. It is an abstraction so any router could be used if implemented. Right now it’s fastroute and Works well.

About Release Marketing

About the marketing over the new release, how the team is preparing to it?

We suck at it very much. Going to fail it completely. hahahaha

Can I help in any way?

Sure. Whatever you come up with would be likely better than what I’ll do.

Yii 3 Release Forecast

I know it’s a hard question to answer, especially when it comes to free and open-source software. But could you provide a Yii 3 release forecast?

That is really something that is hard to answer. OpenSource is not the same as commercial development. Today people have time, tomorrow full time job takes all of it. Last year I gave an estimate “by the end of the year” but so it’s already 4 months off.

I’m afraid if I’ll give another estimate it may be the same. I really hope that this year we’ll tag a release. At least with current pace of development it’s possible but, as I said, OpenSource is very shaky about the time we can invest into. You can help us with it though. In many ways: development, testing, spreading the word (btw., thanks for doing it), sponsoring the foundation that we use to ensure more development time will be spent on Yii.

Final words

Thanks for all words. It will be enough to create a awesome post talking about Yii 3 and it be awesome for whole community. Thanks dude!

You’re welcome. Feel free to ask questions btw. So it will be an interview and if you like, we can record it, I’ve got a new microphone

star singing GIF by Radio Berg

Donate !!!

If you want to contribute financially to the project, just enter the Yii Soft Open Collective and submit your donation. I already did my donate in last year (I guess).

This order is regardless of whether or not you use the Yii Framework. Donating to open-source project, whatever it may be, will always be a good deed that will help several people.

Links

The Definitive Guide to Yii 3.0

Yii goal and values

That’s all! Put your comment below about this interview with the Alexander Makarov.

See ya.