Topic: Planning a PHP CMS Pages that link to <a href="https://ozoneasylum.com/backlink?for=28078" title="Pages that link to Topic: Planning a PHP CMS" rel="nofollow" >Topic: Planning a PHP CMS\

 
Author Thread
zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-14-2006 16:00 Edit Quote

I'm planning on making a good CMS. I want to make sure I do it right, so I have begun planning with a brainstorm outline of the core application. Please take a look at it and let me know of any suggestions or criticisms you may have. Please don't say anything about my grammer, this is a rough outline, so it will go through a lot of change.

http://zavaboy.com/nettosache/brainstorm.pdf

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-14-2006 18:10 Edit Quote

It is a good list of features.

Before you go off to create this, why not look at other CMS software and see if you can find something that meets these needs?

I would not recommend the DIY approach with PHP especially for a component that is very common. There are tons of robust CMS solutions written in PHP, it really would not make sense to write your own, when you will be able to find a tried and tested piece of software to use for free.

PHP does not really have the robust and easily accessible Framework in place to make a custom solution the best solution. PHP is a great language because of its open source nature, the sharing of solutions to common problems. If you had a new problem that you wanted to develop a solution for go right ahead, but solving a problem that already has a solution is not an easy undertaking with PHP.

If you want to do a DIY project using Ruby on Rails might be a better idea. That is a language that is DIY focused, it is often easier to create a perfect custom solution than configuring an existing system. With PHP it is far easier to configure an existing system than to create one from scratch.

Dan @ Code Town

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-14-2006 19:37 Edit Quote

Now I don't know what to do, you got me thinking now...

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

IP logged posted posted 06-14-2006 20:06 Edit Quote

Personally what I would love to see in this space is a PHP CMS "framework" as opposed to a full blown CMS. When I was redoing my site I looked at a couple of options in this space and normally they had way more than I needed to the point the UI just got overly cluttered and a pain to use. So something where a development community could add functionality "modules" as they need would be awesome. Imagine a "core" which just handles things like User Authentication, Admin Screens and templating (there may be more). Which can then be extended by installing packages as needed.



.:[ Never resist a perfect moment ]:.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-14-2006 21:57 Edit Quote

When programming you should always consider the make vs buy proposition. When it comes to open source you are often buying something that might not have any cost, which makes it a really good deal.

I would say that 7 times out of 10 you are going to find that buying and configuring is going to be the best option. Configuration is often non-trivial but it tends to save a good deal of time when doing some complex, and a CMS is a complex beast.

Smaller tasks are different, you might spend more time trying to configure simple blogging software than were you to write your own, it all depends. But once you know how to configure some software it becomes easier the next time.

As for a CMS framework. I am for creating frameworks for small problem spaces. I think that the time should be spent on improving a general framework. I am a little tainted by Ruby on Rails at this point, but in rails you will not find a general purpose CMS bundled up nice and pretty like you have with Drupal. But rails does have all the tools that make creating the modules like authentication, admin screens and templating a snap.

Dan @ Code Town

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

IP logged posted posted 06-14-2006 22:42 Edit Quote

Here comes the nasty UML advocate.. muhuhahahahaha....

One word: outline is cool, it's always a plus, but before thinking features, you should think "overview".
Another word: diagrams.

What I do when I plan on doing something big, and you just can't imagine how much it eases out the process of app design, is:

- lay out the "actors" and actions from the user's perspective (very important). In other words, how will information flow through your app and how should it be used?

UML provides two systems for this: use case diagram.

Sample:
"User logs in"
"User is accepted"
"User browses forums"
"User browses threads"

Etc... for each module or set of action, you can write down an outline of this kind. It's not the best diagram, but it gives an overview of usage,
and is a good exercise to do on one of your big projects, or at least a small part of it (forums only, or news only, etc.).
It's also very important to keep it general, in the above example, I am avoiding:

"User types username"
"User types password"
"User presses button"

Because it determines the implementation too much right from the start, this should remain a flexible overview.

- lay out the class diagram.

I've mentionned actors.
In the context of a CMS, actors could be:
- downloads
- posts
- threads
- forums
- news
- user profiles
- etc...

Just lay them out as little boxes. They will become objects. Then tie them to one another. These will become relationships, and will point out the required methods.
"post -> added/suppressed -> thread" / thread.addPost(new Post()) // *** Java pseudo-syntax

It seems "silly" at first, but once you've been through the hassle of laying out the whole diagram, implementation becomes incredibly easy,
because you know exactly what each member does, doesn't do, in other words, it contains the whole skeleton of your app in a single overview.

Google "UML use case" and "UML class diagram" for more info on this.
I do not recommend it for very small projects, but for mid-sized to big projects, it'll make wonders and will spare you loads of hassle and time.

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 06-14-2006 23:03 Edit Quote

somehwat along the lines of Mauro's thoughts - http://www.gurusnetwork.com/tutorial/patterns/
While the particular focus of the tutorial is not what you are after, a lot of the concepts in regard to going about it should be very helpful.

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

IP logged posted posted 06-14-2006 23:43 Edit Quote

Yeah, that pretty much was my point. UML adds other interesting diagrams to these
"design patterns" but it's quite similar to a class diagram and basic UML design.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-15-2006 03:11 Edit Quote

Call me crazy, but I've thought about it and found I would benefit most if I take on this challenge.

I will not worry about forums, blogs, and all those things at this point until I have the core made. Unfortunatly I never used PHP classes, so I probably should make a very simple app introducing me to classes. I will read that tutorial and see what I can learn from it.

Thanks for the help!

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-15-2006 07:50 Edit Quote

Well, if you are going to do this on your own I have some things you might want to think about.

PEAR. See if you can make use of PEAR and think about creating your application so that it could be turned into a PEAR module.

Object Relational Technology. The web world seems to be moving towards and object relational model. Think about encorporating this. PEAR has the DB_DataObject set of classes.

Object Oriented coding. You said you will be looking into doing this in an OO fashion. I believe that this is a great idea. You might want to keep your eye on the OO ball. When coding in PHP it is very easy to fall back on a functional style, while this is not wrong you might find that mixing the two styles can cause headaches in the future.

Fast Prototyping. This is a largish project. I would not recommend that you begin by shooting for the moon. Try to design you application in functional iterations. Create a basic product and then extend it in future iterations. This will provide a better sense of achomplishment and will help you to spot potensial problems well before they have become a huge time sink.

Good luck, I am sure it will be a great learning experience.

Dan @ Code Town

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

IP logged posted posted 06-15-2006 14:06 Edit Quote

functional languages are something different altogether: don't want to despise warmage, but am commited to saying the truth,
what you are calling -functional- is -sequential- instead.

functional languages are characterized by the fact every construct is a function. LISP, ML, and XSL to an extent are functional languages,
characterized by a functional coding style. they do not understand things as global scope or variables, for example, and are a completely different
approach to programming, largely based on recurrence, instead of iteration (for example, there is no real list iterator in list - foreach doesn't exist as is -
instead, you recursively process a list until it is empty).

For the sake of correctness, on to.. er.. correcting more?

--------------------------------------------------------------

"I would not recommend that you being by shooting for the moon"... and yet, I recommend the opposite altogether: plan large for scalability.

Let me explain:
if you've already given ten minutes thinking about the future of your app, you've prepared yourself to be able to expand it, and yet all you will
implement is the necessary - until you want to implement more - then, you'll already have prepared your whole app to move on and upwards
(instead of grafting some code on top of something that wasn't really meant to welcome it).

For example, my go game project is coming to an end. Originally, and in the report and plan, we had classes for a 3d display, and classes for interaction
with the internet go game server. These two features won't exist when we deliver the app, but if we had to implement them,
they have theyre niches waiting for them and could be coded-plucked in within no time.

--------------------------------------------------------------

Side note on UML: it is not intended only for OOP, it is mainly intended as a "universal modelling language" for ALL things software design, and include
specs that cover even interaction between developers, you can diagram anything under UML specs that concerns a software design project.

The closer you'll get from an UML quickstart certainly is the design pattern tut pointed out by DL.

--------------------------------------------------------------

Object-relational? That's a new one too. Objects have relationships because that's how life is, but relational modelling is slightly different from Object oriented modelling,
and older. You can use UML for both, but relational in terms of data structure means tables and queries, objects in terms of data structures
means objects, properties and methods.

Object databases exist and are completely different from relational databases: don't know what the buzz words "object relational" are supposed to mean,
but it doesn't pertain to software design, sadly.

--------------------------------------------------------------

Fast prototyping: now what's that again? It's close to development methodologies of the 70's. More recently, the UP methodology recommends this instead...

- got your BIG plan and BIG overview? Divide it into sub-steps that will be usable as individual applications.
Here, for instance, CMS=> news module, users accounts module, this module, that module....
Build everyone as if it was a stand-alone app - while respecting the initial big picture. Put each step in prod, test it, debug it.
Analysis 40%, implementation 10%, debugging 40%, that's the balance of a well prepared big project.

...if the hare recommends you to stress, hear the tortoise: start by having all the needed weapons in stock, don't, don't, don't rush things -EVEN if this is just
a little thing, the further you look from your current position, and it only takes a look, the easier it will be for you to run the distance in all possible ways.


I am sorry again, but I won't ever refrain from correcting my mates when they speak nonsense again, I may have misunderstood your points Mage, but
I find 95% of your above post irrelevant at best.

Lat but not least: if UML gives you the creeps and sounds cryptic, -d-e-s-i-g-n patterns tut, plain perfect for a starter,
and you can freely trade UML for XML. Lay out an xml page that "pictures" your future CMS and it's "actors", no need for it to be valid XML.

In facts, professional, large scale development tools now propose both UML diagrams and XML diagrams to model things.

A single xml document is often enough to act as a diagram, overview, and backbone for a whole app.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-15-2006 18:46 Edit Quote

Wow, thanks. I know what you mean by not rushing it. As far as this app that I'm planning on making, if I'm going to make it, I want to make it right the first time. I also need to develop a PHP standard, I've been studying this standard lately, it will be a change from my rather poor current standard.

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 06-16-2006 01:51 Edit Quote

That looks similar to the vb.net proper standard, so its a good one to use.

The only thing i dont like is using underscores in the variable names,

so my_variable shoudl be myVariable. The only case i use underscores is for special variables like class variables which get prefixed with an m.

so

m_myClassVariable
myFunctionVariable

SomeClass
SomeFunction

The reason i dont use underscores in variable names is that i use them for database column nameing. This way you know they are two separate things.


Either way its a preference, unfortunatlely I used to do it a different way, so my code is in the middle of being changed to my new way.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-16-2006 14:10 Edit Quote

If you use an object relational technology should not have your db column name mixing with your application code. If you are not using an object relational technology you will always have your column names quoted which with common syntax highlighting keeps it distinct.

Here is a list of a good number of object relational mapping frameworks for PHP. I have used the PEAR module DB_DataObject and it is pretty good. I use ActiveRecord with RoR and it is excellent. I don't know much about the others.
http://wiki.cc/php/Object-relational_mapping.

A reason not to camel case variable names is that they will blend in with the camel casing of class names.

Dan @ Code Town

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 06-17-2006 01:59 Edit Quote

Yeh thats why i always use underscores for my column names, makes it easy to know whats what. Some say not to camel case function names as well and to use the underscore thing but i really dont like that. Unnecessary imo.


At the end of the day it comes down to preference and the most important thing is that you use the same rules throughout your entire code, so if anyone else has to code it they can pick it up.


Also... use the inline curly brackets, old school unix brackets are so... well out dated :P

code:
MyFunction()
{
     $thisWay = 'the best!'
}



Most coding programs match curly brackets and it simply makes more sense that they line up!

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-17-2006 15:25 Edit Quote

Yes you should follow the same coding throughout your code, but you should also make sure that you are using thet same coding standards that are followed by the other people who will be using your code. If you are doing something open source it is a good idea to follow community standards.

Dan @ Code Town

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-17-2006 15:38 Edit Quote

Where can I find community standards?

Nathus
Bipolar (III) Inmate

From: Minnesota
Insane since: Aug 2003

IP logged posted posted 06-17-2006 20:40 Edit Quote

If you want to use a PHP framework similar to Ruby on Rails, I would recommend checking out CakePHP. I've been using it for a little over a month now, and am really liking it a lot.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

IP logged posted posted 06-17-2006 23:39 Edit Quote

You already have found community standards ( i.e. the link you posted above )

I will check out CakePHP! Thanks for the link.

Dan @ Code Town

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 06-18-2006 02:22 Edit Quote
quote:

WarMage said:

Yes you should follow the same coding throughout your code, but you should also make sure that you are using thet same coding standards that are followed by the other people who will be using your code. If you are doing something open source it is a good idea to follow community standards.Dan @ Code Town




Yeh thats true, especially if you are all on the one project. Personally i think coding standards need to be used across different languages though, I like the way the vb.net standards are done and the php community standards are actually pretty close. Apart from the function names, which i dont agree with.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

IP logged posted posted 06-18-2006 05:33 Edit Quote

Ok, great!



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu