не знаю что

This commit is contained in:
2024-07-24 10:05:45 +05:00
parent d9e5677a8c
commit 5cca3481c4
11 changed files with 42 additions and 55 deletions

View File

@ -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 '';
}