我使用symfony2.7与sonata admin doctrine form bundle,我遵循官方安装说明,工作很好,除了一件事。在每次请求中,我都得到以下已废弃的警告,我不知道如何消除它。
Date: 2016-10-18 08:58:28
Fatal: array(
['type'] => 16384,
['message'] => 'This class is deprecated since 3.2 and will be removed with the 4.0 release.Use SonataBlockBundleBlockBlockServiceAbstractBlockService instead.',
['file'] => '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev/classes.php',
['line'] => 8575,
)
编辑:我附加了一个堆栈跟踪
1 in classes.php line 9354
2 at require_once() in ClassCollectionLoader.php line 96
3 at ClassCollectionLoader::load(array('SymfonyBundleFrameworkBundleEventListenerSessionListener', 'SymfonyComponentHttpFoundationSessionStorageNativeSessionStorage', 'SymfonyComponentHttpFoundationSessionStoragePhpBridgeSessionStorage', 'SymfonyComponentHttpFoundationSessionStorageHandlerNativeFileSessionHandler', 'SymfonyComponentHttpFoundationSessionStorageProxyAbstractProxy', 'SymfonyComponentHttpFoundationSessionStorageProxySessionHandlerProxy', 'SymfonyComponentHttpFoundationSessionSession', 'SymfonyBundleFrameworkBundleTemplatingGlobalVariables', 'SymfonyBundleFrameworkBundleTemplatingTemplateReference', 'SymfonyBundleFrameworkBundleTemplatingTemplateNameParser', 'SymfonyBundleFrameworkBundleTemplatingLoaderTemplateLocator', 'SymfonyComponentRoutingGeneratorUrlGenerator', 'SymfonyComponentRoutingRequestContext', 'SymfonyComponentRoutingRouter', 'SymfonyBundleFrameworkBundleRoutingRedirectableUrlMatcher', 'SymfonyBundleFrameworkBundleRoutingRouter', 'SymfonyComponentConfigFileLocator', 'SymfonyComponentDebugErrorHandler', 'SymfonyComponentEventDispatcherEvent', 'SymfonyComponentEventDispatcherContainerAwareEventDispatcher', 'SymfonyComponentHttpKernelEventListenerResponseListener', 'SymfonyComponentHttpKernelEventListenerRouterListener', 'SymfonyComponentHttpKernelControllerControllerResolver', 'SymfonyComponentHttpKernelEventKernelEvent', 'SymfonyComponentHttpKernelEventFilterControllerEvent', 'SymfonyComponentHttpKernelEventFilterResponseEvent', 'SymfonyComponentHttpKernelEventGetResponseEvent', 'SymfonyComponentHttpKernelEventGetResponseForControllerResultEvent', 'SymfonyComponentHttpKernelEventGetResponseForExceptionEvent', 'SymfonyComponentHttpKernelKernelEvents', 'SymfonyComponentHttpKernelConfigFileLocator', 'SymfonyBundleFrameworkBundleControllerControllerNameParser', 'SymfonyBundleFrameworkBundleControllerControllerResolver', 'SymfonyComponentSecurityHttpAccessMap', 'SymfonyComponentSecurityHttpFirewall', 'SymfonyComponentSecurityCoreUserUserProviderInterface', 'SymfonyComponentSecurityCoreAuthenticationAuthenticationProviderManager', 'SymfonyComponentSecurityCoreAuthenticationTokenStorageTokenStorage', 'SymfonyComponentSecurityCoreAuthorizationAccessDecisionManager', 'SymfonyComponentSecurityCoreAuthorizationAuthorizationChecker', 'SymfonyComponentSecurityCoreAuthorizationVoterVoterInterface', 'SymfonyBundleSecurityBundleSecurityFirewallMap', 'SymfonyBundleSecurityBundleSecurityFirewallContext', 'SymfonyComponentHttpFoundationRequestMatcher', 'Twig_Environment', 'Twig_Extension', 'Twig_Extension_Core', 'Twig_Extension_Escaper', 'Twig_Extension_Optimizer', 'Twig_LoaderInterface', 'Twig_Markup', 'Twig_Template', 'MonologFormatterFormatterInterface', 'MonologFormatterLineFormatter', 'MonologHandlerHandlerInterface', 'MonologHandlerAbstractHandler', 'MonologHandlerAbstractProcessingHandler', 'MonologHandlerStreamHandler', 'MonologHandlerFingersCrossedHandler', 'MonologHandlerFilterHandler', 'MonologHandlerTestHandler', 'MonologLogger', 'SymfonyBridgeMonologLogger', 'SymfonyBridgeMonologHandlerDebugHandler', 'MonologHandlerFingersCrossedActivationStrategyInterface', 'MonologHandlerFingersCrossedErrorLevelActivationStrategy', 'SymfonyBundleAsseticBundleDefaultValueSupplier', 'SymfonyBundleAsseticBundleFactoryAssetFactory', 'DoctrineCommonAnnotationsDocLexer', 'DoctrineCommonAnnotationsFileCacheReader', 'DoctrineCommonAnnotationsPhpParser', 'DoctrineCommonAnnotationsReader', 'DoctrineCommonLexer', 'DoctrineCommonPersistenceConnectionRegistry', 'DoctrineCommonPersistenceProxy', 'DoctrineCommonUtilClassUtils', 'DoctrineBundleDoctrineBundleRegistry', 'SensioBundleFrameworkExtraBundleEventListenerControllerListener', 'SensioBundleFrameworkExtraBundleEventListenerParamConverterListener', 'SensioBundleFrameworkExtraBundleRequestParamConverterDateTimeParamConverter', 'SensioBundleFrameworkExtraBundleRequestParamConverterDoctrineParamConverter', 'SensioBundleFrameworkExtraBundleRequestParamConverterParamConverterInterface', 'SensioBundleFrameworkExtraBundleRequestParamConverterParamConverterManager', 'SensioBundleFrameworkExtraBundleEventListenerTemplateListener', 'SensioBundleFrameworkExtraBundleEventListenerHttpCacheListener', 'SensioBundleFrameworkExtraBundleEventListenerSecurityListener', 'SensioBundleFrameworkExtraBundleConfigurationConfigurationAnnotation', 'SonataCoreBundleFormTypeBooleanType', 'SonataCoreBundleFormTypeCollectionType', 'SonataCoreBundleFormTypeDateRangeType', 'SonataCoreBundleFormTypeDateTimeRangeType', 'SonataCoreBundleFormTypeEqualType', 'SonataCoreBundleFormTypeImmutableArrayType', 'SonataCoreBundleFormTypeTranslatableChoiceType', 'SonataBlockBundleBlockBaseBlockService', 'SonataBlockBundleBlockBlockLoaderChain', 'SonataBlockBundleBlockBlockLoaderInterface', 'SonataBlockBundleBlockBlockRenderer', 'SonataBlockBundleBlockBlockRendererInterface', 'SonataBlockBundleBlockBlockServiceInterface', 'SonataBlockBundleBlockBlockServiceManager', 'SonataBlockBundleBlockBlockServiceManagerInterface', 'SonataBlockBundleBlockLoaderServiceLoader', 'SonataBlockBundleBlockServiceEmptyBlockService', 'SonataBlockBundleBlockServiceRssBlockService', 'SonataBlockBundleBlockServiceMenuBlockService', 'SonataBlockBundleBlockServiceTextBlockService', 'SonataBlockBundleExceptionBlockExceptionInterface', 'SonataBlockBundleExceptionBlockNotFoundException', 'SonataBlockBundleExceptionFilterDebugOnlyFilter', 'SonataBlockBundleExceptionFilterFilterInterface', 'SonataBlockBundleExceptionFilterIgnoreClassFilter', 'SonataBlockBundleExceptionFilterKeepAllFilter', 'SonataBlockBundleExceptionFilterKeepNoneFilter', 'SonataBlockBundleExceptionRendererInlineDebugRenderer', 'SonataBlockBundleExceptionRendererInlineRenderer', 'SonataBlockBundleExceptionRendererMonkeyThrowRenderer', 'SonataBlockBundleExceptionRendererRendererInterface', 'SonataBlockBundleExceptionStrategyStrategyManager', 'SonataBlockBundleExceptionStrategyStrategyManagerInterface', 'SonataBlockBundleFormTypeServiceListType', 'SonataBlockBundleModelBaseBlock', 'SonataBlockBundleModelBlock', 'SonataBlockBundleModelBlockInterface', 'SonataBlockBundleModelBlockManagerInterface', 'SonataBlockBundleModelEmptyBlock', 'SonataBlockBundleTwigExtensionBlockExtension', 'SonataBlockBundleTwigGlobalVariables', 'SonataAdminBundleAdminAbstractAdmin', 'SonataAdminBundleAdminAbstractAdminExtension', 'SonataAdminBundleAdminAdminExtensionInterface', 'SonataAdminBundleAdminAdminHelper', 'SonataAdminBundleAdminAdminInterface', 'SonataAdminBundleAdminBaseFieldDescription', 'SonataAdminBundleAdminFieldDescriptionCollection', 'SonataAdminBundleAdminFieldDescriptionInterface', 'SonataAdminBundleAdminPool', 'SonataAdminBundleBlockAdminListBlockService', 'SonataAdminBundleBuilderDatagridBuilderInterface', 'SonataAdminBundleBuilderFormContractorInterface', 'SonataAdminBundleBuilderListBuilderInterface', 'SonataAdminBundleBuilderRouteBuilderInterface', 'SonataAdminBundleBuilderShowBuilderInterface', 'SonataAdminBundleDatagridDatagrid', 'SonataAdminBundleDatagridDatagridInterface', 'SonataAdminBundleDatagridDatagridMapper', 'SonataAdminBundleDatagridListMapper', 'SonataAdminBundleDatagridPager', 'SonataAdminBundleDatagridPagerInterface', 'SonataAdminBundleDatagridProxyQueryInterface', 'SonataAdminBundleExceptionModelManagerException', 'SonataAdminBundleExceptionNoValueException', 'SonataAdminBundleFilterFilter', 'SonataAdminBundleFilterFilterFactory', 'SonataAdminBundleFilterFilterFactoryInterface', 'SonataAdminBundleFilterFilterInterface', 'SonataAdminBundleFormDataTransformerArrayToModelTransformer', 'SonataAdminBundleFormDataTransformerModelsToArrayTransformer', 'SonataAdminBundleFormDataTransformerModelToIdTransformer', 'SonataAdminBundleFormEventListenerMergeCollectionListener', 'SonataAdminBundleFormExtensionFieldTypeFormTypeFieldExtension', 'SonataAdminBundleFormFormMapper', 'SonataAdminBundleFormTypeAdminType', 'SonataAdminBundleFormTypeFilterChoiceType', 'SonataAdminBundleFormTypeFilterDateRangeType', 'SonataAdminBundleFormTypeFilterDateTimeRangeType', 'SonataAdminBundleFormTypeFilterDateTimeType', 'SonataAdminBundleFormTypeFilterDateType', 'SonataAdminBundleFormTypeFilterDefaultType', 'SonataAdminBundleFormTypeFilterNumberType', 'SonataAdminBundleFormTypeModelReferenceType', 'SonataAdminBundleFormTypeModelType', 'SonataAdminBundleFormTypeModelListType', 'SonataAdminBundleGuesserTypeGuesserChain', 'SonataAdminBundleGuesserTypeGuesserInterface', 'SonataAdminBundleModelAuditManager', 'SonataAdminBundleModelAuditManagerInterface', 'SonataAdminBundleModelAuditReaderInterface', 'SonataAdminBundleModelModelManagerInterface', 'SonataAdminBundleRouteAdminPoolLoader', 'SonataAdminBundleRouteDefaultRouteGenerator', 'SonataAdminBundleRoutePathInfoBuilder', 'SonataAdminBundleRouteQueryStringBuilder', 'SonataAdminBundleRouteRouteCollection', 'SonataAdminBundleRouteRouteGeneratorInterface', 'SonataAdminBundleSecurityAclPermissionAdminPermissionMap', 'SonataAdminBundleSecurityAclPermissionMaskBuilder', 'SonataAdminBundleSecurityHandlerAclSecurityHandler', 'SonataAdminBundleSecurityHandlerAclSecurityHandlerInterface', 'SonataAdminBundleSecurityHandlerNoopSecurityHandler', 'SonataAdminBundleSecurityHandlerRoleSecurityHandler', 'SonataAdminBundleSecurityHandlerSecurityHandlerInterface', 'SonataAdminBundleShowShowMapper', 'SonataAdminBundleTranslatorBCLabelTranslatorStrategy', 'SonataAdminBundleTranslatorFormLabelTranslatorStrategy', 'SonataAdminBundleTranslatorLabelTranslatorStrategyInterface', 'SonataAdminBundleTranslatorNativeLabelTranslatorStrategy', 'SonataAdminBundleTranslatorNoopLabelTranslatorStrategy', 'SonataAdminBundleTranslatorUnderscoreLabelTranslatorStrategy', 'SonataAdminBundleTwigExtensionSonataAdminExtension', 'SonataAdminBundleUtilAdminAclManipulator', 'SonataAdminBundleUtilAdminAclManipulatorInterface', 'SonataAdminBundleUtilFormBuilderIterator', 'SonataAdminBundleUtilFormViewIterator', 'SonataAdminBundleUtilObjectAclManipulator', 'SonataAdminBundleUtilObjectAclManipulatorInterface'), '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev', 'classes', true, false, '.php') in bootstrap.php.cache line 2609
4 at Kernel->doLoadClassCache('classes', '.php') in bootstrap.php.cache line 2444
5 at Kernel->boot() in bootstrap.php.cache line 2478
6 at Kernel->handle(object(Request)) in app_dev.php line 34
7 at require_once('/www/managedoc/branch/hoffereka/web/app_dev.php') in app_superadmin_dev.php line 3
发生的事情不一定是你的错。正如您在这里看到的,问题来自于块包中的弃用。也许admin bundle(或其他bundle)出于某种目的正在使用它,并且还没有遵循弃用建议。
让我们首先修复弃用消息中的错误,并使它们更精确。
深入研究,你会发现3.9.0应该会解决这个问题。
你能运行composer info
向我们展示你使用的管理包的版本吗?