Hi developers,
I noticed when editing text first in language A and then in language B and logging out from language B that only the language B will get a backup.
What about implementing some counter ($de_edited=false; $en_edited=false; etc.) that would be set to true when any language got editied, and that on logout the counter would trigger the backup of the edited language contents.
Would have the additional benefit, that no superfluous backup would be triggered when I log in, do something in some plugin and log out without changing the content.htm.
Plugins like "logout_nobackup" wouldn't be needed any more.
Backup on logout of secondary languages
Re: Backup on logout of secondary languages
The counter(s) would have to be permanent, however, e.g. stored in a session variable or a file.svasti wrote:What about implementing some counter ($de_edited=false; $en_edited=false; etc.) that would be set to true when any language got editied, and that on logout the counter would trigger the backup of the edited language contents.
Another possibility would be to compare the current content file with the latest backup on logout; if they have the same contents, no backup is necessary. To keep the additional memory consumption low, we might use md5_file() to compare hashes of the files -- collisions are very rare, and even if they happen the "error" would just be a duplicate backup.
Anyway, making backups of all (modified) language contents on logout would be great.
PS: I've put it on the roadmap.
Last edited by cmb on Sun Jan 12, 2014 7:49 pm, edited 1 time in total.
Reason: added PS
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH
Re: Backup on logout of secondary languages
If you don't mind I'd specify the roadmap item to: On logout: check which language content was changed and backup only that.
I like to keep real backups instead of producing duplicates, expecially if checking a website of a friend or a customer. Would be nice to be able to get rid of the plugin "Logout_nobackup".
I like to keep real backups instead of producing duplicates, expecially if checking a website of a friend or a customer. Would be nice to be able to get rid of the plugin "Logout_nobackup".
Re: Backup on logout of secondary languages
We might divide it into two roadmap items.svasti wrote:If you don't mind I'd specify the roadmap item to: On logout: check which language content was changed and backup only that.
Logging out without making a backup might still be useful in some cases. OTOH this could easily be accomplished by an alternative admin menu extension or even by the user manually requesting ?logout=no_backup.svasti wrote:I like to keep real backups instead of producing duplicates, expecially if checking a website of a friend or a customer. Would be nice to be able to get rid of the plugin "Logout_nobackup".
Christoph M. Becker – Plugins for CMSimple_XH
Re: Backup on logout of secondary languages
Good idea!cmb wrote:Another possibility would be to compare the current content file with the latest backup on logout; if they have the same contents, no backup is necessary. To keep the additional memory consumption low, we might use md5_file() to compare hashes of the files -- collisions are very rare, and even if they happen the "error" would just be a duplicate backup.
Anyway, making backups of all (modified) language contents on logout would be great.
+1
Re: Backup on logout of secondary languages
Done (r1259-1261).
Christoph M. Becker – Plugins for CMSimple_XH