本文整理汇总了PHP中Composer\IO\IOInterface::overwriteError方法的典型用法代码示例。如果您正苦于以下问题:PHP IOInterface::overwriteError方法的具体用法?PHP IOInterface::overwriteError怎么用?PHP IOInterface::overwriteError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\IO\IOInterface
的用法示例。
在下文中一共展示了IOInterface::overwriteError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch
/**
* @return string[]
*/
private function fetch()
{
$this->io->write(sprintf(' - Updating <info>%s</info> tag list', $this->package));
if (isset($_ENV['HRDNS_PHANTOMJS_VERSION']) && !empty($_ENV['HRDNS_PHANTOMJS_VERSION'])) {
$this->cache = [$_ENV['HRDNS_PHANTOMJS_VERSION']];
}
if ($this->cache === null) {
$this->cache = [];
$this->io->writeError(" Downloading: <comment>Connecting...</comment>", false);
$repo = new VcsRepository(['url' => $this->url, 'type' => $this->type], $this->io, $this->config);
$this->cache = array_keys($repo->getDriver()->getTags());
$this->io->overwriteError('', false);
$this->io->overwriteError(sprintf("\r Found <comment>%d</comment> versions\n", count($this->cache)));
}
return $this->cache;
}
开发者ID:sgc-fireball,项目名称:selenium-server-standalone-installer,代码行数:19,代码来源:PhantomJSVersionRepository.php
示例2: fetch
/**
* @return string[]
*/
private function fetch()
{
$this->io->write(sprintf(' - Updating <info>%s</info> tag list', $this->package));
if (isset($_ENV['HRDNS_SELENIUM_VERSION']) && !empty($_ENV['HRDNS_SELENIUM_VERSION'])) {
$this->cache = [$_ENV['HRDNS_SELENIUM_VERSION']];
}
if ($this->cache === null) {
$this->cache = [];
$this->io->writeError(" Downloading: <comment>Connecting...</comment>", false);
$repo = new VcsRepository(['url' => $this->url, 'type' => $this->type], $this->io, $this->config);
$this->cache = array_keys($repo->getDriver()->getTags());
$this->io->overwriteError(" Downloading: <comment>100%</comment>", false);
$this->cache = array_filter($this->cache, function ($version) {
return strpos($version, 'selenium-') === 0;
});
array_walk($this->cache, function (&$value) {
$value = substr($value, 9);
});
$this->io->overwriteError(sprintf("\r Found <comment>%d</comment> versions\n", count($this->cache)));
}
return $this->cache;
}
开发者ID:sgc-fireball,项目名称:selenium-server-standalone-installer,代码行数:25,代码来源:SeleniumVersionRepository.php
示例3: referencePackages
public function referencePackages(PackageSet $packageSet, IOInterface $io, $apiUrl = null)
{
if (!$apiUrl) {
$apiUrl = 'https://php-bach.org';
}
$apiUrlFormat = $apiUrl . '/p/%s.json';
//cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
/** @var Package $package */
foreach ($packageSet as $package) {
$packageName = $package->getPackageName();
$versionName = $package->getVersion();
$url = sprintf($apiUrlFormat, $packageName);
curl_setopt($ch, CURLOPT_URL, $url);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$message = '<info>Checking:</info> ' . $packageName . ' (' . $versionName . ') ...';
$io->write($message);
if ('200' === (string) $code) {
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
// ヘッダサイズ取得
$body = substr($response, $header_size);
// bodyだけ切り出し
if ($this->parseResponse($package, $body)) {
$io->overwrite('<info>Done.</info>');
} else {
$io->overwrite('<fg=white;bg=magenta>Version not found.</>');
}
} elseif ('404' === (string) $code) {
$io->overwrite('<fg=white;bg=magenta>Package not found.</>');
} else {
$io->overwriteError($message . '<error>Connection error.</error>');
}
}
curl_close($ch);
}