2016-01-06 136 views
2

我試圖通過創建一個作曲模塊和加載Magento 2作爲開發依賴通過安裝到子文件夾和鏈接我的主題從單獨的src/子目錄。作曲家安裝Magento 2作爲開發依賴

目前,我想在我composer.json文件從而導致該模塊在安裝到根目錄下:

"require-dev": { 
    "composer/installers": "*", 
    "magento/project-community-edition": "2.0.*" 
}, 
"extra": { 
    "installer-paths": { 
     "magento/": ["type:product"] 
    } 
} 

從上Magento的1個工作,我能夠有以下目錄結構來開發並測試我的模塊:

magento/ 
src/ 
composer.json 
modman 

隨着composer.json設置如下:

"require-dev": { 
    "composer/installers": "~1.0", 
    "magento/ce": "1.9.2.*" 
}, 
"extra": { 
    "installer-paths": { 
     "magento": ["type:magento-source"] 
    } 
} 

這可能與Magento 2有關嗎?或者我會更好地運行兩個不同的項目,將我的主題指定爲依賴項,如果可以,我將如何將這些項目鏈接在一起進行開發?

+0

如果Magento的/是你的Magento根的依賴,我敢肯定,這是不可能在同一水平有一個src /目錄。最簡單的方法就是使用magento/vendor。這有幫助嗎? –

回答

0

你可以利用作曲家的repository with artifact作爲

"repositories": [ 
     { 
      "type": "artifact", 
      "url": "path/to/directory/with/zips/" 
     } 
    ], 

其中path/to/directory/with/zips/應該包含你的主題的壓縮包。

而且,你不需要在"composer/installers"magento/project-community-edition只需將"magento/framework"