在作曲家成功从 Symfony 2.3 升级到 2.7 后
使用composer update symfony/symfony sensio/distribution-bundle twig/twig --with-dependencies
我遇到了问题
类型错误:传递给 Twig_Environment::tokenize(( 的参数 1 必须是 Twig_Source的实例,给定字符串,调用 /var/www/git/admin/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php 在第 34 行
我的作曲家.json
{
"name" : "symfony/framework-standard-edition",
"description" : "The "Symfony Standard Edition" distribution",
"autoload" : {
"psr-0" : {
"" : "src/"
}
},
"require" : {
"php": ">=5.3.9",
"symfony/symfony": "2.7.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/assetic-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"twig/extensions": "v1.5.*",
"symfony/swiftmailer-bundle" : "2.6.7",
"sensio/generator-bundle" : "2.3.*@dev",
"jms/security-extra-bundle" : "1.5.*@dev",
"jms/di-extra-bundle" : "1.4.*@dev",
"twig/twig" : "2.4.*",
"kriswallsmith/assetic" : "1.1.*@dev",
"jms/metadata" : "1.1.1",
"swiftmailer/swiftmailer" : "5.4.9",
"doctrine/dbal" : "2.4.*@dev",
"monolog/monolog" : "1.23.0",
"symfony/routing" : "2.3.*",
"stfalcon/tinymce-bundle" : "1.0.*",
"genemu/form-bundle" : "2.2.*",
"liuggio/ExcelBundle" : "v2.0.1",
"liuggio/excelbundle" : "^2.0",
"raulfraile/ladybug-bundle" : "~1.0",
"guzzlehttp/guzzle" : "^6.1",
"jms/serializer-bundle" : "^1.0",
"smalot/pdfparser" : "^0.9.25",
"abraham/twitteroauth" : "^0.6.4",
"friendsofsymfony/rest-bundle" : "^1.5",
"aws/aws-sdk-php-symfony" : "^1.3",
"tetranz/select2entity-bundle" : "^2.5",
"pinano/select2-bundle" : "^4.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"
],
"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"
]
},
"config" : {
"bin-dir" : "bin"
},
"minimum-stability" : "alpha",
"extra" : {
"incenteev-parameters" : [{
"file" : "app/config/parameters.yml"
}, {
"file" : "src/Project/EventTrackerBundle/Resources/config/parameters.yml",
"dist-file" : "src/Project/EventTrackerBundle/Resources/config/parameters.yml.dist"
}
],
"branch-alias" : {
"dev-master" : "2.7-dev"
},
"symfony-app-dir" : "app",
"symfony-web-dir" : "web",
"symfony-assets-install" : "relative"
}
}
是否有人遇到过这个问题或类似的问题,并且知道可以帮助我的东西?
根据错误消息,这是由kriswallsmith/assetic
引起的。尝试将其升级到更新的版本 - 所需的版本1.1.*@dev
已超过三年,可能与 Twig 的最新更改不兼容