Add makefile, put dependencies outside

FossilOrigin-Name: 3dcdfdab2b4af20c1a6aafe3bb9f1fbf64ea0726dd015e2d2c1f8549b58e7001
This commit is contained in:
bohwaz 2022-11-15 11:36:01 +00:00
commit 3d1e9ab1e0
5 changed files with 151 additions and 1624 deletions

View file

@ -2,8 +2,21 @@
$out = fopen('index.php', 'w');
function clean_php_source(string $file): string
{
$php = file_get_contents($file);
$php = preg_replace('/^namespace\s+.*;\s*$/m', '', $php);
$php = preg_replace('/<\?php\s*|\s*\?>/', '', $php);
$php = preg_replace(';/\*(?!\*/).*?\*/;s', '', $php);
$php = preg_replace('/^/m', "\t", $php);
$php = preg_replace('/^\s*$/m', "", $php);
return $php;
}
$php = file_get_contents('server.php');
$php = strtr($php, [
'//__KD2\WebDAV\Server__' => clean_php_source('lib/KD2/WebDAV/Server.php'),
'//__KD2\WebDAV\AbstractStorage__' => clean_php_source('lib/KD2/WebDAV/AbstractStorage.php'),
'__JS_SIZE__' => filesize('webdav.js'),
'__CSS_SIZE__' => filesize('webdav.css'),
]);