php – Symfony 2.8:自2.8以来,不推荐使用ResourceInterface ::
发布时间:2020-12-13 13:04:39 所属栏目:PHP教程 来源:网络整理
导读:升级到Symfony后,我发现了很多弃用警告: The class “SymfonyBundleAsseticBundleConfigAsseticResource” is performing resource checking through ResourceInterface::isFresh(), which is deprecated since 2.8 and will be removed in 3.0 (54 tim
升级到Symfony后,我发现了很多弃用警告:
堆栈(来自Symfony profiler) BCResourceInterfaceChecker::isFresh() (called from bootstrap.php.cache at line 3061) ResourceCheckerConfigCache::isFresh() (called from ResourceCheckerConfigCacheFactory.php at line 45) ResourceCheckerConfigCacheFactory::cache() (called from classes.php at line 1328) Router::getMatcher() (called from classes.php at line 1288) Router::match() (called from classes.php at line 7170) Router::match() (called from classes.php at line 2086) RouterListener::onKernelRequest() call_user_func() (called from WrappedListener.php at line 61) WrappedListener::__invoke() call_user_func() (called from classes.php at line 1853) EventDispatcher::doDispatch() (called from classes.php at line 1771) EventDispatcher::dispatch() (called from TraceableEventDispatcher.php at line 132) TraceableEventDispatcher::dispatch() (called from bootstrap.php.cache at line 3178) HttpKernel::handleRaw() (called from bootstrap.php.cache at line 3151) HttpKernel::handle() (called from bootstrap.php.cache at line 3302) ContainerAwareHttpKernel::handle() (called from bootstrap.php.cache at line 2498) Kernel::handle() (called from app_dev.php at line 29) 升级我用过: composer.phar update symfony/symfony --with-dependencies 这是我的composer.json { "name": "framework/symfony","license": "proprietary","type": "project","autoload": { "psr-4": { "": "src/" } },"require": { "php": ">=5.3.9","symfony/symfony": "2.8.*","doctrine/orm": "^2.4.8","doctrine/doctrine-bundle": "~1.4","symfony/assetic-bundle": "~2.3","symfony/swiftmailer-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" },"require-dev": { "sensio/generator-bundle": "~2.3" },"scripts": { "post-install-cmd": [ "IncenteevParameterHandlerScriptHandler::buildParameters","SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap","SensioBundleDistributionBundleComposerScriptHandler::clearCache","SensioBundleDistributionBundleComposerScriptHandler::installAssets","SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile","SensioBundleDistributionBundleComposerScriptHandler::prepareDeploymentTarget" ],"post-update-cmd": [ "IncenteevParameterHandlerScriptHandler::buildParameters","SensioBundleDistributionBundleComposerScriptHandler::prepareDeploymentTarget" ] },"config": { "bin-dir": "bin" },"extra": { "symfony-app-dir": "app","symfony-web-dir": "web","symfony-assets-install": "relative","incenteev-parameters": { "file": "app/config/parameters.yml" } } } 怎么解决这个弃用警告?
一些谷歌搜索发现:
https://knpuniversity.com/screencast/symfony3-upgrade/fix-deprecations-in-bundles
它们链接到Assetic GitHub页面,该页面声称2.7.1已准备好用于Symfony 3.但显然它不是.就这么简单. Assetic只是没有准备好symfony 3所以它在2.8中产生了很多弃用通知. merge request to fix this尚未合并. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |