Forums / All Other Contributions/Addons / 3rd party contributions overwriting core files

3rd party contributions overwriting core files

Locked

Views: 2,195

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
29 Nov 2006, 4:08 PM
#1
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

3rd party contributions overwriting core files

Hello!

As I come up to speed on ZC and 3rd part contributions, I have a question, I have learned and with great care installed override folders and files.

As I begin to install some contributions, I see this in the read me's:

"Copy the "admin" folder to your zencart root folder. This will
overwrite admin/index.php and admin/customers.php, and add new
files."

Does the mean, it will overwrite the other contributions already installed? and what about the next install, perhaps over the same files?

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

29 Nov 2006, 4:14 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: 3rd party contributions overwriting core files

Hi Dharma.

At the present there is no real over rides for the admin,

so Yes if oyu have 2 seperate contribs that will over write admin/index.php
you need to do a winmerge on them and make sure that you get the relevent code for each one in place,

make sure to not the changes so that when you upgrade ZC you can easily put the changes BACK into the new admin/index.php

Zen cart PCI compliant Hosting

29 Nov 2006, 4:43 PM
#3
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: 3rd party contributions overwriting core files

Hello!

Thank you for your response. I will take careful note of admin files being added to existing core files, what about files in other directories?

I uploaded "Zen Cart Template base" and it placed handy override folders in my ZC directories. if I do not see a custom folder from this contribution, in a directory, that means I must merge the files correct? ex: includes/functions/

also I checked out winmerge, looks like its windows only, is there a mac version or other app for mac? perhaps bbedit? that I can use?

Thanks!

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

29 Nov 2006, 11:18 PM
#4
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: 3rd party contributions overwriting core files

Hello!

Thank your for your help and putting up with my lack of knowledge. I found that BBedit can compare two files.

does it matter where I place the additional code? always at the end, or where the 2 files differ (lines 88-110)

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

29 Nov 2006, 11:49 PM
#5
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: 3rd party contributions overwriting core files

the changes need to be where they are listed at in the contrib file,

the code has to be right where it is for it to work right

Zen cart PCI compliant Hosting

2 Dec 2006, 10:34 PM
#6
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: 3rd party contributions overwriting core files

Hello again and thank you for your time and support.

When it comes to over writing/backing up core files, is it possible to simply rename older versions and keep them on the server?

for example:

original file : admin/index.php

I add a code and make new admin/index.php

original file becomes : admin/index_clean_1.3.6.php

and so on: admin/index_clean_1.3.6+IH2.php

What would be the proper extension? .bak? .php.bak? something else?

Would that mess things up? create a security risk? Is this a ridiculously bad idea? :bangin: if so what would you suggest?

My computer is a disorganized mess. I would like to keep all my ZC files on the server and back them up on my computer as one ZC Folder, maybe clean up the folders after zc upgrades.

what do you think?

Thanks again!

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

2 Dec 2006, 11:04 PM
#7
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: 3rd party contributions overwriting core files

Sometimes keeping the renamed files in the same directory is ok, but other times not. I do not know of a definitive resource which specifies which explains this. I've just learned by trial and error.

It is best practice to test your custom edits/changes and mod installs on a test/non-production shop and best to back up your files regularly locally. Myself I make my edits/merges locally then upload to the server. Otherwise I would find it difficult to maintain track of my revisions and customizations.

In the zen cart downloads area look for the document "Overrides Chart" which may help you identify where "custom" override directories can exist. And lots of similar info in the zen cart support wiki.

Woody

3 Dec 2006, 8:07 AM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: 3rd party contributions overwriting core files

Woodymon:

In the zen cart downloads area look for the document "Overrides Chart" which may help you identify where "custom" override directories can exist.

The presence of a "classic" directory is also a good clue.

Woodymon's suggestion of a test cart is good advice, to which I would add, "keep a change log."
If you follow practices like this, your changes and upgrades will go more smoothly.

Good luck,
Scott

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Dec 2006, 8:14 AM
#9
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: 3rd party contributions overwriting core files

regarding renaming the original files.. you have to watch out what you rename it to. depending on the folder it may try to include that file even though you don't want it to

the best way to do it, from my experience, is to add an extension after the .php. so something like .php.bak or something. this ensures it cannot be executed - be careful with what you do this to because even though it cannot be executed, it can be read plain as day. don't do it to configure files :)