Managing store/vendor/ext in an extension

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
pierredu
Registered User
Posts: 962
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Managing store/vendor/ext in an extension

Post by pierredu » Sat Nov 02, 2019 8:08 am

Hello,

I have an extension which stores graphic files. As I've read, this should happen in store/vendor/ext.

I've found an example at viewtopic.php?f=461&t=2390971&p=14545286 and tried to mimic that in a migration file, but it doesn't work.

More, the link to a sample code page given by VSE is broken (404).

My code is in a file named release_3.php in the migrations folder, in my repo on github.

Thanks in advance for any clues.

User avatar
david63
Registered User
Posts: 16661
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Managing store/vendor/ext in an extension

Post by david63 » Sat Nov 02, 2019 8:13 am

I don't think that you can do it in migration but within the actual extension.

You will have to check it within the extension anyway in case the user has deleted it or changed permissions on it. So check for it in the extension and if not there create it.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
pierredu
Registered User
Posts: 962
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: Managing store/vendor/ext in an extension

Post by pierredu » Sat Nov 02, 2019 8:16 am

OK, the other way around.
I'll do it.
Thanks.

User avatar
3Di
Former Team Member
Posts: 14346
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Managing store/vendor/ext in an extension

Post by 3Di » Sat Nov 02, 2019 11:45 am

You can do it in migration using a custom function, see an example here:
https://github.com/phpBB-Studio/DiceRol ... hp#L37-L71
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
pierredu
Registered User
Posts: 962
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: Managing store/vendor/ext in an extension

Post by pierredu » Sat Nov 02, 2019 5:36 pm

Thanks Marco,

I followed david63's advice, in particular because checking the access rights and the existence of the folders will protect the extension against manual changes by admins who don't know what they do.

User avatar
VSE
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 4933
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Managing store/vendor/ext in an extension

Post by VSE » Sat Nov 02, 2019 10:43 pm

3Di wrote:
Sat Nov 02, 2019 11:45 am
You can do it in migration using a custom function, see an example here:
https://github.com/phpBB-Studio/DiceRol ... hp#L37-L71
Migrations should only be used to make database changes.

Changes to the file system should be done in your extension's PHP code.

How phpBB does this in the Ad Management extension is a good example:

https://github.com/phpbb-extensions/ad- ... er.php#L47
Dictated but not read.
Official phpBB Extensions My Extensions & MODs
Please do not PM me for support.

User avatar
3Di
Former Team Member
Posts: 14346
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Managing store/vendor/ext in an extension

Post by 3Di » Mon Nov 04, 2019 6:47 am

My example is different as I am mirroring directories from my extension to the file system, so that they can be used by the user at will.

Of course my example does not match, I see now, with the description of the OP's request.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Post Reply

Return to “Extension Writers Discussion”