GithubHelp home page GithubHelp logo

Comments (4)

ketchoop avatar ketchoop commented on July 19, 2024 1

It happens because in the code, two 'sets' stores util functions as closures. Roughly said, it's kind of a currying. I've done it according to this. As I understood, he meant functions, that's not in closures, can pollute the scope. But in the current version of deployer I don't think it's relevant(because of namespace). There are two ways to fix it:

  1. Just make the functions from the 'sets' as normal function: function phinx_get_allowed_config($allowedOptions) { ... } e.g.
  2. Use call_user_func. It will be looks like: call_user_func(get('phinx_get_allowed_config'), $ALLOWED_OPTIONS);

But the second one looks very ugly.

from recipes.

ENM1989 avatar ENM1989 commented on July 19, 2024 1

The second solution does not work, because in Server/Environment::get call_user_func will always be called without the "parameter" parameter. Server/Environment::get does only work with callables without parameters.

I think the first solution is the best one (see: https://gist.github.com/ENM1989/aedb1c7b56a76dcc49b3359b80270786).

Otherwise, the implementation of "getCallable" and "setCallable" would be an option (i think Server/Environment::get contains to much functionality).

from recipes.

antonmedv avatar antonmedv commented on July 19, 2024

@bonndan can you create PR for it?

from recipes.

bonndan avatar bonndan commented on July 19, 2024

Really sorry, no. I would like to contribute, but have no time to fix it. My workaround is to call phinx via "run" and that works for now.

from recipes.

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.