[wp-trac] Re: [WordPress Trac] #7690: Using SSH2 to upload
files/wordpress
WordPress Trac
wp-trac at lists.automattic.com
Sun Sep 7 01:41:11 GMT 2008
#7690: Using SSH2 to upload files/wordpress
-------------------------------------+--------------------------------------
Reporter: ShaneF | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.7
Component: Administration | Version: 2.7
Severity: normal | Resolution:
Keywords: ssh upgrade dev-testing |
-------------------------------------+--------------------------------------
Comment (by DD32):
> attachment 7690.7.diff added.
Merged shaneF's patch 7690.6.diff with my lot, Plugin upgrades now work
seemingly well, I tried a core update, But it just kept redirecting me
back to the credentials page.
Oh: It looks like i missed the changes ShaneF made to the update.php file
(wording changes mainly)
As for the trailing slashes: If the SSH functions cannot deal with a
slashed input, they should call untrailingslashit() or rtrim($s, '/')
rather than the main code being changed, Part of the abstraction is to
allow quirks of the filesystem method to be dealt with within the classes.
The same goes with a few functions in ShaneF's patch, I changed some
params to keep it in line with the rest of the classes.
I also optimized unzip_file() a bit, Yes, The loops probably look hard to
read at first, But put simply:[[BR]]
Rather than starting at / and working through to /home/username/ to check
if the folders exist (Time consuming), it starts at /...../wordpress/wp-
content/plugins/folder/ and works backwards to wp-content/plugins, then
wp-content, etc. Once it finds a folder that exists, it works back up
towards where the folder is wanted and creates them. SSH can do a
recursive create, however the FTP/direct classes cannot, so its best just
to leave that functionality out of it and do it via PHP.
I removed the Port specification from the credentials page though, Not
many people need to set that, and having to change it when switching to
FTP was a pain, Instead, I changed it to allow the hostname to be set like
'dd32.id.au:9984' for port 9984.
Theres a bit of an issue of the connection_type radio selection not
sticking.. It keeps reverting to ftp.
--
Ticket URL: <http://trac.wordpress.org/ticket/7690#comment:25>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list