Convert Wrapper class to ConsoleIO class
parent
f65b34860f
commit
a10f92aafe
@ -1,160 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Console\Helper;
|
||||
|
||||
use Composer\Console\Helper\WrapperInterface;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Helper\HelperInterface;
|
||||
|
||||
/**
|
||||
* Helper wrapper.
|
||||
*
|
||||
* @author François Pluchino <francois.pluchino@opendisplay.com>
|
||||
*/
|
||||
class Wrapper implements WrapperInterface
|
||||
{
|
||||
protected $input;
|
||||
protected $output;
|
||||
protected $helper;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param InputInterface $input The input instance
|
||||
* @param ConsoleOutputInterface $output The output instance
|
||||
* @param HelperInterface $helper The helper instance
|
||||
*/
|
||||
public function __construct(InputInterface $input, ConsoleOutputInterface $output, HelperInterface $helper = null)
|
||||
{
|
||||
$this->input = $input;
|
||||
$this->output = $output;
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
return $this->input;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setInput(InputInterface $input)
|
||||
{
|
||||
$this->input = $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setOutput(ConsoleOutputInterface $output)
|
||||
{
|
||||
$this->output = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getHelper()
|
||||
{
|
||||
return $this->helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setHelper(HelperInterface $helper)
|
||||
{
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function overwrite($messages, $size = 80, $newline = false, $type = 0)
|
||||
{
|
||||
for ($place = $size; $place > 0; $place--) {
|
||||
$this->getOutput()->write("\x08");
|
||||
}
|
||||
|
||||
$this->getOutput()->write($messages, false, $type);
|
||||
|
||||
for ($place = ($size - strlen($messages)); $place > 0; $place--) {
|
||||
$this->getOutput()->write(' ');
|
||||
}
|
||||
|
||||
// clean up the end line
|
||||
for ($place = ($size - strlen($messages)); $place > 0; $place--) {
|
||||
$this->getOutput()->write("\x08");
|
||||
}
|
||||
|
||||
if ($newline) {
|
||||
$this->getOutput()->writeln('');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function overwriteln($messages, $size = 80, $type = 0)
|
||||
{
|
||||
$this->overwrite($messages, $size, true, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function promptSilent($title = '')
|
||||
{
|
||||
// for windows OS
|
||||
if (preg_match('/^win/i', PHP_OS)) {
|
||||
$vbscript = sys_get_temp_dir() . '/prompt_password.vbs';
|
||||
file_put_contents($vbscript,
|
||||
'wscript.echo(Inputbox("' . addslashes($title) . '","'
|
||||
. addslashes($title) . '", ""))');
|
||||
$command = "cscript //nologo " . escapeshellarg($vbscript);
|
||||
$value = rtrim(shell_exec($command));
|
||||
unlink($vbscript);
|
||||
$this->getOutput()->writeln('');
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
// for other OS
|
||||
else {
|
||||
$command = "/usr/bin/env bash -c 'echo OK'";
|
||||
|
||||
if (rtrim(shell_exec($command)) !== 'OK') {
|
||||
throw new \RuntimeException("Can't invoke bash for silent prompt");
|
||||
}
|
||||
|
||||
$command = "/usr/bin/env bash -c 'read -s mypassword && echo \$mypassword'";
|
||||
$value = rtrim(shell_exec($command));
|
||||
$this->getOutput()->writeln('');
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Console\Helper;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Helper\HelperInterface;
|
||||
|
||||
/**
|
||||
* Helper wrapper interface.
|
||||
*
|
||||
* @author François Pluchino <francois.pluchino@opendisplay.com>
|
||||
*/
|
||||
interface WrapperInterface
|
||||
{
|
||||
/**
|
||||
* Returns an InputInterface instance.
|
||||
*
|
||||
* @return InputInterface "InputArgument", "InputOption", "InputDefinition"
|
||||
*/
|
||||
function getInput();
|
||||
|
||||
/**
|
||||
* Set an InputInterface instance.
|
||||
*
|
||||
* @param InputInterface $input The input
|
||||
*/
|
||||
function setInput(InputInterface $input);
|
||||
|
||||
/**
|
||||
* Returns an ConsoleOutput instance.
|
||||
*
|
||||
* @return ConsoleOutputInterface
|
||||
*/
|
||||
function getOutput();
|
||||
|
||||
/**
|
||||
* Set an ConsoleOutput instance.
|
||||
*
|
||||
* @param ConsoleOutputInterface $output The output
|
||||
*/
|
||||
function setOutput(ConsoleOutputInterface $output);
|
||||
|
||||
/**
|
||||
* Returns an HelperInterface instance.
|
||||
*
|
||||
* @return HelperInterface
|
||||
*/
|
||||
function getHelper();
|
||||
|
||||
/**
|
||||
* Set an HelperInterface instance.
|
||||
*
|
||||
* @param HelperInterface $helper The helper
|
||||
*/
|
||||
function setHelper(HelperInterface $helper);
|
||||
|
||||
/**
|
||||
* Overwrites a previous message to the output.
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $size The size of line
|
||||
* @param Boolean $newline Whether to add a newline or not
|
||||
* @param integer $type The type of output
|
||||
*/
|
||||
public function overwrite($messages, $size = 80, $newline = false, $type = 0);
|
||||
|
||||
/**
|
||||
* Overwrites a previous message to the output and adds a newline at the end.
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $size The size of line
|
||||
* @param integer $type The type of output
|
||||
*/
|
||||
public function overwriteln($messages, $size = 80, $type = 0);
|
||||
|
||||
/**
|
||||
* Interactively prompts for input without echoing to the terminal.
|
||||
*
|
||||
* @param string $title The title of prompt (used only for windows)
|
||||
*
|
||||
* @return string The value
|
||||
*/
|
||||
public function promptSilent($title = '');
|
||||
}
|
@ -0,0 +1,374 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\IO;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputDefinition;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||
use Symfony\Component\Console\Helper\HelperSet;
|
||||
|
||||
/**
|
||||
* The Input/Output helper.
|
||||
*
|
||||
* @author François Pluchino <francois.pluchino@opendisplay.com>
|
||||
*/
|
||||
class ConsoleIO implements IOInterface
|
||||
{
|
||||
protected $input;
|
||||
protected $output;
|
||||
protected $helperSet;
|
||||
protected $authentifications;
|
||||
protected $lastUsername;
|
||||
protected $lastPassword;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param InputInterface $input The input instance
|
||||
* @param ConsoleOutputInterface $output The output instance
|
||||
* @param HelperSet $helperSet The helperSet instance
|
||||
*/
|
||||
public function __construct(InputInterface $input, ConsoleOutputInterface $output, HelperSet $helperSet)
|
||||
{
|
||||
$this->input = $input;
|
||||
$this->output = $output;
|
||||
$this->helperSet = $helperSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getFirstArgument()
|
||||
{
|
||||
return $this->input->getFirstArgument();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function hasParameterOption($values)
|
||||
{
|
||||
return $this->input->hasParameterOption($values);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getParameterOption($values, $default = false)
|
||||
{
|
||||
return $this->input->getParameterOption($values, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function bind(InputDefinition $definition)
|
||||
{
|
||||
$this->input->bind($definition);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
$this->input->validate();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getArguments()
|
||||
{
|
||||
return $this->input->getArguments();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getArgument($name)
|
||||
{
|
||||
return $this->input->getArgument($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->input->getOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getOption($name)
|
||||
{
|
||||
return $this->input->getOption($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function isInteractive()
|
||||
{
|
||||
return $this->input->isInteractive();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getErrorOutput()
|
||||
{
|
||||
return $this->output->getErrorOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setErrorOutput(OutputInterface $error)
|
||||
{
|
||||
$this->output->setErrorOutput($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function write($messages, $newline = false, $type = 0)
|
||||
{
|
||||
$this->output->write($messages, $newline, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function writeln($messages, $type = 0)
|
||||
{
|
||||
$this->output->writeln($messages, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function overwrite($messages, $size = 80, $newline = false, $type = 0)
|
||||
{
|
||||
for ($place = $size; $place > 0; $place--) {
|
||||
$this->write("\x08");
|
||||
}
|
||||
|
||||
$this->write($messages, false, $type);
|
||||
|
||||
for ($place = ($size - strlen($messages)); $place > 0; $place--) {
|
||||
$this->write(' ');
|
||||
}
|
||||
|
||||
// clean up the end line
|
||||
for ($place = ($size - strlen($messages)); $place > 0; $place--) {
|
||||
$this->write("\x08");
|
||||
}
|
||||
|
||||
if ($newline) {
|
||||
$this->writeln('');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function overwriteln($messages, $size = 80, $type = 0)
|
||||
{
|
||||
$this->overwrite($messages, $size, true, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setVerbosity($level)
|
||||
{
|
||||
$this->output->setVerbosity($level);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getVerbosity()
|
||||
{
|
||||
return $this->output->getVerbosity();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
{
|
||||
$this->output->setDecorated($decorated);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function isDecorated()
|
||||
{
|
||||
return $this->output->isDecorated();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setFormatter(OutputFormatterInterface $formatter)
|
||||
{
|
||||
$this->output->setFormatter($formatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getFormatter()
|
||||
{
|
||||
return $this->output->getFormatter();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function ask($question, $default = null)
|
||||
{
|
||||
return $this->helperSet->get('dialog')->ask($this->output, $question, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function askConfirmation($question, $default = true)
|
||||
{
|
||||
return $this->helperSet->get('dialog')->askConfirmation($this->output, $question, $default);
|
||||
}
|
||||
|
||||
public function askAndValidate($question, $validator, $attempts = false, $default = null)
|
||||
{
|
||||
return $this->helperSet->get('dialog')->askAndValidate($this->output, $question, $validator, $attempts, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function askAndHideAnswer($question)
|
||||
{
|
||||
// for windows OS (does not hide the answer in the popup, but it never appears in the STDIN history)
|
||||
if (preg_match('/^win/i', PHP_OS)) {
|
||||
$vbscript = sys_get_temp_dir() . '/prompt_password.vbs';
|
||||
file_put_contents($vbscript,
|
||||
'wscript.echo(Inputbox("' . addslashes($question) . '","'
|
||||
. addslashes($question) . '", ""))');
|
||||
$command = "cscript //nologo " . escapeshellarg($vbscript);
|
||||
|
||||
$this->write($question);
|
||||
|
||||
$value = rtrim(shell_exec($command));
|
||||
unlink($vbscript);
|
||||
|
||||
for ($i = 0; $i < strlen($value); ++$i) {
|
||||
$this->write('*');
|
||||
}
|
||||
|
||||
$this->writeln('');
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
// for other OS with shell_exec (hide the answer)
|
||||
else if (rtrim(shell_exec($command)) === 'OK') {
|
||||
$command = "/usr/bin/env bash -c 'echo OK'";
|
||||
|
||||
$this->write($question);
|
||||
|
||||
$command = "/usr/bin/env bash -c 'read -s mypassword && echo \$mypassword'";
|
||||
$value = rtrim(shell_exec($command));
|
||||
|
||||
for ($i = 0; $i < strlen($value); ++$i) {
|
||||
$this->write('*');
|
||||
}
|
||||
|
||||
$this->writeln('');
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
// for other OS without shell_exec (does not hide the answer)
|
||||
$this->writeln('');
|
||||
|
||||
return $this->ask($question);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getLastUsername()
|
||||
{
|
||||
return $this->lastUsername;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getLastPassword()
|
||||
{
|
||||
return $this->lastPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getAuthentifications()
|
||||
{
|
||||
if (null === $this->authentifications) {
|
||||
$this->authentifications = array();
|
||||
}
|
||||
|
||||
return $this->authentifications;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function hasAuthentification($repositoryName)
|
||||
{
|
||||
$auths = $this->getAuthentifications();
|
||||
return isset($auths[$repositoryName]) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getAuthentification($repositoryName)
|
||||
{
|
||||
$auths = $this->getAuthentifications();
|
||||
return isset($auths[$repositoryName]) ? $auths[$repositoryName] : array('username' => null, 'password' => null);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setAuthentification($repositoryName, $username, $password = null)
|
||||
{
|
||||
$auths = $this->getAuthentifications();
|
||||
$auths[$repositoryName] = array('username' => $username, 'password' => $password);
|
||||
|
||||
$this->authentifications = $auths;
|
||||
$this->lastUsername = $username;
|
||||
$this->lastPassword = $password;
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\IO;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Helper\HelperSet;
|
||||
|
||||
/**
|
||||
* The Input/Output helper interface.
|
||||
*
|
||||
* @author François Pluchino <francois.pluchino@opendisplay.com>
|
||||
*/
|
||||
interface IOInterface extends InputInterface, ConsoleOutputInterface
|
||||
{
|
||||
/**
|
||||
* Overwrites a previous message to the output.
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $size The size of line
|
||||
* @param Boolean $newline Whether to add a newline or not
|
||||
* @param integer $type The type of output
|
||||
*/
|
||||
public function overwrite($messages, $size = 80, $newline = false, $type = 0);
|
||||
|
||||
/**
|
||||
* Overwrites a previous message to the output and adds a newline at the end.
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $size The size of line
|
||||
* @param integer $type The type of output
|
||||
*/
|
||||
public function overwriteln($messages, $size = 80, $type = 0);
|
||||
|
||||
/**
|
||||
* Asks a question to the user.
|
||||
*
|
||||
* @param string|array $question The question to ask
|
||||
* @param string $default The default answer if none is given by the user
|
||||
*
|
||||
* @return string The user answer
|
||||
*
|
||||
* @throws \RuntimeException If there is no data to read in the input stream
|
||||
*/
|
||||
public function ask($question, $default = null);
|
||||
|
||||
/**
|
||||
* Asks a confirmation to the user.
|
||||
*
|
||||
* The question will be asked until the user answers by nothing, yes, or no.
|
||||
*
|
||||
* @param string|array $question The question to ask
|
||||
* @param Boolean $default The default answer if the user enters nothing
|
||||
*
|
||||
* @return Boolean true if the user has confirmed, false otherwise
|
||||
*/
|
||||
public function askConfirmation($question, $default = true);
|
||||
|
||||
/**
|
||||
* Asks for a value and validates the response.
|
||||
*
|
||||
* The validator receives the data to validate. It must return the
|
||||
* validated data when the data is valid and throw an exception
|
||||
* otherwise.
|
||||
*
|
||||
* @param string|array $question The question to ask
|
||||
* @param callback $validator A PHP callback
|
||||
* @param integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
|
||||
* @param string $default The default answer if none is given by the user
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Exception When any of the validators return an error
|
||||
*/
|
||||
public function askAndValidate($question, $validator, $attempts = false, $default = null);
|
||||
|
||||
/**
|
||||
* Asks a question to the user and hide the answer.
|
||||
*
|
||||
* @param string $question The question to ask
|
||||
*
|
||||
* @return string The answer
|
||||
*/
|
||||
public function askAndHideAnswer($question);
|
||||
|
||||
/**
|
||||
* Get the last username entered.
|
||||
*
|
||||
* @return string The username
|
||||
*/
|
||||
public function getLastUsername();
|
||||
|
||||
/**
|
||||
* Get the last password entered.
|
||||
*
|
||||
* @return string The password
|
||||
*/
|
||||
public function getLastPassword();
|
||||
|
||||
/**
|
||||
* Get all authentification informations entered.
|
||||
*
|
||||
* @return array The map of authentification
|
||||
*/
|
||||
public function getAuthentifications();
|
||||
|
||||
/**
|
||||
* Verify if the repository has a authentification informations.
|
||||
*
|
||||
* @param string $repositoryName The unique name of repository
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasAuthentification($repositoryName);
|
||||
|
||||
/**
|
||||
* Get the username and password of repository.
|
||||
*
|
||||
* @param string $repositoryName The unique name of repository
|
||||
*
|
||||
* @return array The 'username' and 'password'
|
||||
*/
|
||||
public function getAuthentification($repositoryName);
|
||||
|
||||
/**
|
||||
* Set the authentification informations for the repository.
|
||||
*
|
||||
* @param string $repositoryName The unique name of repository
|
||||
* @param string $username The username
|
||||
* @param string $password The password
|
||||
*/
|
||||
public function setAuthentification($repositoryName, $username, $password = null);
|
||||
}
|
Loading…
Reference in New Issue