Jump to content

composer.json support


Stikki
 Share

Recommended Posts

Howdy,

i was just wondering if there is already workaround in core that would automatically sniff for composer.json up on module installation and install dependencies?

What i'm currently doing is that i include vendor folder into modules, but somehow this feels stupid as of core could just handle this part up on module installation and place dependencies under ROOT_PATH/vendor/?

i tried quickly to look around for previous posts about this topic, but couldn't find anything.

Cheers!

 

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Although PW has composer support, not every setup has composer. This means some modules cannot function as their dependencies cannot be installed during module installation.

When developing a module, if I need a library, I install it with composer inside module directory and require __DIR__ . '/vendor/autoload.php'  inside __construct(), or init() or ready(). All references with use keyword resolve automatically.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...