1 개요[ | ]
- 라라벨 Compiler.php
PHP
Copy
<?php
namespace Illuminate\View\Compilers;
use InvalidArgumentException;
use Illuminate\Filesystem\Filesystem;
abstract class Compiler
{
protected $files;
protected $cachePath;
public function __construct(Filesystem $files, $cachePath)
{
if (! $cachePath) {
throw new InvalidArgumentException('Please provide a valid cache path.');
}
$this->files = $files;
$this->cachePath = $cachePath;
}
public function getCompiledPath($path)
{
return $this->cachePath.'/'.sha1($path).'.php';
}
public function isExpired($path)
{
$compiled = $this->getCompiledPath($path);
if (! $this->files->exists($compiled)) {
return true;
}
$lastModified = $this->files->lastModified($path);
return $lastModified >= $this->files->lastModified($compiled);
}
}
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.