-1

Im looking for answers detailing theoretical approaches, so don't worry about any technical specifics.

I am researching concepts to build a simple CMS and one thing I cannot decide is whether to use pure PHP with various libraries, or to build it on top of an MVC framework like Zend or Symfony.

My concern is that by building it on a framework would mean that template and content management would have to go through a custom layer of abstraction built by myself, the processing of which would be built on top of the framework, so that is essentially two layers of frameworks.

Is this a valid solution, or should the routing system be built from scratch, and simply use third party libraries for DBO abstraction and other useful tools for more specific components?

Thanks.

j0k
  • 22,600
  • 28
  • 79
  • 90
Flosculus
  • 6,880
  • 3
  • 18
  • 42
  • @anonymousdownvotingislame Yeah, sure, use a legacy spaghetti code blogging platform, twisted to be an all-purpose cms with plugins of untrusthy source, and powered with SS caching to overcome the natural slowness. No, really, please guys stop suggesting WP for everything everytime. And besides, it doesn't even answer the already OT question – Damien Pirsy Sep 23 '12 at 20:43
  • @DamienPirsy Obviously you have never cracked open the codebase of WP, used it as an all-purpose CMS, or looked for five seconds for any plugins of a "trusthy" source. I could destroy each and every point you made but folks who denigrate WP like you have, without ever exploring it, don't deserve its awesomeness. – iambriansreed Sep 23 '12 at 20:56
  • Well, actually, I say that exactly because I cracked it open and used it...But this isn't the place for such a never-ending discussion – Damien Pirsy Sep 23 '12 at 21:01
  • And finally: http://trends.builtwith.com/cms – iambriansreed Sep 23 '12 at 21:01

2 Answers2

1

If you build a CMS using libraries, all you'll be doing is reusing code that you would be coding yourself and possibly having a shorthand way of coding things. If you can easily break your code apart or code it from scratch again when the time comes, this shouldn't be a problem.

But if you use a framework to write a CMS, it'll give you a functionality for coding already included in it, such as MVC, testing, a templating language, ORM, maybe scaffolding, migrations, and other such things.

desbest
  • 4,746
  • 11
  • 51
  • 84
  • This is the feeling I had. My concern was that by using a MCV library I would be able to construct an admin panel with relative ease, but when it came down to the customization of user websites, there could potentially be conflicts between the framework and the routing system of the CMS pages. I might still consider using one, as by not using one I could be denying myself many tried and tested concepts, but I will have to have a long think. Its really something I want to get right first time. – Flosculus Sep 24 '12 at 06:27
  • But using the framework's routing system, is much more easier and customisable than if you built one yourself. It can just take stuff from your database and populate the url with that. Do you really want to be doing stuff with just PHP Classes? http://toolkit.getkirby.com/ http://flourishlib.com/ http://clickontyler.com/simple-php-framework/ – desbest Sep 24 '12 at 09:18
  • Im a little worried that my application will become to reliant on a framework. I should have mentioned, the routing system needs to provide data in the form of an API rather than loading pages. So while a form of MVC is important, it doesnt need to be so heavy to account for things like templates. I've decided on one thing, to use phps PDO over Zend or Doctrine, because my system needs to be fast as well as portable to enable a fluid 'interact and response' UI. Perhaps API based - UI independent systems are something you are familiar with? – Flosculus Sep 25 '12 at 22:31
  • Your application will become reliant on _whatever_ you use to code it. There is no evading that. – desbest Sep 26 '12 at 08:05
  • I meant im worried about it becoming reliant enough that a change in framework would require a change in the system architecture, whilst using frameworks to perform more specific tasks should only require moderate changes in such a case. i've had a look at the source code of a few open source systems, not just CMSs, and not very often have i seen them being built on top of an MVC framework that they didn't build themselves. Is there any particular reason for that? – Flosculus Sep 26 '12 at 10:11
  • Yes. Coding using a framework accelerates ones coding speed, allowing them to code things much faster than they would have done, had they not used a framework in the first place. – desbest Sep 26 '12 at 10:30
0

There is another approach to consider, such as building a CMS as a service to support multiple websites hosted wherever. Enable this by taking a plugin approach with REST and HTML5 and CORS that would allow you to place content management on any arbitrary content item in any server-side technology. I ended up doing this myself for my ecommerce company because we support different server-side and different approaches and frameworks within those scenarios. I then made it as a side company but it really is just a tool that I prefer to use and doesn't get much in terms of revenue as I don't promote it. What I would do if I was starting over, which I may decided to do to make it cleaner as a reversion of it would be to make it work more like Amazon Web Services in terms of the security model and API style. You can get a better idea of what I'm talking about if you look at kitgui.com

King Friday
  • 25,132
  • 12
  • 90
  • 84