Project:Plugin Manager
Version:6.x-1.9
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active

Issue Summary

Before I installed the php ftp module, (so ftp_connect was not found, and ftp_plugin_manager_copy_wrapper() was used), installs worked OK, but updates did not seem to actually update. I noticed that one update created some new files, so guessed existing files were not being overwritten.

I added this to remove files before copying the new ones in ftp.backend.inc:
if (file_exists( $ftp_path/$file )) {
unlink( "$ftp_path/$file" );
}
above the
@copy($extract_dir . $file, "$ftp_path/$file");
in ftp_plugin_manager_copy_wrapper().

Upgrades then worked, but on my server the "file_exists" line cause division by zero errors, so this isn't a good solution.

Comments

#1

Priority:normal» critical

We really should uninstall before try to reinstall. Thanks for point that out!

#2

rallycivic,

Thank you for posting that code. You may find (as I did) that using "is_file" instead of "file_exists" will solve your problem:

if (is_file( $ftp_path/$file )) {
unlink( "$ftp_path/$file" );
}

#3

Subscribing.