Username
Forgot password?
Welcome to our site!
Or Join with FTTF

What's the best way to enhance LampCMS?

2

886 views
Is there a plugin or module infrastructure I can use so I don't have to modify LampCMS core code?  I'm concerned with making changes to LampCMS code and having those changes conflict with upgraded versions.
 
asked October 19, 2011 at 1:24 PM

 US

1 Answer

2
 
Yes, you can write plugins for pretty much any new feature.
I call them modules. Your custom module is a class that extends the \Lampcms\Observer object
As such it has access to the all important oRegistry object from which you can get your Mongo object, Ini object, and most other important object.

You write your own methods and write your own main() method. main() is called by the Dispatcher and notifies of important events. You can perform actions based on specific event.

Some of the core features of Lampcms are already written as modules, for example FloodCheck, IpFilter as well as Search indexer and EmailNotifier.

Take a look how there are written and you can then write your own plugin the same way. Then add your plugin to the !config.ini file either to [OBSERVERS] section - plugins in that section listen to all events or to [INPUT_FILTERS] section - plugins defined there listen to events like new questions, new answers, comments - all type of user input. If you write plugin like a spam filter then you would put it in the [INPUT_FILTERS] section. It's more efficient since input filters are not notified on all events like observers, only on input events.

I am now working on the new module "Who's online" and I'm writing it as a module.
flag
answered October 20, 2011 at 5:57 AM
Thanks. That was helpful. What if I want to modify an existing feature in LampCMS, for example the login. Is there a way to do this without modifying core code?
flag
Oct 26 '11 at 13:25

Your answer

Join with account you already have

FTTF

Preview

Alert