Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets file modification time
<?php filemtime(string $filename): int|false
<?php static function pretendResponseIsFile($file, $contentType = 'application/javascript; charset=utf-8')
{
$lastModified = filemtime($file);
return static::cachedFileResponse($file, $contentType, $lastModified,
fn ($headers) => response()->file($file, $headers));
<?php public function lastModified($path)
{
return filemtime($path);
}
<?php $hasEnvironment = file_exists($environmentFile);
$environmentLastModified = $hasEnvironment
? filemtime($environmentFile)
: now()->addDays(30)->getTimestamp();
$process = $this->startProcess($hasEnvironment);
<?php if (! $this->option('no-reload') &&
$hasEnvironment &&
filemtime($environmentFile) > $environmentLastModified) {
$environmentLastModified = filemtime($environmentFile);
$this->newLine();
<?php if (! $this->option('no-reload') &&
$hasEnvironment &&
filemtime($environmentFile) > $environmentLastModified) {
$environmentLastModified = filemtime($environmentFile);
$this->newLine();
<?php function filemtime(...$arguments)
{
if ( ! is_mocked('filemtime')) {
return \filemtime(...$arguments);
}
return return_mocked_value('filemtime');
<?php {
$location = $this->prefixer->prefixPath($path);
error_clear_last();
$lastModified = @filemtime($location);
if ($lastModified === false) {
throw UnableToRetrieveMetadata::lastModified($path, error_get_last()['message'] ?? '');
<?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 $doCopy = true;
if (!$overwriteNewerFiles && null === parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) {
$doCopy = filemtime($originFile) > filemtime($targetFile);
}
if ($doCopy) {