← Back to team overview

phpdevshell team mailing list archive

Re: [Question #210689]: Is there a more detailed tutorial for how to use the upgrade feature of a plugin

 

Question #210689 on PHPDevShell changed:
https://answers.launchpad.net/phpdevshell/+question/210689

    Status: Open => Answered

TitanKing proposed the following answer:
Hi tad, sorry for the late reply, I am going to try and explain it as
simple as I can.

There are 2 completely separate parts to an upgrade, the first part
would be simple SQL queries updated through the plugin XML file as you
have noted in the example plugin. This part is really simple  it
compares the plugins database version in table "plugin_activation" with
the xml version of <install version="3003">, it will then run all the
query groups in <upgrade version="3001"> until it reaches 3003 for
instance. Note that the content contained inside the tags of <install
version="3003"> is for install only, this sql queries best be kept up to
date for fresh installs.

So how this will happen is, say for instance I download the latest
version of your plugin (104) while I was running (100). I now override
the old plugins content. So if I view the plugin manager it will show an
upgrade is available seeing that my version <install version="104"> in
the new plugin content is newer than what is in the database table
marked as (100). So as soon as I hit upgrade it will run all the queries
in the 101,102,103,104 upgrade groups.

-------------------------------------

While this is all good, there is one more aspect allowing an option to
upgrade remotely. First of all, we dont give write permissions to all
writable folders like many other projects do, we believe this is a major
security risk. So instead, the file is downloaded to tmp/ directory and
then using FTP overwriting the old plugin. So this mean your local FTP
server needs to be working, you can set the settings in the General
Settings options. However, until we have a smoother working system, I do
recommend manually updating the plugins as it probably amounts to the
same degree of work.

You will note that the  <versionurl current="11"> is independent, that
is just a number to compare to the online source to tell the local url
version that a newer one is available.

I hope this clears things up slightly.

-- 
You received this question notification because you are a member of
PHPDevShell, which is an answer contact for PHPDevShell.