main
Jordi Boggiano 11 years ago
parent 9a806658d6
commit 11a0d16ccc

@ -317,6 +317,7 @@ EOF;
return array(
$filesCode);
EOF;
}

@ -42,7 +42,7 @@ is to add the COMPOSER_HOME/vendor/bin dir to your PATH env var.
COMPOSER_HOME is c:\Users\<user>\AppData\Roaming\Composer on Windows
and /home/<user>/.composer on unix systems.
Note: This path may vary depending on customizations to bin-dir in
Note: This path may vary depending on customizations to bin-dir in
composer.json or the environmental variable COMPOSER_BIN_DIR.
EOT

@ -377,6 +377,7 @@ class Pool
if ($constraint === null) {
return self::MATCH;
}
return $constraint->matches(new VersionConstraint('==', $candidateVersion)) ? self::MATCH : self::MATCH_NAME;
}

@ -24,9 +24,9 @@ interface ChangeReportInterface
/**
* Checks for changes to the local copy
*
* @param PackageInterface $package package instance
* @param string $path package directory
* @return string|null changes or null
* @param PackageInterface $package package instance
* @param string $path package directory
* @return string|null changes or null
*/
public function getLocalChanges(PackageInterface $package, $path);
}

@ -45,12 +45,12 @@ class FileDownloader implements DownloaderInterface
/**
* Constructor.
*
* @param IOInterface $io The IO instance
* @param Config $config The config
* @param IOInterface $io The IO instance
* @param Config $config The config
* @param EventDispatcher $eventDispatcher The event dispatcher
* @param Cache $cache Optional cache instance
* @param RemoteFilesystem $rfs The remote filesystem
* @param Filesystem $filesystem The filesystem
* @param Cache $cache Optional cache instance
* @param RemoteFilesystem $rfs The remote filesystem
* @param Filesystem $filesystem The filesystem
*/
public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, RemoteFilesystem $rfs = null, Filesystem $filesystem = null)
{

@ -10,7 +10,6 @@
* file that was distributed with this source code.
*/
namespace Composer\Downloader;
use Composer\Package\PackageInterface;
@ -75,16 +74,17 @@ class PerforceDownloader extends VcsDownloader
public function getLocalChanges(PackageInterface $package, $path)
{
$this->io->write('Perforce driver does not check for local changes before overriding', true);
return;
}
/**
* {@inheritDoc}
*/
protected function getCommitLogs($fromReference, $toReference, $path)
{
$commitLogs = $this->perforce->getCommitLogs($fromReference, $toReference);
return $commitLogs;
}

@ -148,8 +148,8 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
* Prompt the user to check if changes should be stashed/removed or the operation aborted
*
* @param PackageInterface $package
* @param string $path
* @param bool $update if true (update) the changes can be stashed and reapplied after an update,
* @param string $path
* @param bool $update if true (update) the changes can be stashed and reapplied after an update,
* if false (remove) the changes should be assumed to be lost if the operation is not aborted
* @throws \RuntimeException in case the operation must be aborted
*/

@ -32,7 +32,7 @@ class Event
/**
* Constructor.
*
* @param string $name The event name
* @param string $name The event name
*/
public function __construct($name)
{

@ -202,7 +202,7 @@ class EventDispatcher
/**
* Retrieves all listeners for a given event
*
* @param Event $event
* @param Event $event
* @return array All listeners: callables and scripts
*/
protected function getListeners(Event $event)

@ -177,7 +177,7 @@ class Factory
* @param IOInterface $io IO instance
* @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will
* read from the default filename
* @param bool $disablePlugins Whether plugins should not be loaded
* @param bool $disablePlugins Whether plugins should not be loaded
* @throws \InvalidArgumentException
* @throws \UnexpectedValueException
* @return Composer
@ -432,7 +432,7 @@ class Factory
* @param IOInterface $io IO instance
* @param mixed $config either a configuration array or a filename to read from, if null it will read from
* the default filename
* @param bool $disablePlugins Whether plugins should not be loaded
* @param bool $disablePlugins Whether plugins should not be loaded
* @return Composer
*/
public static function create(IOInterface $io, $config = null, $disablePlugins = false)

@ -539,7 +539,6 @@ class Installer
return true;
}
/**
* Workaround: if your packages depend on plugins, we must be sure
* that those are installed / updated first; else it would lead to packages
@ -550,7 +549,7 @@ class Installer
* it at least fixes the symptoms and makes usage of composer possible (again)
* in such scenarios.
*
* @param OperationInterface[] $operations
* @param OperationInterface[] $operations
* @return OperationInterface[] reordered operation list
*/
private function movePluginsToFront(array $operations)
@ -559,7 +558,7 @@ class Installer
foreach ($operations as $idx => $op) {
if ($op instanceof InstallOperation) {
$package = $op->getPackage();
} else if ($op instanceof UpdateOperation) {
} elseif ($op instanceof UpdateOperation) {
$package = $op->getTargetPackage();
} else {
continue;

@ -165,6 +165,7 @@ class LibraryInstaller implements InstallerInterface
if (strpos($initialDownloadPath, $targetDownloadPath) === 0) {
$this->removeCode($initial);
$this->installCode($target);
return;
}

@ -368,9 +368,9 @@ class VersionParser
*
* Support function for {@link parseConstraint()}
*
* @param array $matches Array with version parts in array indexes 1,2,3,4
* @param array $matches Array with version parts in array indexes 1,2,3,4
* @param int $position 1,2,3,4 - which segment of the version to decrement
* @param string $pad The string to pad version parts after $position
* @param string $pad The string to pad version parts after $position
* @return string The new version
*/
private function manipulateVersionString($matches, $position, $increment = 0, $pad = '0')
@ -378,7 +378,7 @@ class VersionParser
for ($i = 4; $i > 0; $i--) {
if ($i > $position) {
$matches[$i] = $pad;
} else if ($i == $position && $increment) {
} elseif ($i == $position && $increment) {
$matches[$i] += $increment;
// If $matches[$i] was 0, carry the decrement
if ($matches[$i] < 0) {

@ -32,7 +32,7 @@ interface PluginInterface
/**
* Apply plugin modifications to composer
*
* @param Composer $composer
* @param Composer $composer
* @param IOInterface $io
*/
public function activate(Composer $composer, IOInterface $io);

@ -35,7 +35,7 @@ class PreFileDownloadEvent extends Event
/**
* Constructor.
*
* @param string $name The event name
* @param string $name The event name
* @param RemoteFilesystem $rfs
* @param string $processedUrl
*/

@ -43,7 +43,6 @@ class PlatformRepository extends ArrayRepository
$version = $versionParser->normalize($prettyVersion);
}
$php = new CompletePackage('php', $version, $prettyVersion);
$php->setDescription('The PHP interpreter');
parent::addPackage($php);

@ -10,12 +10,10 @@
* file that was distributed with this source code.
*/
namespace Composer\Repository\Vcs;
use Composer\IO\IOInterface;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
use Composer\Util\Perforce;
/**
@ -145,6 +143,7 @@ class PerforceDriver extends VcsDriver
if (isset($this->composerInfo)) {
$result = count($this->composerInfo) > 0;
}
return $result;
}

@ -103,7 +103,7 @@ abstract class VcsDriver implements VcsDriverInterface
/**
* Return if current repository url is local
*
*
* @return boolean Repository url is local
*/
protected static function isLocalUrl($url)

@ -44,7 +44,7 @@ class Filesystem
/**
* Checks if a directory is empty
*
* @param string $dir
* @param string $dir
* @return bool
*/
public function isDirEmpty($dir)

@ -105,7 +105,7 @@ class NoProxyPattern
* http://framework.zend.com/svn/framework/extras/incubator/library/ZendX/Whois/Adapter/Cidr.php
*
* @param string $cidr IPv4 block in CIDR notation
* @param string $ip IPv4 address
* @param string $ip IPv4 address
*
* @return boolean
*/

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Composer.
*
@ -9,7 +10,6 @@
* file that was distributed with this source code.
*/
namespace Composer\Util;
use Composer\IO\IOInterface;
@ -20,7 +20,6 @@ use Symfony\Component\Process\Process;
*/
class Perforce
{
protected $path;
protected $p4Depot;
protected $p4Client;
@ -35,7 +34,6 @@ class Perforce
protected $uniquePerforceClientName;
protected $windowsFlag;
public static function createPerforce($repoConfig, $port, $path, ProcessExecutor $process = null)
{
if (!isset($process)) {
@ -44,6 +42,7 @@ class Perforce
$isWindows = defined('PHP_WINDOWS_VERSION_BUILD');
$perforce = new Perforce($repoConfig, $port, $path, $process, $isWindows);
return $perforce;
}
@ -161,6 +160,7 @@ class Perforce
$this->p4Stream = '//' . $this->p4Depot;
}
}
return $this->p4Stream;
}
@ -268,6 +268,7 @@ class Perforce
if ($index === false) {
return false;
}
return true;
}
@ -329,7 +330,6 @@ class Perforce
fclose($spec);
}
protected function read($pipe, $name)
{
if (feof($pipe)) {
@ -347,10 +347,10 @@ class Perforce
{
$command = $this->generateP4Command(' login -a');
$process = new Process($command, null, null, $password);
return $process->run();
}
public function p4Login(IOInterface $io)
{
$this->queryP4User($io);
@ -369,6 +369,7 @@ class Perforce
{
$result = '';
$processExecutor->execute('p4 -p ' . $url . ' info -s', $result);
return false === strpos($result, 'error');
}
@ -380,6 +381,7 @@ class Perforce
return $this->getComposerInformationFromPath($composerJson);
}
return $this->getComposerInformationFromLabel($identifier, $index);
}
@ -496,6 +498,7 @@ class Perforce
}
$fields = explode(' ', $changes);
$changeList = $fields[1];
return $changeList;
}
@ -513,6 +516,7 @@ class Perforce
$main = substr($fromReference, 0, $index) . '/...';
$command = $this->generateP4Command('filelog ' . $main . '@' . $fromChangeList. ',' . $toChangeList);
$result = $this->executeCommand($command);
return $result;
}
}

@ -8,4 +8,4 @@ $baseDir = dirname($vendorDir);
return array(
$baseDir . '/foo.php',
$baseDir . '/bar.php',
);
);

@ -12,4 +12,4 @@ return array(
$vendorDir . '/b/bar/testB.php',
$vendorDir . '/e/e/testE.php',
$baseDir . '/root.php',
);
);

@ -11,4 +11,4 @@ return array(
$vendorDir . '/c/c/foo/bar/test3.php',
$baseDir . '/root.php',
$vendorDir . '/c/c/foo/bar/test4.php',
);
);

@ -8,4 +8,4 @@ $baseDir = dirname($vendorDir);
return array(
$baseDir . '/foo.php',
$baseDir . '/bar.php',
);
);

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Composer.
*
@ -9,7 +10,6 @@
* file that was distributed with this source code.
*/
namespace Composer\Test\Downloader;
use Composer\Downloader\PerforceDownloader;
@ -41,7 +41,6 @@ class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
$this->io = $this->getMock('Composer\IO\IOInterface');
}
public function testDoDownloadGetRepoConfig()
{
$downloader = new PerforceDownloader($this->io, $this->config);

@ -49,7 +49,7 @@ class ArchiveManagerTest extends ArchiverTest
$target = $this->getTargetName($package, 'tar');
$this->assertFileExists($target);
$tmppath = sys_get_temp_dir().'/composer_archiver/'.$this->manager->getPackageFilename($package);
$this->assertFileNotExists($tmppath);

@ -17,7 +17,6 @@ use Composer\Config;
use Composer\Installer\PluginInstaller;
use Composer\Package\Loader\JsonLoader;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\PackageInterface;
use Composer\Plugin\PluginManager;
use Composer\Autoload\AutoloadGenerator;
use Composer\Util\Filesystem;
@ -166,4 +165,3 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('installer-v3', $plugins[1]->version);
}
}

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Composer.
*
@ -11,7 +12,6 @@
namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\PerforceDriver;
use Composer\Util\Filesystem;
use Composer\Config;

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Composer.
*
@ -9,7 +10,6 @@
* file that was distributed with this source code.
*/
namespace Composer\Test\Util;
use Composer\Util\Perforce;
@ -70,7 +70,6 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('//depot/branch', $stream);
}
public function testGetStreamWithoutLabelWithStreamWithoutLabel()
{
$stream = $this->perforce->getStreamWithoutLabel('//depot/branch');
@ -123,6 +122,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'P4USER=TEST_P4VARIABLE_USER' . PHP_EOL ;
return true;
}
)
@ -146,6 +146,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'TEST_P4VARIABLE_USER' . PHP_EOL;
return true;
}
)
@ -237,6 +238,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'P4PASSWD=TEST_P4VARIABLE_PASSWORD' . PHP_EOL;
return true;
}
)
@ -260,6 +262,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'TEST_P4VARIABLE_PASSWORD' . PHP_EOL;
return true;
}
)
@ -357,6 +360,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL;
return true;
}
)
@ -382,6 +386,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL;
return true;
}
)
@ -404,6 +409,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL;
return true;
}
)
@ -428,6 +434,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\'';
return true;
}
)
@ -447,6 +454,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = PerforceTest::getComposerJson();
return true;
}
)
@ -472,6 +480,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = '//depot/composer.json#1 - branch change 10001 (text)';
return true;
}
)
@ -485,6 +494,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = PerforceTest::getComposerJson();
return true;
}
)
@ -513,6 +523,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = PerforceTest::getComposerJson();
return true;
}
)
@ -540,6 +551,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = '//depot/composer.json#1 - branch change 10001 (text)';
return true;
}
)
@ -553,6 +565,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
$this->returnCallback(
function ($command, &$output) {
$output = PerforceTest::getComposerJson();
return true;
}
)

@ -144,7 +144,6 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
}
}
public function testCaptureAuthenticationParamsFromUrl()
{
$io = $this->getMock('Composer\IO\IOInterface');

Loading…
Cancel
Save