Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Too many defines!

Chris Dunning

Recommended Posts

I understand the point of having multiple language files available and using defines in each so that common files can call the right text depending on the language...but...


If I have a store that only uses on language, would it help my speed at all if I simply typed what I want to say straight into the functional php file? Would it hurt me somehow if I didn't?


Case in point - I'm working on my header.php file. I need to create a link to log off. I could type, for the text of the link, "HEADER_TITLE_LOGOUT". I could also type "Log out" and get the same results. The perfectionist in me wants all of my code to look the same, so I use the long form anyway.


This is not the case everywhere - some of the defines are a very short constant that represents a long text. The email texts are a great example.


filenames.php and database_tables.php are also a little overkill, I think. I suppose if I were running multiple stores from one database, they would be useful...I could specify multiple configuration tables, multiple customer bases, etc...but other than that, what would it gain me? I could use filenames.php perhaps to switch between themes...but it really seems that for most users, it's overkill. It's also extra keystrokes - why type " . TABLE_PRODUCTS_TO_CATEGORIES . " when I can just type "products_to_categories"?


So, I suppose the question really is: Would my site load any faster without all of these define statements? Would it be less of a load on php and my server? Or would the difference be so miniscule that it really wouldn't be a difference?

Chris Dunning

osCommerce, Contributions Moderator Team


Please do not send me PM! I do not read or answer these often. Use the email button instead!


I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

Or would the difference be so miniscule that it really wouldn't be a difference?

You got it.


But why don't you rewrite everything and let us know the results anyway? ;)

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...