Jump to content

Recommended Posts

Posted

Hi all

I had a look to the processwire database and it is getting quite messy as not all developers seem to follow some kind of basic naming conventions.

i.e.

cache (is OK)

CommentRatings (is not OK imho as Big and small Letters and beside this it does say nothing about if it is a field or a page or whatshowever)
fieldgroups (is OK)

...
than we have
hana_code (is OK)

link_ ...
mb_ ...
modules
module_ ...
pages_ ...

page_ ...
ProcessFieldChangeNotifier (why not process_fieldchangenotifier?))
ProcessRedirects (why not process_redirects)
ProcessTrashman (why not process_trashman)
process_ ...
session_ ...

ShoppingCart (again Big and small letters. IMHO it would be better to have shop_cart and than shop_order etc. ....)
templates
textformatter_ ...
users_ ...
version_control_ ...

------

To keep the database somekind logically and easy to search and look at it would be great to have some naming conventions in place:

What Naming Convention exist in the ProcessWire?
Are there any?

fields_
pages_
page_
template_
process_

textformatter_

version_control_

users_

What about some additional ones like ?
apps_ i.e. apps_commentsratings
                 apps_shoppingcart
etc

Thanks

Andi




 

post-2565-0-74544800-1411365096_thumb.pn

  • Like 1
Posted

Those CamelCase tables are CamelCase because the classname of the module I think. And all of them are not written by Ryan I believe.

Probably they used $this->className() as table name what makes perfectly sense to me.

  • Like 1
Posted

Apparently I like both sides of this argument :)

What about doing this to the classname?

strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->className()));
  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...