문제

I'm new to PHP, so forgive me for any missteps.

I'm using a Wordpress plugin called Short Code Exec

I am writing a pretty simple piece of code that is dependent on a specific PHP library (call it XYZ)

I notice that I need to use Composer to install this library

the library's docs say run

php composer.phar require blahblah/XYZ

But, how do I do this within this plugin?

도움이 되었습니까?

해결책

You don't run composer within the plugin, you will need to either run it locally and upload the files it downloads/creates or run it on your server.

You will then include the autoload file like you would with a normal php project with in the plugin (ie. require '/vendor/autoload.php';) and then you run the rest of your code and the classes will be autoloaded for you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top