YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal. In addition, the performance will decrease if you use vendor to manage the import? YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal.
In addition, the performance will decrease if you use vendor to manage the import?
Reply content:
YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal.
In addition, the performance will decrease if you use vendor to manage the import?
I don't know much about Yii/Yii2. Why should you use Composer? I think the following is a simple sentence:
For developers, it is great to use composer.
Composer is a dependency management tool for PHP Development (@ bigqiang Xie ). There are various packages at https://packagist.org/which can help you solve various dependencies. During development, the wheel of authority is always more time-and labor-saving than self-effort, and has withstood the tests of the masses. For example, Laravel uses many independent Symfony component libraries. With tools like Composer, you don't have to download a library, organize directories, maintain the version of the library, and consider how to integrate the library into your project.
The automatic loading mechanism of Composer does not reduce the performance (or, even if there is one, it will be minimal ). Because each package will define its own loading mechanism, such as classmap, psr-0, psr-4, Composer just performs automatic class loading based on this mechanism, rather than loading them all or part, or there is a lengthy loading list (but sometimes the array storing the loading list is not small, but this has little impact on performance ).
PS: if we work in a version control tool, we usually exclude/vendor. The benefit of doing so is that only your own code is included in the project file, it won't be much bigger (I wrote something a while ago, but it only brought the library introduced by composer to 100 MB + ). Then, we only need to composer install in another environment to get the specified, updated, and more stable dependent libraries.
Yes.
Good habits. I think Yii2.0 is good.
I also have a deep feeling that yii2 gives me the feeling that we are using a very backward method for a thorough refactoring.
For example, why does bootstrap need to be performed in the template first?$this->registerCssFile() $this->registerJsFile()But the problem is that my bootstrap template is like this.
html
How does he$this->registerJsFile()In?
Another method is used to reconstruct a sound function and powerful program. Without innovation, it takes a lot of energy and effort to develop such a framework. It is incredible that one person has done it.
Supplement:
Comparing ci, thinkphp, and yii2, I think yii2 is still very good. xueqiang is developing such a framework by itself, and it is far-fetched to move the java model hard, it will make PHP programmers feel awkward.