Code Monkey home page Code Monkey logo

Comments (4)

stof avatar stof commented on August 19, 2024 1

Starting a new PHP process for each migration would have a huge performance impact for the execution of migrations, which seems a no-go.

I suggest you to fix that in your project: register a listener for the onMigrationsVersionExecuted or onMigrationsVersionExecuting event (not sure which one of them is best for your case) that would clear your cache between migrations.

from migrations.

stof avatar stof commented on August 19, 2024 1

@bs-thomas static variables are not request-based. They are process-based.

from migrations.

derrabus avatar derrabus commented on August 19, 2024

This is how static variables work. Using a static variable as a cache was a bad call on you side, sorry. For the reasons given by @stof, this bug report is not actionable for us.

from migrations.

bs-thomas avatar bs-thomas commented on August 19, 2024

Thanks for your quick response. I appreciate it.

I can understand it is a performance impact for doctrine. And I did think about it, and also agree so. So I will try to find an alternative for this.

@derrabus While I appreciate your advice, actually I don't quite understand why it was a bad idea. From my understanding, the use of static variable caching is actually quite a common use-case scenario for request-based caching, especially when PHP was made to be "request independent". Also for my use-case, it was not "object-dependent", so all instances of that same class are going to have the same table columns, so "static" seems to be the way to go. Or did I misunderstand something here?

** I understand this is off-topic already, just a friendly social discussion, just hoping to learn from you a little more :-)

from migrations.

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.