Пример #1
0
 /**
  * Should return an array of mapped fields to use in the MAL_Model_MapperAbstract::Save function
  * @param GD_Model_Server $obj
  */
 protected function getSaveData($obj)
 {
     $crypt = new GD_Crypt();
     $encrypted_pwd = $crypt->doEncrypt($obj->getPassword());
     $data = array('name' => $obj->getName(), 'hostname' => $obj->getHostname(), 'connection_types_id' => $obj->getConnectionTypesId(), 'port' => $obj->getPort(), 'username' => $obj->getUsername(), 'password' => $encrypted_pwd, 'remote_path' => $obj->getRemotePath(), 'projects_id' => $obj->getProjectsId());
     return $data;
 }
Пример #2
0
 public function __construct(GD_Model_Server $server)
 {
     $this->_hostname = $server->getHostname();
     $this->_username = $server->getUsername();
     $this->_password = $server->getPassword();
     $this->_port = $server->getPort() ? $server->getPort() : 21;
     $this->_remote_path = $server->getRemotePath();
 }
Пример #3
0
 /**
  * Generate a new GD_Ftp instance based on a GD_Model_Server object
  *
  * @param GD_Model_Server $server
  * @return GD_Ftp
  */
 public static function FromServer(GD_Model_Server $server)
 {
     return new GD_Ftp($server->getHostname(), $server->getUsername(), $server->getPassword(), $server->getRemotePath(), $server->getPort() ? $server->getPort() : 21);
 }