Let’s start off with a little introduction for those who’ve never heard of or read about me. I’ve been with web-cp for a while. Although I wasn’t there from the start, I still remember the time when 0.4 was fairly new and 0.5
was in pre-release (and named web://cp). Since than a lot has changed. The original 0.5 version only supported sendmail, apache and basic unix users. The current release (0.5.7) has a lot more functionality.
Currently 0.6 is under heavy development. pdrake is still doing most of the work, but a lot of contributions have been made by other users. I can take credit for writing the base of the module/hook system, but it’s pdrake who really made it shine by actually adding useful modules.
I wanted to write about how I would want web://cp to be. I’m not just talking about “the future of web-cp”, but more about what I would’ve made of it if I had complete freedom. Mind you that I was one of the FlexCP developers, and a lot of the ideas come from there. The goal of FlexCP was to make web://cp how it should have been. In the end it resulted in nothing, but the concepts are still viable.
I’ve put several things from FlexCP into web-cp, one of which was the above mentioned modules system. The template parser was another thing. Currently, templating isn’t where I would want to have it. I’m not exactly sure how CPanel does it, but I think that’s where I want templating to be. Every page is a template and (almost) everything can be changed using templates. No HTML code would be directly output by modules or pages, instead a template would handle the formatting of data. This system would require a major code rewrite (much larger than modularization). This is because web-cp was designed with direct code output in mind. This means you’d have to tear the HTML out of the .phps file, put it into a template and write the code to put data into this template.
Something else I would want in web-cp is code consistency. There were no clear coding guidelines, and thus every contributor pretty much has a different style. This results in issues with for example function names. Was it named list_dir(), listdir(), ListDir() or listDir()? I’ve composed a document with some guidelines, but I’ve received little comment on it: http://www.gyrbo.be/?page_id=2
There’s also a lot of duplicate code in web-cp. Sometimes there are even different implementations, one of which is more efficient than the others. Which brings me to another problem. Certain parts of code are written inefficiently. For example, the usage of implode('’, file(x)) is not uncommon. I’ll have to make a document with some hints about inefficient methods of doing something, and the efficient counterpart (haven’t I done this in a forum post somewhere?).
I have some ideas for a one-step installer (anyone remember complete://cp?), but I’ll leave that for another blog post.