public function ensureNoDevWarning($command)
 {
     $application = new Application();
     $application->add(new \Composer\Command\SelfUpdateCommand());
     $inputMock = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface');
     $outputMock = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface');
     $inputMock->expects($this->once())->method('getFirstArgument')->will($this->returnValue($command));
     $outputMock->expects($this->never())->method("writeln");
     if (!defined('COMPOSER_DEV_WARNING_TIME')) {
         define('COMPOSER_DEV_WARNING_TIME', time() - 1);
     }
     $this->setExpectedException('RuntimeException');
     $application->doRun($inputMock, $outputMock);
 }
Example #2
0
 public function ensureNoDevWarning($command)
 {
     $application = new Application();
     $application->add(new \Composer\Command\SelfUpdateCommand());
     $inputMock = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface');
     $outputMock = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface');
     $index = 0;
     $inputMock->expects($this->at($index++))->method('hasParameterOption')->with($this->equalTo('--no-plugins'))->will($this->returnValue(true));
     $inputMock->expects($this->at($index++))->method('getParameterOption')->with($this->equalTo(array('--working-dir', '-d')))->will($this->returnValue(false));
     $inputMock->expects($this->at($index++))->method('getFirstArgument')->will($this->returnValue('list'));
     $outputMock->expects($this->never())->method("writeln");
     if (!defined('COMPOSER_DEV_WARNING_TIME')) {
         define('COMPOSER_DEV_WARNING_TIME', time() - 1);
     }
     $application->doRun($inputMock, $outputMock);
 }
Example #3
0
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
print "<pre>Installing GitSync dependencies for the first time ...\n\n";
flush();
if (!file_exists(EXTRACT_DIRECTORY . '/vendor/autoload.php') == true) {
    if (ini_get('phar.readonly')) {
        print "Error: unable to proceed. Please set phar.readonly = 0 in php.ini and then reload this page.</pre>";
        exit;
    }
    $composerPhar = new Phar(__DIR__ . "/composer.phar");
    $composerPhar->extractTo(EXTRACT_DIRECTORY);
}
//This requires the phar to have been extracted successfully.
require_once EXTRACT_DIRECTORY . '/vendor/autoload.php';
//Use the Composer classes
use Composer\Console\Application;
//Create the commands
$input = new Symfony\Component\Console\Input\StringInput('install');
$output = new Symfony\Component\Console\Output\StreamOutput(fopen('php://output', 'w'));
//Create the application and run it with the commands
$application = new Application();
$application->add(new Composer\Command\InstallCommand());
$application->setAutoExit(false);
$application->run($input, $output);
print "Cleaning up ...\n\n";
flush();
$fs = new \Symfony\Component\Filesystem\Filesystem();
$fs->remove(EXTRACT_DIRECTORY);
print "Done. Please reload this page.</pre>";
flush();
exit;