Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return current Unix timestamp
<?php time(): int
<?php $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
try {
touch($this->root . $file, (int) filemtime($this->root . $file), time());
} catch (\ErrorException $e) {
<?php if ($this->isEnabled()) {
$file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file) && ($mtime = filemtime($this->root . $file)) !== false) {
return abs(time() - $mtime);
}
}
<?php $this->config = static::$defaultConfig;
if (strtotime('2022-07-01') < time()) {
$this->config['allow-plugins'] = array();
}
<?php $io->writeError('<warning>Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug</warning>');
}
if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME) {
$io->writeError(sprintf('<warning>Warning: This development build of Composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
}
<?php throw new \LogicException('Expected a token configured with expires_in present, got '.json_encode($this->token));
}
$time = null === $this->time ? time() : $this->time;
$consumer = array(
"consumer-key" => $consumerKey,
"consumer-secret" => $consumerSecret,
<?php if (
!isset($authConfig[$originUrl]['access-token'], $authConfig[$originUrl]['access-token-expiration'])
|| time() > $authConfig[$originUrl]['access-token-expiration']
) {
return false;
}
<?php public function generateUniquePerforceClientName()
{
return gethostname() . "_" . time();
}
<?php $expectedOutput .= sprintf('<warning>Warning: This development build of Composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']).PHP_EOL;
if (!defined('COMPOSER_DEV_WARNING_TIME')) {
define('COMPOSER_DEV_WARNING_TIME', time() - 1);
}
$application->doRun($inputMock, $output);
<?php ->method("writeln");
if (!defined('COMPOSER_DEV_WARNING_TIME')) {
define('COMPOSER_DEV_WARNING_TIME', time() - 1);
}
$application->doRun($inputMock, $outputMock);
<?php $this->config = $this->getMockBuilder('Composer\Config')->getMock();
$this->time = time();
$this->bitbucket = new Bitbucket($this->io, $this->config, null, $this->httpDownloader, $this->time);
}