getReleaseChannel() public static méthode

public static getReleaseChannel ( ) : string
Résultat string
Exemple #1
0
 /**
  * @since Method available since Release 4.0.0
  */
 protected function handleSelfUpdate($upgrade = false)
 {
     $this->printVersionString();
     $localFilename = realpath($_SERVER['argv'][0]);
     if (!is_writable($localFilename)) {
         print 'No write permission to update ' . $localFilename . "\n";
         exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
     }
     if (!extension_loaded('openssl')) {
         print "The OpenSSL extension is not loaded.\n";
         exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
     }
     if (!$upgrade) {
         $remoteFilename = sprintf('https://phar.phpunit.de/phpunit-%s.phar', file_get_contents(sprintf('https://phar.phpunit.de/latest-version-of/phpunit-%s', PHPUnit_Runner_Version::series())));
     } else {
         $remoteFilename = sprintf('https://phar.phpunit.de/phpunit%s.phar', PHPUnit_Runner_Version::getReleaseChannel());
     }
     $tempFilename = tempnam(sys_get_temp_dir(), 'phpunit') . '.phar';
     // Workaround for https://bugs.php.net/bug.php?id=65538
     $caFile = dirname($tempFilename) . '/ca.pem';
     copy(__PHPUNIT_PHAR_ROOT__ . '/ca.pem', $caFile);
     print 'Updating the PHPUnit PHAR ... ';
     $options = ['ssl' => ['allow_self_signed' => false, 'cafile' => $caFile, 'verify_peer' => true]];
     file_put_contents($tempFilename, file_get_contents($remoteFilename, false, stream_context_create($options)));
     chmod($tempFilename, 0777 & ~umask());
     try {
         $phar = new Phar($tempFilename);
         unset($phar);
         rename($tempFilename, $localFilename);
         unlink($caFile);
     } catch (Throwable $_e) {
         $e = $_e;
     } catch (Exception $_e) {
         $e = $_e;
     }
     if (isset($e)) {
         unlink($caFile);
         unlink($tempFilename);
         print " done\n\n" . $e->getMessage() . "\n";
         exit(2);
     }
     print " done\n";
     exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
 }
Exemple #2
0
 /**
  * @since Method available since Release 4.0.0
  */
 protected function handleSelfUpdate()
 {
     $this->printVersionString();
     if (!extension_loaded('openssl')) {
         print "The OpenSSL extension is not loaded.\n";
         exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
     }
     $remoteFilename = sprintf('https://phar.phpunit.de/phpunit%s.phar', PHPUnit_Runner_Version::getReleaseChannel());
     $localFilename = realpath($_SERVER['argv'][0]);
     $tempFilename = basename($localFilename, '.phar') . '-temp.phar';
     // Workaround for https://bugs.php.net/bug.php?id=65538
     $caFile = dirname($tempFilename) . '/ca.pem';
     copy(__PHPUNIT_PHAR_ROOT__ . '/ca.pem', $caFile);
     print 'Updating the PHPUnit PHAR ... ';
     $options = array('ssl' => array('allow_self_signed' => false, 'cafile' => $caFile, 'verify_peer' => true));
     if (PHP_VERSION_ID < 50600) {
         $options['ssl']['CN_match'] = 'phar.phpunit.de';
         $options['ssl']['SNI_server_name'] = 'phar.phpunit.de';
     }
     file_put_contents($tempFilename, file_get_contents($remoteFilename, false, stream_context_create($options)));
     chmod($tempFilename, 0777 & ~umask());
     try {
         $phar = new Phar($tempFilename);
         unset($phar);
         rename($tempFilename, $localFilename);
         unlink($caFile);
     } catch (Exception $e) {
         unlink($caFile);
         unlink($tempFilename);
         print " done\n\n" . $e->getMessage() . "\n";
         exit(2);
     }
     print " done\n";
     exit(0);
 }