Jump to content
peterbuzzin

Curious find in Edge/Frozen regarding definitions

Recommended Posts

Hi,

I've had an opportunity today to start having a look around the code (I wanted to start contributing to it at some point) and noticed that there are a lot (if not all) hardcoded table and filenames.  Is this intentional or something on the to-do list to change back to defined constants?

If it's intentional it seems like a step backwards/devolution to me.  This question may have come up before but does anyone know the thinking/reason behind this?  I'm trying to get my head around it.  It will make table prefixes and changing filenames so difficult in the future, changing something that gave it flexibility to something inflexible.  

 


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

It is intentional Peter and was decided a few years back.   I guess it was felt that adding a define was just adding another step for something that was of little, if any, benefit.  How often are you going to change one of the file names and I guess if you were going to do that for some reason, a global search and replace can be used these days. Probably not something you could do easily 20 years ago.

Dan

Share this post


Link to post
Share on other sites

if it is intentional as you say then that is a real shame.

Text search/replace across multiple files has been available before the existence of osCommerce, it's a staple of most IDE's where you can define a project folder.

Unfortunately we'll have to disagree on the "little, if any, benefit", table prefix functionality is common/standard with pretty much every script (WordPress for example).  Unless you're happy to have a separate database for every script you install, table naming conflicts are common and the chances of it happening increase with the amount of tables installed per script, that's where prefixes come into play.

Ripping functionality out for the sake of convenience is regression, not progression.  I'd hope the table and filename definitions are still loaded at least even if not utilised.

I'm starting to understand why HPDL hasn't recognised it when it's pulled away from basic coding standards.  Even HPDL's OSC V3 based on MVC architecture uses definitions, albeit in a more modern way. 

Most modern frameworks use definitions for this purpose in some shape or form.  osC has to compete with other carts that are available, make itself as flexible as possible from the ground up and not become a niche hardcoded personal project.  I'm sorry to say it but there's not much future in that.


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

I want to make this absolutely clear as well that I'm not trying to pass any judgement on Burt.  I've said on enough previous posts that I think he has done an absolutely outstanding job on keeping the project moving, I don't envy the task that he volunteered for.  I have a huge amount of respect and admiration for what he's taken on.

In my professional opinion it was a bad call and should be reverted.  I'm happy to do this if Burt's willing to merge/commit it.


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

I don't think it was Gary's call but I'm not sure.  I believe it was a decision taken by Harald.  Keep in mind that OSC V3 was released long before Bootstrap came along. 

If it helps, there is a compatibility add-on that you can use to continue on with the defines...at least for filenames. 

I understand your point about tables and as I recall some were upset about that aspect of the change.  There was some discussion about using a table prefix and namespaces but a lot of that discussion was lost on me.  I'm sure those threads are still here somewhere if you care to look for them. 

I'm not sure I understand why you'd want to have the filenames as a define though since I don't see the need to ever change them. IMHO it just adds a layer of complication in installing modules and updating a filenames.php file for no particular reason. 

If you can make a case to revert that decision,  maybe someone will change that, but I wouldn't hold my breath.

Dan 

Share this post


Link to post
Share on other sites

Edge should not be used as the basis for developing - there are too many issues with it. 

Share this post


Link to post
Share on other sites
9 hours ago, Hotclutch said:

Edge should not be used as the basis for developing - there are too many issues with it. 

What are the issues?  It is about to become an osC offered download so if there are any problems it would be good to get them sorted out.

Dan

Share this post


Link to post
Share on other sites
7 minutes ago, Dan Cole said:

It is about to become an osC offered download...

Are you referring to Frozen or Edge ?

Share this post


Link to post
Share on other sites
Posted (edited)

It would be nice to sort out any issues beforehand.

Dan

Edited by Dan Cole
issues

Share this post


Link to post
Share on other sites
3 hours ago, Dan Cole said:

What are the issues?  It is about to become an osC offered download so if there are any problems it would be good to get them sorted out.

Dan

Have to agree with @Dan Cole that any errors should be sorted out before anything is released as official otherwise there will be complaints that something is not right and should have been sorted out first. Saying that as Frozen was once Edge someone may have mentioned these errors before so there has been time to get them corrected.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Certainly, you don't want to release something with known serious errors, but as a practical matter you can't get rid of every single bug, nor can you find every possible bug. You have to choose between getting something decent out to market in a reasonable time, and releasing something perfect years from now (don't worry, someone will find a bug immediately!).

If this is Edge being released as a sanctioned branch (i.e., not the official osC release), well, that's almost useless. If it's not an official 2.3.5 or whatever, the server distributions (Softaculous, etc.) will never pick it up, and osC will continue to suffer under the 2.3.4.1 official release.

Share this post


Link to post
Share on other sites

I think we will have to wait and see what happens in the near future. I think we could all agree that it cant be any worse than what is currently officially available.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

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

×