Example #1
0
 /**
  * @param $username
  * @param string $password
  * @param string $emailAddress
  */
 public function __construct($username, $password = '', $emailAddress = '')
 {
     parent::__construct();
     $this->username = $username;
     $this->password = $password;
     $this->emailAddress = $emailAddress;
 }
Example #2
0
 /**
  * Destroy any temporary private keys used in connecting to a host
  */
 public function __destruct()
 {
     parent::__destruct();
     if (!empty($this->privateKeyPath) && strpos($this->privateKeyPath, BUILD_TMP_DIR) !== FALSE && is_file($this->privateKeyPath)) {
         unlink($this->privateKeyPath);
     }
 }
Example #3
0
 /**
  * @param Account $account
  * @param string $dbName
  * @param Host $host
  * @param int $dbPort
  */
 public function __construct($dbName, Account $account, Host $host = NULL, $dbPort = 3306)
 {
     parent::__construct();
     $this->dbName = $dbName;
     $this->account = $account;
     $this->host = $host;
     $this->port = $dbPort;
 }
Example #4
0
 /**
  * @param $id
  * @param $baseUrl
  * @param $baseUri
  * @param Account $account
  */
 public function __construct($id, $baseUrl, $baseUri, Account $account)
 {
     parent::__construct();
     // Set params
     $this->id = $id;
     $this->dir = new Dir(BUILD_WORKING_COPY_DIR . "/{$this->id}/");
     $this->repoBaseUri = rtrim($baseUri, '/');
     $this->repoBaseUrl = rtrim($baseUrl, '/');
     $this->repoUrl = $this->repoBaseUrl . $this->repoBaseUri;
     $this->account = $account;
 }
Example #5
0
 /**
  * @param $dirName
  * @param Host $host
  */
 public function __construct($dirName, Host $host = NULL)
 {
     parent::__construct();
     // Establish if the path is a windows path or not
     $this->isWinDir = mb_substr($dirName, 1, 1) === ':';
     $this->name = $dirName;
     // Try to clean up the path a bit
     if ($this->isWinDir) {
         $this->path = str_replace('/', '\\', $this->name);
         $this->path = preg_replace("/[\\\\]+/", '\\', $this->path);
         $this->path = trim($this->path, '\\') . '\\';
         $this->separator = '\\';
     } else {
         $this->path = str_replace('\\', '/', $this->name);
         $this->path = preg_replace('/[\\/]+/', '/', $this->path);
         $this->path = rtrim($this->path, '/') . '/';
         $this->separator = '/';
     }
     $this->host = $host;
 }
Example #6
0
 /**
  * Prompt the user to select a working copy
  * @param string $promptText
  * @return mixed
  */
 public static function promptWorkingCopy($promptText = 'Choose a working copy:')
 {
     $choices = array();
     $workingCopies = Entity::getList('WorkingCopy');
     foreach ($workingCopies as $index => $wc) {
         /** @var $wc \Cogeco\Build\Entity\WorkingCopy */
         $choices[] = $wc->id;
     }
     $selection = CliTask::promptMultipleChoice($choices, $promptText);
     return $workingCopies[$selection];
 }