我所有的代碼都被分割成了bundle,這是我需要的composer.json。 現在我想用composer install
安裝整個項目,但是當我嘗試一下,symfony的文件夾沒有出現,我也得到了以下錯誤消息:有沒有辦法通過composer.json完成symfony3的安裝?
[RuntimeException]
Could not scan for classes inside "app/AppKernel.php" which does not appear to be a file nor a folder
有沒有辦法來請求symfony的安裝檔案?
這是我composer.json
:
{
"name": "mygloriousname",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
create-project命令不是我搜索的那個,因爲我無法安裝在非空目錄中。所以作曲家無法閱讀我的composer.json。 Ansible有點制服爲我的項目:) 所以我必須檢查整個symfony的結構(排除'.gitignore'文件轉換成飯桶。 我有一口複製安裝完成後的配置文件。 但是,感謝您的詳細解答 – WebCyclone
這是我在最後一段中試圖解釋的問題:composer是_just_,用於安裝依賴關係,而不是用於部署項目,我所描述的是設置項目的有限方式,但這已經在影響作曲家的目的了,更新一個已經存在的項目 - 就像你想做的那樣 - 需要在作曲家中進行大量的修改,因爲它需要它沒有設置的任務,在簡單的情況下,你可以改爲如果項目由git管理,請執行'git pull'。更常見的情況是使用部署工具:http://www.phptherightway.com/#deployment-tools。 – dbrumann
這比您想象的更復雜的原因是,有時在更新項目時,除了下載新文件外,還有其他任務涉及到。例如,您可能必須重新啓動其他服務,清除緩存(不僅僅是作曲者緩存,例如在數據庫或redis/memcached中),可能會使會話無效。那些只是我頭腦中的那些。還有更多。他們中的大多數都需要對應用程序有更深入的瞭解,並且是非常具體的項目,他們通常必須按照正確的順序運行。這不是作曲家的範圍。這就是爲什麼它很難。 – dbrumann