我所有的代码都被分割成了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