Announcement

  •  » Engine
  •  » plugin able to override core functionality

#1 2014-12-22 03:38:58

FungibleCog
Guest

plugin able to override core functionality

Hi devs

I've recently been playing with piwigo with a view to using it to manage all my photographs. An important function for me is hierarchical keywords, because I use them to manage my RAW files in darktable and I want to have the same keyword hierarchy available for the exported JPEGs.

I've been playing with the piwigo code to the point where I have hacked together something that provides what I need, making use of the existing functionality, and without affecting how it works with flat tags. I would ideally like to package this as a plugin so that a) I do not have to maintain my own versions of piwigo core files and b) others can use and/or improve it if they want.

However, tags seem to be quite tightly integrated into piwigo (eg they are part of search, tag cloud, etc), so in addition to creating a tree-viewer, I have tweaked a few core files to provide the best user experience (eg making search work as expected). That's the background, no for my questions:

1) Is there any way for a plugin to override other functionality eg by changing the definition of global variables and/or functions that other components call?

2) My implementation relies on adding triggers to the existing "tag" and "image_tag" tables that call stored procedures to update my own tables when tags change. Is this kind of behaviour by plugins acceptable?

 

#2 2014-12-22 08:22:37

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: plugin able to override core functionality

Hello

1) yes if you manage to use trigger_change and trigger_notify points, we can add some if you need, see skeleton plugin to see how triggers works, and also our doc

2) absolutely not, most host don't allow database triggers, plugins are only php, new tables and new columns

Offline

 

#3 2014-12-23 21:39:06

FungibleCog
Guest

Re: plugin able to override core functionality

Many thanks. I will review how trigger_change and trigger_notify work and look to change the implementation to not use triggers.

 
  •  » Engine
  •  » plugin able to override core functionality

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact