не знаю что
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Из файла file.js делаем file_v123456789.js добавив время
|
||||
function getScript($path)
|
||||
function getScript($path,$pathURL="")
|
||||
{
|
||||
if (file_exists($_SERVER['DOCUMENT_ROOT'].$path))
|
||||
{
|
||||
return '<script src="'.beforeLast($path,'.').'_v'.filectime($_SERVER['DOCUMENT_ROOT'].$path).'.'.afterLast($path,'.').'"></script>'."\n";
|
||||
if($pathURL!="")
|
||||
{
|
||||
return '<script src="' . $pathURL.'?v='.filectime($_SERVER['DOCUMENT_ROOT'] . $path). '"></script>' . "\n";
|
||||
}else {
|
||||
return '<script src="' . beforeLast($path, '.') . '_v' . filectime($_SERVER['DOCUMENT_ROOT'] . $path) . '.' . afterLast($path, '.') . '"></script>' . "\n";
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user