Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
A package config load order problem
  • I'm looking for advice on a problem with the package config load order I've encountered.

    I have two packages, A and B, with package B using package A.

    The web app 'always' loads package B, which will manually load package A when needed. This part works fine.

    Package B tries to merge configurations with A by using the same config filename.  However, because package A is loaded after package B, the configuration in package A is replacing the configuration in package B.

    I need the configurations applied in this order:  A, B, App

    If the web app 'always' loads both A and B (in that order), then the problem is solved.

    However, I thought it would be better not to expose the internals of package B to the app developer.  This seems be in agreement with the theory behind Composer package management.

    Is there a mechanism to make the configurations load in the desired order, or is there a reasonable way I can hack it?

    I'm not the first person to try this, right?

  • HarroHarro
    Accepted Answer
    Maybe not, but you're the first one asking about it afaik.

    You can use the path methods of the Finder to retrieve all loaded paths, add or remove paths, and reorder them. There is no set method to swap the order, but you could do something manually after you have manually loaded package A, to make sure the path to A is in the stack before the path to B.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion