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

Question2Answer vs LampCMS


I've been looking at Question2Answers:

However it doesn't look as mature as LampCMS - in particular the user interface enhancements or the profile page detail.
However I do like how well Q2A is documented when it comes to building plugins (which I am doing).

I'm keen to hear your thoughts!
asked July 7, 2012 at 10:33 AM


1 Answer

Thank you. First of all I don't think Question2Answer uses MongoDB as backend database.
Lampcms uses MongoDB which makes it much more suitable for sites that expect to grow, in particular sites that expect their database of questions and answers to grow.

As for writing plugins, I have not looked at their system but Lampcms was designed with plugins in mind. It uses Event Dispatcher pattern to post events like 'onBeforeNewQuestion', 'onNewAnswer', etc.

Writing a plugin is as easy as extending \Lampcms\Event\Observer class and implementing your own login inside the main() method.

Yes, I agree Lampcms is not well documented yet, but the actual code is pretty well documented. All classes and method have fairly descriptive doc blocks, all parameters and return types are well defined.

Also you can look at some of existing plugins. For example EmailNotifier class in \Modules\Observers directory.
This class, while technically a core class of the system is also a typical "Module" - it listens to events and based on event type sends out various emails to members.

There are other examples of modules: LinkedIN, Blogger, Facebook - these are all modules that are written pretty much the same way - they listen to events and do their own things. Every module automatically has access to $this->Registry through which you can access any of the core classes like Cache, Mongo\DB, Mailer, and anything else.

Once you write your own module you will just have to add it to the [OBSERVERS] section in !config.ini
Again, there are couple of modules already defined in that section.
The system will then pickup your custom observers and will register them to listen to all system events.

Lastly, I suggest to look at the actual php code in other projects and compare it to Lampcms code.
Lampcms is 100% Object oriented, uses best practices, well known design patterns.

answered July 7, 2012 at 4:34 PM
I think you've got a great product (LampCMS) that's been well developed however it will be it's good design principles and choice of libraries (mainly the choice of DB) that while appropriate and quite superior, make for a more aggressive learning curve (in comparison to Q2A). This will push for greater adoption of alternative applications like Q2A particularly with more junior programmers (and even senior programmers who want a quick and dirty solution and accept an inferior product for the advantages of rapid implementation and editing).
Jul 9 '12 at 19:22
I'm being pushed into using Q2A simply because I'm having difficulty learning so many new programming tools (MongoDB mainly and the subject-observer design pattern to create my own "page"). It's likely I'll implement with Q2A, build my "page" and then convert over to LampCMS when the community grows and would benefit from the better interface enough to justify the workload and learn curve to migrate.
Jul 9 '12 at 19:23
The subject-observer pattern does not require any learning. It's just a pattern - thing of it this way: main program is "subject", your plugin is an "observer". Observer receives events and interesting objects are passed you it. Just look in the Modules folder - many core features are "observers". You will learn quickly.
Jul 9 '12 at 21:02

Your answer

Join with account you already have