Use 3rd party library during install package

Permalink
Hi

I have a question. I've installed 3rd party library and I use it in my package (I use autoload in on_start function)

public function on_start()
    {
        require $this->getPackagePath() . '/vendor/autoload.php';
    }


I want to use this package during install. How can I do this ?

I've got error that class is not found.

IceManSpy
 
A3020 replied on at Permalink Reply
A3020
Have you tried:

public function install() {
  require $this->getPackagePath() . '/vendor/autoload.php';
  //...
}
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Some options
- call $this->on_start() from the beginning of the install()
- Replicate the require at the beginning of the install()
- connect pkgAutoloaderRegistries to what needs to be loaded and its namespace.

https://documentation.concrete5.org/developers/packages/adding-custo...
IceManSpy replied on at Permalink Reply
IceManSpy
Thank you for quick answers.