Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param string $message
  * @param Profile $profile
  */
 public function __construct($message, Profile $profile = null)
 {
     if ($profile instanceof Profile) {
         $message = '[' . $profile->getLogin() . '@' . $profile->getAddress() . ':' . $profile->getPort() . '] ' . $message;
     } else {
         $message = '[No profile specified] ' . $message;
     }
     parent::__construct($message);
 }
Ejemplo n.º 2
0
 /**
  * Return new connection
  *
  * @param string $address
  * @param string $login
  * @param string $password
  * @param int $port
  * @param boolean $autoConnect
  * @return EntityConnection
  */
 public function connect($address, $login, $password, $port = 22, $autoConnect = true)
 {
     $profile = new Profile();
     $profile->setAddress($address);
     $profile->setLogin($login);
     $profile->setPassword($password);
     $profile->setPort($port);
     return new EntityConnection($profile, $autoConnect);
 }