pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    • <bdo id='sX73i'></bdo><ul id='sX73i'></ul>

      <small id='sX73i'></small><noframes id='sX73i'>

      <i id='sX73i'><tr id='sX73i'><dt id='sX73i'><q id='sX73i'><span id='sX73i'><b id='sX73i'><form id='sX73i'><ins id='sX73i'></ins><ul id='sX73i'></ul><sub id='sX73i'></sub></form><legend id='sX73i'></legend><bdo id='sX73i'><pre id='sX73i'><center id='sX73i'></center></pre></bdo></b><th id='sX73i'></th></span></q></dt></tr></i><div class="ack0w0a" id='sX73i'><tfoot id='sX73i'></tfoot><dl id='sX73i'><fieldset id='sX73i'></fieldset></dl></div>

        <tfoot id='sX73i'></tfoot>
      1. <legend id='sX73i'><style id='sX73i'><dir id='sX73i'><q id='sX73i'></q></dir></style></legend>
      2. 使用 Composer 的開發/生產切換時如何正確部署?

        How to deploy correctly when using Composer#39;s develop / production switch?(使用 Composer 的開發/生產切換時如何正確部署?)
      3. <i id='7fxKn'><tr id='7fxKn'><dt id='7fxKn'><q id='7fxKn'><span id='7fxKn'><b id='7fxKn'><form id='7fxKn'><ins id='7fxKn'></ins><ul id='7fxKn'></ul><sub id='7fxKn'></sub></form><legend id='7fxKn'></legend><bdo id='7fxKn'><pre id='7fxKn'><center id='7fxKn'></center></pre></bdo></b><th id='7fxKn'></th></span></q></dt></tr></i><div class="ckkowcu" id='7fxKn'><tfoot id='7fxKn'></tfoot><dl id='7fxKn'><fieldset id='7fxKn'></fieldset></dl></div>

        1. <tfoot id='7fxKn'></tfoot>
              <tbody id='7fxKn'></tbody>
            <legend id='7fxKn'><style id='7fxKn'><dir id='7fxKn'><q id='7fxKn'></q></dir></style></legend>

              <small id='7fxKn'></small><noframes id='7fxKn'>

                • <bdo id='7fxKn'></bdo><ul id='7fxKn'></ul>
                  本文介紹了使用 Composer 的開發/生產切換時如何正確部署?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  Composer 可以選擇僅在開發過程中加載多個依賴項,因此這些工具不會安裝在生產中(在實時服務器上).這(理論上)對于僅在開發中有意義的腳本非常方便,例如測試、假數據工具、調試器等.

                  Composer has the option to load several dependencies only while being in development, so the tools will not be installed in production (on the live server). This is (in theory) very handy for scripts that only make sense in development, like tests, fake-data-tools, debugger, etc.

                  要走的路是添加一個額外的 require-dev 塊,其中包含您在 dev 中需要的工具:

                  The way to go is to add an additional require-dev block with the tools you need in dev:

                  "require-dev": {
                      "codeception/codeception": "1.6.0.3"
                  }
                  

                  然后(理論上)通過

                  composer install --dev
                  

                  問題&問題:

                  Composer 在 2013 年顯著改變了 installupdate 的行為,require-dev-dependencies 現在默認安裝(!), 隨意創建一個帶有 require-dev 塊的 composer.json 并執行 composer install 來重現.

                  Problem & Question:

                  Composer has changed the behaviour of install and update dramatically in 2013, require-dev-dependencies are now installed by default (!), feel free to create a composer.json with a require-dev block and perform an composer install to reproduce.

                  最普遍的部署方式是推送 composer.lock(保存您當前的 composer 設置),然后在生產服務器上執行 composer install,這也將安裝開發的東西.

                  As the most accepted way to deploy is to push the composer.lock (that holds your current composer setup) and then do an composer install on the production server, this will also install the development stuff.

                  安裝 -dev 依賴項的正確部署方法是什么?

                  What's the correct way to deploy this without installing the -dev dependencies ?

                  注意:我試圖在這里創建一個規范的問答來澄清奇怪的 Composer 部署.隨意編輯這個問題.

                  推薦答案

                  為什么

                  恕我直言,現在 Composer 將默認使用 --dev 標志(在安裝 更新時)是有充分理由的.Composer 主要在需要這種行為的場景中運行:

                  There is IMHO a good reason why Composer will use the --dev flag by default (on install and update) nowadays. Composer is mostly run in scenario's where this is desired behavior:

                  基本的 Composer 工作流程如下:

                  The basic Composer workflow is as follows:

                  • 啟動一個新項目:composer.phar install --dev,將json和lock文件提交給VCS.
                  • 其他開發人員開始參與該項目:簽出 VCS 和 composer.phar install --dev.
                  • 開發者添加依賴:composer.phar require ,如果你想要require-dev中的包,添加--dev代碼>部分(并提交).
                  • 其他人繼續:(結帳和)composer.phar install --dev.
                  • 開發人員想要更新版本的依賴項:composer.phar update --dev (并提交).
                  • 其他人繼續:(結帳和)composer.phar install --dev.
                  • 項目已部署:composer.phar install --no-dev
                  • A new project is started: composer.phar install --dev, json and lock files are commited to VCS.
                  • Other developers start working on the project: checkout of VCS and composer.phar install --dev.
                  • A developer adds dependancies: composer.phar require <package>, add --dev if you want the package in the require-dev section (and commit).
                  • Others go along: (checkout and) composer.phar install --dev.
                  • A developer wants newer versions of dependencies: composer.phar update --dev <package> (and commit).
                  • Others go along: (checkout and) composer.phar install --dev.
                  • Project is deployed: composer.phar install --no-dev

                  如您所見,--dev 標志的使用(遠)多于 --no-dev 標志,尤其是當開發人員的數量較多時項目成長.

                  As you can see the --dev flag is used (far) more than the --no-dev flag, especially when the number of developers working on the project grows.

                  生產部署

                  在不安裝dev"的情況下部署它的正確方法是什么?依賴?

                  What's the correct way to deploy this without installing the "dev" dependencies?

                  好吧,composer.jsoncomposer.lock 文件應該提交給 VCS.不要省略 composer.lock,因為它包含有關應該使用的包版本的重要信息.

                  Well, the composer.json and composer.lock file should be committed to VCS. Don't omit composer.lock because it contains important information on package-versions that should be used.

                  在執行生產部署時,您可以將 --no-dev 標志傳遞給 Composer:

                  When performing a production deploy, you can pass the --no-dev flag to Composer:

                  composer.phar install --no-dev
                  

                  composer.lock 文件可能包含有關開發包的信息.這沒關系.--no-dev 標志將確保未安裝這些開發包.

                  The composer.lock file might contain information about dev-packages. This doesn't matter. The --no-dev flag will make sure those dev-packages are not installed.

                  當我說生產部署"時,我指的是旨在用于生產的部署.我不是在爭論 composer.phar install 是否應該在生產服務器上完成,或者在可以審查事情的臨時服務器上完成.這不是這個答案的范圍.我只是指出如何在不安裝dev"的情況下composer.phar install依賴.

                  When I say "production deploy", I mean a deploy that's aimed at being used in production. I'm not arguing whether a composer.phar install should be done on a production server, or on a staging server where things can be reviewed. That is not the scope of this answer. I'm merely pointing out how to composer.phar install without installing "dev" dependencies.

                  離題

                  --optimize-autoloader 標志在生產環境中也可能是可取的(它會生成一個類映射來加速應用程序的自動加載):

                  The --optimize-autoloader flag might also be desirable on production (it generates a class-map which will speed up autoloading in your application):

                  composer.phar install --no-dev --optimize-autoloader
                  

                  或者在自動部署完成后:

                  Or when automated deployment is done:

                  composer.phar install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader
                  

                  如果您的代碼庫支持它,您可以將 --optimize-autoloader 換成 --classmap-authoritative.更多信息這里

                  If your codebase supports it, you could swap out --optimize-autoloader for --classmap-authoritative. More info here

                  這篇關于使用 Composer 的開發/生產切換時如何正確部署?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                        <bdo id='YM45h'></bdo><ul id='YM45h'></ul>

                        <small id='YM45h'></small><noframes id='YM45h'>

                          <tbody id='YM45h'></tbody>
                        <tfoot id='YM45h'></tfoot>
                      • <i id='YM45h'><tr id='YM45h'><dt id='YM45h'><q id='YM45h'><span id='YM45h'><b id='YM45h'><form id='YM45h'><ins id='YM45h'></ins><ul id='YM45h'></ul><sub id='YM45h'></sub></form><legend id='YM45h'></legend><bdo id='YM45h'><pre id='YM45h'><center id='YM45h'></center></pre></bdo></b><th id='YM45h'></th></span></q></dt></tr></i><div class="uiqksiy" id='YM45h'><tfoot id='YM45h'></tfoot><dl id='YM45h'><fieldset id='YM45h'></fieldset></dl></div>

                            <legend id='YM45h'><style id='YM45h'><dir id='YM45h'><q id='YM45h'></q></dir></style></legend>
                            主站蜘蛛池模板: 三板富 | 专注于新三板的第一垂直服务平台 | 刮板输送机,粉尘加湿搅拌机,螺旋输送机,布袋除尘器 | 山东活动策划|济南活动公司|济南公关活动策划-济南锐嘉广告有限公司 | 全自动五线打端沾锡机,全自动裁线剥皮双头沾锡机,全自动尼龙扎带机-东莞市海文能机械设备有限公司 | 番茄畅听邀请码怎么输入 - Dianw8.com | 压力喷雾干燥机,喷雾干燥设备,柱塞隔膜泵-无锡市闻华干燥设备有限公司 | 液氮罐_液氮容器_自增压液氮罐-北京君方科仪科技发展有限公司 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 | 危废处理系统,水泥厂DCS集散控制系统,石灰窑设备自动化控制系统-淄博正展工控设备 | 扒渣机厂家_扒渣机价格_矿用扒渣机_铣挖机_撬毛台车_襄阳永力通扒渣机公司 | CXB船用变压器-JCZ系列制动器-HH101船用铜质开关-上海永上船舶电器厂 | 化工ERP软件_化工新材料ERP系统_化工新材料MES软件_MES系统-广东顺景软件科技有限公司 | 聚氨酯保温钢管_聚氨酯直埋保温管道_聚氨酯发泡保温管厂家-沧州万荣防腐保温管道有限公司 | 真石漆,山东真石漆,真石漆厂家,真石漆价格-山东新佳涂料有限公司 | 断桥铝破碎机_发动机破碎机_杂铝破碎机厂家价格-皓星机械 | 浙江栓钉_焊钉_剪力钉厂家批发_杭州八建五金制造有限公司 | 防火卷帘门价格-聊城一维工贸特级防火卷帘门厂家▲ | 两头忙,井下装载机,伸缩臂装载机,30装载机/铲车,50装载机/铲车厂家_价格-莱州巨浪机械有限公司 | 海外仓系统|国际货代系统|退货换标系统|WMS仓储系统|海豚云 | 连续油炸机,全自动油炸机,花生米油炸机-烟台茂源食品机械制造有限公司 | 超声波成孔成槽质量检测仪-压浆机-桥梁预应力智能张拉设备-上海硕冠检测设备有限公司 | 甲级防雷检测仪-乙级防雷检测仪厂家-上海胜绪电气有限公司 | 电地暖-电采暖-发热膜-石墨烯电热膜品牌加盟-暖季地暖厂家 | 校园文化空间设计-数字化|中医文化空间设计-党建|法治廉政主题文化空间施工-山东锐尚文化传播公司 | 上海风淋室_上海风淋室厂家_上海风淋室价格_上海伯淋 | 安徽成考网-安徽成人高考网 | 沈阳网站建设_沈阳网站制作_沈阳网页设计-做网站就找示剑新零售 沈阳缠绕膜价格_沈阳拉伸膜厂家_沈阳缠绕膜厂家直销 | 水稻烘干机,小麦烘干机,大豆烘干机,玉米烘干机,粮食烘干机_巩义市锦华粮食烘干机械制造有限公司 水环真空泵厂家,2bv真空泵,2be真空泵-淄博真空设备厂 | 今日娱乐圈——影视剧集_八卦娱乐_明星八卦_最新娱乐八卦新闻 | 工业制氮机_psa制氮机厂家-宏骁智能装备科技江苏有限公司 | 手机游戏_热门软件app下载_好玩的安卓游戏下载基地-吾爱下载站 | 桌上式超净工作台-水平送风超净工作台-上海康路仪器设备有限公司 | 中空玻璃生产线,玻璃加工设备,全自动封胶线,铝条折弯机,双组份打胶机,丁基胶/卧式/立式全自动涂布机,玻璃设备-山东昌盛数控设备有限公司 | 【365公司转让网】公司求购|转让|资质买卖_股权转让交易平台 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 不锈钢电动球阀_气动高压闸阀_旋塞疏水调节阀_全立阀门-来自温州工业阀门巨头企业 | 耳模扫描仪-定制耳机设计软件-DLP打印机-asiga打印机-fitshape「飞特西普」 | 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 云南外加剂,云南速凝剂,云南外加剂代加工-普洱澜湄新材料科技有限公司 | 石家庄网站建设|石家庄网站制作|石家庄小程序开发|石家庄微信开发|网站建设公司|网站制作公司|微信小程序开发|手机APP开发|软件开发 |