Ejemplo n.º 1
0
 public function __construct(DBConnection $conn, $packageName, $configKey, $remote = false)
 {
     parent::__construct($conn, $packageName, $configKey, $remote);
     $this->objectType = 'PACKAGE';
     $this->packageBody = new PackageBody($conn, $packageName, $configKey, $remote);
 }
Ejemplo n.º 2
0
 public function __construct(DBConnection $conn, $packageName, $parentConfigKey, $remote = false)
 {
     parent::__construct($conn, $packageName, $parentConfigKey, $remote);
     $this->objectType = 'PACKAGE BODY';
 }
Ejemplo n.º 3
0
 public function __construct($type, $args)
 {
     if (!function_exists('ssh2_connect')) {
         throw new Exception('SSH2 is required to use an ssh connection. Try `pecl install channel://pecl.php.net/ssh2-0.11.3`');
     }
     parent::__construct($type, $args);
     foreach (self::$arglist as $arg) {
         if (!isset($this->args[$arg])) {
             throw new Exception("SSH Source requires '{$arg}' to be set");
         }
     }
     list($host, $port) = explode(':', $this->args['ssh-server']) + array('localhost', '22');
     if (!($this->connection = ssh2_connect($host, (int) $port))) {
         throw new Exception('Cannot connect to server');
     }
     if (!ssh2_auth_pubkey_file($this->connection, $this->args['ssh-user'], $this->args['ssh-pubkey'], $this->args['ssh-privkey'])) {
         throw new Exception('Autentication rejected by server');
     }
     if (VERBOSE) {
         notice('Connected to SSH server as `' . trim($this->exec('whoami')) . '`. Server time is ' . trim($this->exec('date')));
     }
 }
Ejemplo n.º 4
0
 public function __construct(DBConnection $conn, $functionName, $configKey, $remote = false)
 {
     parent::__construct($conn, $functionName, $configKey, $remote);
     $this->objectType = 'PROCEDURE';
 }