简体   繁体   English

Laravel 3捆绑包在Laravel 4

[英]Laravel 3 bundles in Laravel 4

In L3 there was great thing - packages. 在L3中,有一件很棒的事情-包裹。 They could have own routes and worked as plugins and made software more modular. 他们可以拥有自己的路线,可以作为插件使用,并使软件更加模块化。 How to achieve this in L4? 在L4中如何实现? I see packages little different from bundles. 我看到软件包与捆绑软件几乎没有什么不同。

Thank You! 谢谢!

Bundle is a specific packaging for Laravel 3, great to add easily a package but not a standard. Bundle是Laravel 3的特定包装,很容易添加包装,但不是标准包装。

Laravel 4 is more modular because it accepts packages form all the php community. Laravel 4更具模块化,因为它接受来自所有php社区的软件包。 It uses a standard as package manager, Composer , and Laravel 4 is managed itself as a package. 它使用标准的软件包管理器Composer ,并且Laravel 4本身作为软件包进行管理。

You just have to create a composer.json file like this one : 您只需要创建一个像这样的composer.json文件:

{
    "require": {
        "laravel/framework": "4.0.*"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*",
        "mockery/mockery": "dev-master@dev",
        "sebastian/phpcpd": "1.4.*"
    }
}

And execute composer update . 并执行composer update All the dependencies of your project will be installed in accordance with the versions you specify in this file. 项目的所有依赖项将根据您在此文件中指定的版本进行安装。 It's really the best pattern to manage a lot of libraries for a team. 这实际上是为团队管理大量库的最佳模式。

Bundles and packages are really similar, the gift wrap and the shipping way change but that's all. 捆绑包和包裹真的很相似,礼品包装和运输方式有所变化,仅此而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM