mirror of
https://github.com/kd2org/picodav.git
synced 2026-03-14 14:25:49 +01:00
Add makefile, put dependencies outside
FossilOrigin-Name: 3dcdfdab2b4af20c1a6aafe3bb9f1fbf64ea0726dd015e2d2c1f8549b58e7001
This commit is contained in:
parent
c75d5c7e9d
commit
3d1e9ab1e0
5 changed files with 151 additions and 1624 deletions
13
make.php
13
make.php
|
|
@ -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'),
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue