Code Monkey home page Code Monkey logo

Comments (17)

gquemener avatar gquemener commented on June 2, 2024

Could you be more specific please?

from knpradbundle.

lsmith77 avatar lsmith77 commented on June 2, 2024

sorry .. was in a rush back then.

i fixed the issue by config:

knp_rad:
    listener:
        orm_user: false

in the RAD spirit it might however make sense to automatically discover that the relevant services are missing in a compiler pass and automatically disable the relevant services

from knpradbundle.

gquemener avatar gquemener commented on June 2, 2024

Oh yes, indeed. We could disable all services that depends on other symfony services that are not available.

from knpradbundle.

gquemener avatar gquemener commented on June 2, 2024

Here are the rules I've found so far that could be implemented inside a compiler pass:

  • Remove knp_rad.flash.message_renderer if service translator is not registered
  • Remove knp_rad.twig.flash_extension if service session is not registered (is that possible?)
  • Remove knp_rad.form.manager if service request is not registered
  • Remove knp_rad.form.type_creator if service form.factory or form.registry is not registered
  • Remove knp_rad.form.default_creator if service form.factory is not registered
  • Remove knp_rad.twig.link_attributes_extension if service form.csrf_provider is not registered
  • Remove knp_rad.csrf.listener if service form.csrf_provider is not registered
  • Remove knp_rad.mailer.message_factory if service mailer or twig is not registered
  • Remove knp_rad.orm.user_listener if service security.encoder_factory is not registered
  • Remove knp_rad.routing.loader if service file_locator is not registered
  • Remove knp_rad.view.listener if service templating or twig or controller_name_converter is not registered
  • Remove knp_rad.view.path_deducer if service templating.name_parser is not registered

Furthermore, it needs some more investigation to check if thoses services are somehow dependances of other services (that should then be also removed, etc.)!

Finally, I was thinking maybe it could be a nice idea to log warning about the fact that the service has been deactivated automatically and should be configured to be deactivated (or that user would need to install some 3rd party lib to enable this service).

What do you think @docteurklein @Herzult @everzet @lsmith77 ?

from knpradbundle.

lsmith77 avatar lsmith77 commented on June 2, 2024

maybe there could be a command for this?

from knpradbundle.

lsmith77 avatar lsmith77 commented on June 2, 2024

potentially also a profiler tab with status information about disabled features

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

yes, we should remove the whole service stack that depends on unexistant service. Removing knp_rad.view.path_deducer will make fail the AssistantController for example.

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

@lsmith77 @gquemener could we take advantage of http://symfony.com/doc/current/cookbook/bundles/prepend_extension.html to detect FrameworkBundle config form: enabled for example ?

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

/me is currently giving a try to prepend configurations.

from knpradbundle.

gquemener avatar gquemener commented on June 2, 2024

Woo, never heard about this feature before! Sounds like what we are trying to achieve here!

from knpradbundle.

gquemener avatar gquemener commented on June 2, 2024

As it is prepended configuration, I believe that if user explicitly defines listener.orm_user: true and the security services aren't available, then it would not be overwritten, right?

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

i'm checking. EDIT: works as expected: if you force the value to true in config, autodetection will be overwritten.

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

commiting right now for you to see: @lsmith77 @gquemener .
PS: specs didn't detect any change Oo. I'll have to write specs for that.

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

#104

from knpradbundle.

lsmith77 avatar lsmith77 commented on June 2, 2024

@docteurklein i wouldnt use prepend extension for this. you dont really care about specific 3rd party bundles but the availability of certain services.

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

I'm just encountering problems, with order of removal, since some compiler passses seems to already have a reference on some (later removed) services. Trying to use TPYE_BEFORE_(REMOVING|OPTIMIZE) without success.

from knpradbundle.

docteurklein avatar docteurklein commented on June 2, 2024

nevermind.

from knpradbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.