2011-04-17 22:14:44 +00:00
|
|
|
<?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;
|
|
|
|
|
2012-08-23 13:52:40 +00:00
|
|
|
use Composer\Package\RootPackageInterface;
|
2011-10-01 12:33:43 +00:00
|
|
|
use Composer\Package\Locker;
|
2011-09-25 18:00:26 +00:00
|
|
|
use Composer\Repository\RepositoryManager;
|
|
|
|
use Composer\Installer\InstallationManager;
|
|
|
|
use Composer\Downloader\DownloadManager;
|
2011-04-17 22:14:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
2011-09-16 19:14:06 +00:00
|
|
|
* @author Konstantin Kudryashiv <ever.zet@gmail.com>
|
2011-04-17 22:14:44 +00:00
|
|
|
*/
|
|
|
|
class Composer
|
|
|
|
{
|
2011-11-12 18:44:24 +00:00
|
|
|
const VERSION = '@package_version@';
|
2011-09-14 12:57:40 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-08-23 13:52:40 +00:00
|
|
|
* @var Package\RootPackageInterface
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
private $package;
|
2012-05-08 20:41:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Locker
|
|
|
|
*/
|
2011-10-01 12:33:43 +00:00
|
|
|
private $locker;
|
2011-04-17 22:14:44 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
|
|
|
* @var Repository\RepositoryManager
|
|
|
|
*/
|
2011-09-25 21:19:12 +00:00
|
|
|
private $repositoryManager;
|
2012-05-08 20:41:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Downloader\DownloadManager
|
|
|
|
*/
|
2011-09-25 21:19:12 +00:00
|
|
|
private $downloadManager;
|
2012-05-08 20:41:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Installer\InstallationManager
|
|
|
|
*/
|
2011-09-25 21:19:12 +00:00
|
|
|
private $installationManager;
|
2011-04-17 22:14:44 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
|
|
|
* @var Config
|
|
|
|
*/
|
|
|
|
private $config;
|
|
|
|
|
|
|
|
/**
|
2012-08-23 13:52:40 +00:00
|
|
|
* @param Package\RootPackageInterface $package
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return void
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2012-08-23 13:52:40 +00:00
|
|
|
public function setPackage(RootPackageInterface $package)
|
2011-09-25 18:00:26 +00:00
|
|
|
{
|
|
|
|
$this->package = $package;
|
|
|
|
}
|
2011-04-17 22:14:44 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-08-23 13:52:40 +00:00
|
|
|
* @return Package\RootPackageInterface
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function getPackage()
|
|
|
|
{
|
|
|
|
return $this->package;
|
2011-04-17 22:14:44 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @param Config $config
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2012-04-09 14:10:25 +00:00
|
|
|
public function setConfig(Config $config)
|
|
|
|
{
|
|
|
|
$this->config = $config;
|
|
|
|
}
|
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return Config
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2012-04-09 14:10:25 +00:00
|
|
|
public function getConfig()
|
|
|
|
{
|
|
|
|
return $this->config;
|
|
|
|
}
|
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @param Package\Locker $locker
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-10-01 12:33:43 +00:00
|
|
|
public function setLocker(Locker $locker)
|
2011-04-17 22:14:44 +00:00
|
|
|
{
|
2011-10-01 12:33:43 +00:00
|
|
|
$this->locker = $locker;
|
2011-09-25 18:00:26 +00:00
|
|
|
}
|
2011-09-16 19:14:06 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return Package\Locker
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-10-01 12:33:43 +00:00
|
|
|
public function getLocker()
|
2011-09-25 18:00:26 +00:00
|
|
|
{
|
2011-10-01 12:33:43 +00:00
|
|
|
return $this->locker;
|
2011-04-17 22:14:44 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @param Repository\RepositoryManager $manager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function setRepositoryManager(RepositoryManager $manager)
|
2011-04-17 22:14:44 +00:00
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
$this->repositoryManager = $manager;
|
2011-09-25 18:00:26 +00:00
|
|
|
}
|
2011-09-16 19:14:06 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return Repository\RepositoryManager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function getRepositoryManager()
|
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
return $this->repositoryManager;
|
2011-09-25 18:00:26 +00:00
|
|
|
}
|
2011-04-17 22:14:44 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @param Downloader\DownloadManager $manager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function setDownloadManager(DownloadManager $manager)
|
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
$this->downloadManager = $manager;
|
2011-04-17 22:14:44 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return Downloader\DownloadManager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function getDownloadManager()
|
2011-04-17 22:14:44 +00:00
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
return $this->downloadManager;
|
2011-09-25 18:00:26 +00:00
|
|
|
}
|
2011-06-28 18:42:02 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @param Installer\InstallationManager $manager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function setInstallationManager(InstallationManager $manager)
|
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
$this->installationManager = $manager;
|
2011-09-16 19:14:06 +00:00
|
|
|
}
|
2011-06-28 18:42:02 +00:00
|
|
|
|
2012-05-08 20:41:37 +00:00
|
|
|
/**
|
2012-06-23 09:58:18 +00:00
|
|
|
* @return Installer\InstallationManager
|
2012-05-08 20:41:37 +00:00
|
|
|
*/
|
2011-09-25 18:00:26 +00:00
|
|
|
public function getInstallationManager()
|
2011-09-16 19:14:06 +00:00
|
|
|
{
|
2011-09-25 21:19:12 +00:00
|
|
|
return $this->installationManager;
|
2011-04-17 22:14:44 +00:00
|
|
|
}
|
2011-09-17 11:18:34 +00:00
|
|
|
}
|