Jump to content

Including file with plugin


szalik.dev

Recommended Posts

Posted

This is not possible - you would either need to

  1. Use an application instead (where you can ship whatever files you want)
  2. Code your plugin crafty so that it will download the files to the local disk automatically if they're not present. You may run into trouble maintaining this down the road, but it's a potential option if you're in a bind.
Posted
4 minutes ago, bfarber said:

Code your plugin crafty so that it will download the files to the local disk automatically if they're not present. You may run into trouble maintaining this down the road, but it's a potential option if you're in a bind.

that's the problem, i don't know how to do that and i don't want to make app for this, because it's not to much to do within plugin

Posted

Since this is just a small library, can't you just paste the whole file in your hook? You would have to do some changes to it I guess, but that should work.

Having multiple classes in a hook is not an issue, as far as I know. @Daniel F or @bfarber can confirm. And if that's an issue, take the methods and add it to your existing class.

Posted
5 hours ago, Martin A. said:

Since this is just a small library, can't you just paste the whole file in your hook? You would have to do some changes to it I guess, but that should work.

Having multiple classes in a hook is not an issue, as far as I know. @Daniel F or @bfarber can confirm. And if that's an issue, take the methods and add it to your existing class.

hm, that's good idea, thanks. I'll try!

Posted

WELL, to be honest, since it's a 3rd party library and since you want to keep it up2date ( at least I hope you're going to follow the repo and update your submission when they fix a critical issue t:D ) it would really be much easier to just create an application.
It's less trouble to create an application and include the 3 files, instead of having to c&p them into your releases.

My 0.02$

Disclaimer: The plugin approach won't be the reason that such a marketplace submission is declined, but it's IMO just easier and cleaner.

Posted
1 minute ago, Daniel F said:

WELL, to be honest, since it's a 3rd party library and since you want to keep it up2date ( at least I hope you're going to follow the repo and update your submission when they fix a critical issue t:D ) it would really be much easier to just create an application.
It's less trouble to create an application and include the 3 files, instead of having to c&p them into your releases.

My 0.02$

Disclaimer: The plugin approach won't be the reason that such a marketplace submission is declined, but it's IMO just easier and cleaner.

yeah, maybe but i still want to make plugin out of this, if i fail, i'll make app 🙂

Posted

alright, i see that making plugin will be much difficult than app. Let's say that i will make app out of this, any idea how to inlude sdk file from resources folder to widget? I never done this so i don't know..

Posted

As it's a PHP library, you would put their SDK library into the application/(name)/sources/ folder and then just do this in your controller/code

@include( \IPS\ROOT_PATH . '/applications/yourapp/sources/path/file.php' );

replacing /path/file.php appropriately.

Posted
6 minutes ago, bfarber said:

As it's a PHP library, you would put their SDK library into the application/(name)/sources/ folder and then just do this in your controller/code


@include( \IPS\ROOT_PATH . '/applications/yourapp/sources/path/file.php' );

replacing /path/file.php appropriately.

thanks!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...