Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
szalik.dev Posted January 27, 2019 Posted January 27, 2019 Hi, is there any way to include extra file with plugin? e.g. mtasa php sdk? (https://github.com/multitheftauto/mtasa-php-sdk/releases)
bfarber Posted January 28, 2019 Posted January 28, 2019 This is not possible - you would either need to Use an application instead (where you can ship whatever files you want) 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.
szalik.dev Posted January 28, 2019 Author Posted January 28, 2019 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
Martin A. Posted January 29, 2019 Posted January 29, 2019 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.
szalik.dev Posted January 29, 2019 Author Posted January 29, 2019 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!
Daniel F Posted January 29, 2019 Posted January 29, 2019 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.
szalik.dev Posted January 29, 2019 Author Posted January 29, 2019 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 🙂
szalik.dev Posted January 29, 2019 Author Posted January 29, 2019 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..
bfarber Posted January 29, 2019 Posted January 29, 2019 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.
szalik.dev Posted January 29, 2019 Author Posted January 29, 2019 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!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.