Jump to content

phpVMS Update Script


Nabeel

Recommended Posts

  • Administrators

Here's a quick bash script to update phpVMS to the latest version. It'll download the update version from the server, unzip it, delete the local.config.php, and then copy the files to where phpVMS is located.

You need SSH access to your server (ask your host). You can either download the zip file, and extract the file to your server, or use vi, whatever to create this script:

NOTE: The download URL has changed

#!/bin/bash

PHPVMS_PATH="/path/to/phpvms"

echo "Retrieving update"
rm phpvms.update.zip
wget --no-cache --no-clobber http://downloads.phpvms.net/phpvms.update.zip
rm -drf phpvms
echo "Unzipping file"
unzip -q phpvms.update.zip
rm -f phpvms/core/local.config.php
echo "Copying files"
cp -rf phpvms/* $PHPVMS_PATH
echo "Done!"

The only thing you need to do is change the PHPVMS_PATH (no trailing slash!). If you download the zip file, open the file in Wordpad (notepad will screw up the line endings), and change that path to where phpVMS is located.

I recommend placing it in it's own directory.

So upload the file (updatephpvms, no file extension)

Then give execute permissions, and execute:

chmod +x updatephpvms
./updatephpvms

After this, you still need to run the /install/update.php, but at least the bottleneck of downloading and then uploading via FTP is gone.

Nabeel

updatephpvms.zip

Link to comment
Share on other sites

  • Administrators

I am looking into it, may be difficult though, since there are alot of factors, including OS (wget, unzip, unavailable or differe from one system to another), host settings for external url fopen() etc, but I'm going to look into it

Link to comment
Share on other sites

I am looking into it, may be difficult though, since there are alot of factors, including OS (wget, unzip, unavailable or differe from one system to another), host settings for external url fopen() etc, but I'm going to look into it

Nabeel,

If you want my opinion, I think that will be good have a autoupdate system but you have reason, so, there are many problems in the integration with the many popular hostings so sometimes for example, the simple php parameter "register_globals" is OFF or ON and the hosting providers won't change it.. So it's some difficult. But well... as you says go to look into it. So, will be a fantastic feature have a autoupdate. Maybe you will do a upload system to load the .zip file into the system and then that the website make the job extracting the zip file and replacing the content. So, if you find the Joomla example or SMF Forum, or something else CMS, they have a funcion that when you upload a, for example template, the system installs it into the directory.

Maybe this will be the solution ;)

Cheers,

Link to comment
Share on other sites

  • 2 weeks later...
  • Administrators

I will have a look. It's difficult. In respect to PHP settings, I code very conservatively, assuming that every "shortcut" option is off. I don't use register_globals either way.

That would be the way to do it, however ZIP handling differs greatly between OSs and PHP installs, some may have PECL zip extensions, some may not and have to use the OS. That will take some investigation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...