file2=$file2; $this->sXe = new SimpleXMLElement(file_get_contents($file2), LIBXML_NOEMPTYTAG); } public function modifyBuyer(){ $this->sXe->{"Order-Parties"}->Buyer->ILN='5909000837'; } public function saveFile(){ $content = $this->sXe->asXML(); file_put_contents($this->file2,str_replace('',"",$content)); } public function sendFile(){ $connection = ssh2_connect('crm.e5.pl', 22); ssh2_auth_password($connection, 'mz', '56!@HjU&3aZ'); $sftp = ssh2_sftp($connection); echo "przenosze plik ".$this->file2; ssh2_scp_send($connection, $this->file2, '/home/mz/'.uniqid().'.xml', 0775); } } /* $file2='/home/saas/orders/e5/MEDI_OR139781914.xml'; $ob = new orderEditor(); $ob->modifyBuyer(); $ob->saveFile(); $ob->sendFile(); echo 'skonczone';*/ ?>