Submit
Path:
~
/
home
/
caidadmin
/
dev.laurels.sca-caid.org
/
wp-admin
/
includes
/
File Content:
class-ftp-sockets.php
<?php /** * PemFTP - An Ftp implementation in pure PHP * * @package PemFTP * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ /** * Socket Based FTP implementation * * @package PemFTP * @subpackage Socket * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link https://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html * @license LGPL https://opensource.org/licenses/lgpl-license.html */ class ftp_sockets extends ftp_base { function __construct($verb=FALSE, $le=FALSE) { parent::__construct(true, $verb, $le); } // <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- --> function _settimeout($sock) { if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } return true; } function _connect($host, $port) { $this->SendMSG("Creating socket"); if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); return FALSE; } if(!$this->_settimeout($sock)) return FALSE; $this->SendMSG("Connecting to \"".$host.":".$port."\""); if (!($res = @socket_connect($sock, $host, $port))) { $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } $this->_connected=true; return $sock; } function _readmsg($fnction="_readmsg"){ if(!$this->_connected) { $this->PushError($fnction,'Connect first'); return FALSE; } $result=true; $this->_message=""; $this->_code=0; $go=true; do { $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ); if($tmp===false) { $go=$result=false; $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock))); } else { $this->_message.=$tmp; $go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs); } } while($go); if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; $this->_code=(int)$regs[1]; return $result; } function _exec($cmd, $fnction="_exec") { if(!$this->_ready) { $this->PushError($fnction,'Connect first'); return FALSE; } if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); if($status===false) { $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); return FALSE; } $this->_lastaction=time(); if(!$this->_readmsg($fnction)) return FALSE; return TRUE; } function _data_prepare($mode=FTP_ASCII) { if(!$this->_settype($mode)) return FALSE; $this->SendMSG("Creating data socket"); $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($this->_ftp_data_sock < 0) { $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); return FALSE; } if(!$this->_settimeout($this->_ftp_data_sock)) { $this->_data_close(); return FALSE; } if($this->_passive) { if(!$this->_exec("PASV", "pasv")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } else $this->_ftp_temp_sock=$this->_ftp_data_sock; } else { if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { $this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); $this->_data_close(); return FALSE; } if(!@socket_bind($this->_ftp_data_sock,$addr)){ $this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_listen($this->_ftp_data_sock)) { $this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } } return TRUE; } function _data_read($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } } while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) { if($block==="") break; if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); else $out.=$block; } return $out; } function _data_write($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return false; } } if(is_resource($fp)) { while(!feof($fp)) { $block=fread($fp, $this->_ftp_buff_size); if(!$this->_data_write_block($mode, $block)) return false; } } elseif(!$this->_data_write_block($mode, $fp)) return false; return true; } function _data_write_block($mode, $block) { if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); do { if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) { $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } $block=substr($block, $t); } while(!empty($block)); return true; } function _data_close() { @socket_close($this->_ftp_temp_sock); @socket_close($this->_ftp_data_sock); $this->SendMSG("Disconnected data from remote host"); return TRUE; } function _quit() { if($this->_connected) { @socket_close($this->_ftp_control_sock); $this->_connected=false; $this->SendMSG("Socket closed"); } } } ?>
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
includes
---
0755
admin-filters.php
6740 bytes
0644
admin.php
3556 bytes
0644
ajax-actions.php
146997 bytes
0644
bookmark.php
11713 bytes
0644
class-automatic-upgrader-skin.php
3667 bytes
0644
class-bulk-plugin-upgrader-skin.php
2065 bytes
0644
class-bulk-theme-upgrader-skin.php
2099 bytes
0644
class-bulk-upgrader-skin.php
5568 bytes
0644
class-core-upgrader.php
15006 bytes
0644
class-custom-background.php
20810 bytes
0644
class-custom-image-header.php
48113 bytes
0644
class-file-upload-upgrader.php
3384 bytes
0644
class-ftp-pure.php
5426 bytes
0644
class-ftp-sockets.php
8475 bytes
0644
class-ftp.php
27203 bytes
0644
class-language-pack-upgrader-skin.php
2477 bytes
0644
class-language-pack-upgrader.php
14922 bytes
0644
class-pclzip.php
196717 bytes
0644
class-plugin-installer-skin.php
11864 bytes
0644
class-plugin-upgrader-skin.php
3277 bytes
0644
class-plugin-upgrader.php
21462 bytes
0644
class-theme-installer-skin.php
12496 bytes
0644
class-theme-upgrader-skin.php
4085 bytes
0644
class-theme-upgrader.php
24343 bytes
0644
class-walker-category-checklist.php
4870 bytes
0644
class-walker-nav-menu-checklist.php
5629 bytes
0644
class-walker-nav-menu-edit.php
13200 bytes
0644
class-wp-ajax-upgrader-skin.php
3613 bytes
0644
class-wp-application-passwords-list-table.php
6847 bytes
0644
class-wp-automatic-updater.php
50605 bytes
0644
class-wp-comments-list-table.php
30893 bytes
0644
class-wp-community-events.php
18465 bytes
0644
class-wp-debug-data.php
60175 bytes
0644
class-wp-filesystem-base.php
23303 bytes
0644
class-wp-filesystem-direct.php
16641 bytes
0644
class-wp-filesystem-ftpext.php
20140 bytes
0644
class-wp-filesystem-ftpsockets.php
16886 bytes
0644
class-wp-filesystem-ssh2.php
22013 bytes
0644
class-wp-importer.php
7415 bytes
0644
class-wp-internal-pointers.php
4550 bytes
0644
class-wp-links-list-table.php
8448 bytes
0644
class-wp-list-table-compat.php
1497 bytes
0644
class-wp-list-table.php
41536 bytes
0644
class-wp-media-list-table.php
24445 bytes
0644
class-wp-ms-sites-list-table.php
20896 bytes
0644
class-wp-ms-themes-list-table.php
27720 bytes
0644
class-wp-ms-users-list-table.php
14679 bytes
0644
class-wp-plugin-install-list-table.php
23869 bytes
0644
class-wp-plugins-list-table.php
49591 bytes
0644
class-wp-post-comments-list-table.php
1472 bytes
0644
class-wp-posts-list-table.php
60387 bytes
0644
class-wp-privacy-data-export-requests-list-table.php
5535 bytes
0644
class-wp-privacy-data-removal-requests-list-table.php
5692 bytes
0644
class-wp-privacy-policy-content.php
32286 bytes
0644
class-wp-privacy-requests-table.php
13802 bytes
0644
class-wp-screen.php
37028 bytes
0644
class-wp-site-health-auto-updates.php
13346 bytes
0644
class-wp-site-health.php
92103 bytes
0644
class-wp-site-icon.php
6195 bytes
0644
class-wp-terms-list-table.php
19604 bytes
0644
class-wp-theme-install-list-table.php
15742 bytes
0644
class-wp-themes-list-table.php
10189 bytes
0644
class-wp-upgrader-skin.php
6468 bytes
0644
class-wp-upgrader-skins.php
1477 bytes
0644
class-wp-upgrader.php
36729 bytes
0644
class-wp-users-list-table.php
18444 bytes
0644
comment.php
6068 bytes
0644
continents-cities.php
20468 bytes
0644
credits.php
5937 bytes
0644
dashboard.php
66227 bytes
0644
deprecated.php
40963 bytes
0644
edit-tag-messages.php
1478 bytes
0644
export.php
23954 bytes
0644
file.php
89023 bytes
0644
image-edit.php
36437 bytes
0644
image.php
38158 bytes
0644
import.php
6654 bytes
0644
list-table.php
3349 bytes
0644
media.php
117543 bytes
0644
menu.php
9151 bytes
0644
meta-boxes.php
63722 bytes
0644
misc.php
44032 bytes
0644
ms-admin-filters.php
1376 bytes
0644
ms-deprecated.php
3031 bytes
0644
ms.php
34155 bytes
0644
nav-menu.php
46748 bytes
0644
network.php
25119 bytes
0644
noop.php
1086 bytes
0644
options.php
4129 bytes
0644
plugin-install.php
34564 bytes
0644
plugin.php
88600 bytes
0644
post.php
77678 bytes
0644
privacy-tools.php
33460 bytes
0644
revision.php
16141 bytes
0644
schema.php
42059 bytes
0644
screen.php
6355 bytes
0644
taxonomy.php
8281 bytes
0644
template.php
94090 bytes
0644
theme-install.php
6586 bytes
0644
theme.php
46296 bytes
0644
translation-install.php
8870 bytes
0644
update-core.php
64203 bytes
0644
update.php
34939 bytes
0644
upgrade.php
109416 bytes
0644
user.php
20490 bytes
0644
widgets.php
10793 bytes
0644
N4ST4R_ID | Naxtarrr