X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Upgrade made easy (https://forum.x-cart.com/showthread.php?t=4653)

funkydunk 10-07-2003 01:41 AM

Upgrade made easy
The biggest fall down in upgrading is the time to set file permissions - this will make it easier.

change skin1/admin/main/patch_apply.tpl to:


{include file="location.tpl" last_location="Applying patch"}
{capture name=dialog}
{if $patch_type eq "upgrade" and $patch_phase ne "upgrade_final"}


{$patch_exe.patch_exe} ...
{if $patch_exe.status eq "OK"}
[<font color="green">OK</font>]
[<font color="red">{$patch_exe.status}</font>]


{section name=result_line loop=$integrity_result}
{$integrity_result[result_line].filename} ...
{if $integrity_result[result_line].status eq "OK"}
[<font color="green">OK</font>]
[<font color="red">{$integrity_result[result_line].status}</font>]


{if $patch_type eq "text" or ($patch_type eq "upgrade" and $patch_phase ne "upgrade_final")}

{section name=file loop=$all_files_to_patch}
{$all_files_to_patch[file].filename} ...
{if $all_files_to_patch[file].status eq "OK"}
[<font color="green">OK</font>]
[<font color="red">{$all_files_to_patch[file].status}</font>]


IMPORTANT: It is recommended to backup these files.

{if !empty($files_to_patch)}

Copy this contents below and paste (right-click)into ssh whilst you are within the xcart directory
<textarea cols=60 rows=10>
{section name=file loop=$files_to_patch}
chmod 666 {$files_to_patch[file]}
{if $confirm_patch ne "" and $patch_phase ne "upgrade_final"}
<FORM action="patch.php" method=POST>
<INPUT type=hidden name=mode value={$smarty.post.mode}>
Patch text:

<TEXTAREA cols=60 rows=10>{$patch_text|escape:"htmlall"}</TEXTAREA>

<INPUT type=hidden name=patch_filename value="{$patch_filename}">
<INPUT type=hidden name=reverse value="{$reverse}">
<INPUT type=hidden name=confirmed value=Y>
<INPUT type=button value="<< Go back" onClick="history.go(-1)">

<INPUT type=submit value="Continue >>">
{if !empty($files_to_patch)}
After applying a patch please set the original permissions on changed files.
{elseif $smarty.post.confirmed ne ""}

{if $patch_phase eq "upgrade_final"}

{section name=file loop=$patch_files}
{$patch_files[file].orig_file} ... [{$patch_files[file].status}]



{section name=line loop=$patch_result}



{section name=line loop=$patch_log}


{section name=line loop=$patch_result}

<FORM action="patch.php" method=get>
<INPUT type=submit value="Finish >>">
{include file="dialog.tpl" title="Applying patch" content=$smarty.capture.dialog

This will then produce a nice easy section in a text area to cut and paste into ssh or telnet or ftp manager to set all the file permissions in one go.

lildawg 10-07-2003 10:06 AM

Thanks for the great ap.

jpsowin 10-07-2003 10:38 AM

You da man!
I normally just 777 the whole skin files, then set them back real quick. This is better ;)

adpboss 10-07-2003 02:32 PM

What FTP application would you guys recommend using with this?

I use WS FTP Pro but I can't figure out how to paste a whack of CHMOD commands in.

FYI, I'm a Windows user.

funkydunk 10-07-2003 02:41 PM

i use this with ssh (putty) to linux servers from a win xp pro.

not sure about ftp for this - can do this in cute ftp by defining a custom command then running

adpboss 10-07-2003 03:25 PM

Forgive my ignorance.

What is Putty?

DogByteMan 10-07-2003 03:37 PM

It's sort of like a user interface for SSH. Kind of like a FTP client program.

jpsowin 10-07-2003 04:05 PM

you can only use puTTY if you have SSH/Telnet access to the server... which I would always recommend getting a host where you have that. X-Cart would be a nightmare for me if I didn't have shell access! ;)

dealsondeals 10-07-2003 06:43 PM

:D Sweet! I really like this one. Keep up the good work!

groovico 10-07-2003 06:49 PM

:D That's class that is, kudos funky!

B00MER 10-09-2003 07:02 AM

Could always take it one step further and generate the chmod BEFORE you set them all to chmod 666, that way reverting back would be easier :)

:arrow: http://www.php.net/manual/en/function.fileperms.php

Might take a bit of work in admin/patch.php, but would be nice to have, to go along with the writeable permissions ;)

Kudos as always to funky for a must needed addition to the patch/upgrade process.

And if you don't have SSH access to your server, I'd suggest learning some basic commands, or easiest, send the chmod list to your hosting provider.

:arrow: http://www.linuxhelp.net/newbies/

groovico 10-15-2003 03:53 PM

And Putty for anyone who doesnt have it.


shasan 10-28-2003 10:53 PM

Putty Rules! highly recommended for all your command line needs.

bluecat 11-11-2003 01:38 PM

Is there an FTP program that I can use this with? I'm using WS_FTP Pro, but not sure if there's a way to it that particlur one. Or can someone explain how to do it the other ways. Thank you.

DogByteMan 11-11-2003 01:57 PM


First you have to go through the hassle of getting SSH rights on your server. They usually want you to fax a copy of your drivers license or such. Then go and get the program PUTTY (search it on google). SSH is a server command line situation, so make sure you study up on it first.

bluecat 11-11-2003 02:24 PM

Thanks DB, was hoping for the easy way. :lol: :?

B00MER 12-15-2003 11:04 PM

Just noted a unix shell command that makes changing permissions a breeze ;)

Set to writeable permissions:


for i in `sed -e 's/,.*$//g' < upgrade/3.4.9-3.5.0/file.lst`; do chmod 666 $i ; done

Set back to non-writeable permissions: (after upgrade is done)


for i in `sed -e 's/,.*$//g' < upgrade/3.4.9-3.5.0/file.lst`; do chmod 644 $i ; done
:!: NOTE: this command is being ran from the xcart/ install dir, where upgrade/ is a subdir.

Replace the directory names in upgrade/3.4.9-3.5.0/ to the proper versions, and each file in the file.lst will be set to chmod 666 for writeable permissions.

Kudos! :wink:

leon 12-16-2003 04:15 AM

Thanks for that, Im learning SSH myself, and yes, it does give you a much better control over the environment, the whole server environment to be exact (has to be manipulated with care).

All times are GMT -8. The time now is 12:39 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.