mirror of
https://github.com/kd2org/picodav.git
synced 2026-03-15 14:55:47 +01:00
Compare commits
No commits in common. "main" and "0.1.11" have entirely different histories.
6 changed files with 415 additions and 1077 deletions
3
Makefile
3
Makefile
|
|
@ -3,9 +3,6 @@ KD2FW_URL := https://fossil.kd2.org/kd2fw/doc/trunk/src/lib/KD2/
|
|||
|
||||
deps:
|
||||
@-mkdir -p lib/KD2/WebDAV
|
||||
@-mkdir -p lib/KD2/HTTP
|
||||
wget -O lib/KD2/HTTP/Server.php '${KD2FW_URL}HTTP/Server.php'
|
||||
wget -O lib/KD2/WebDAV/Exception.php '${KD2FW_URL}WebDAV/Exception.php'
|
||||
wget -O lib/KD2/WebDAV/Server.php '${KD2FW_URL}WebDAV/Server.php'
|
||||
wget -O lib/KD2/WebDAV/AbstractStorage.php '${KD2FW_URL}WebDAV/AbstractStorage.php'
|
||||
wget -O webdav.js https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.js
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
If you drop the [`index.php`](https://fossil.kd2.org/picodav/doc/trunk/index.php) file in a directory of your web-server, it will make the contents of this directory available via WebDAV, and will also provide a nice web UI to manage the files, using [WebDAV Manager.js](https://fossil.kd2.org/webdav-manager/).
|
||||
|
||||

|
||||

|
||||
|
||||
* Single-file WebDAV server! Only 110 KB!
|
||||
* Single-file WebDAV server! Only 85 KB!
|
||||
* No database!
|
||||
* Very fast and lightweight!
|
||||
* Compatible with tons of apps!
|
||||
|
|
|
|||
2
make.php
2
make.php
|
|
@ -15,8 +15,6 @@ function clean_php_source(string $file): string
|
|||
|
||||
$php = file_get_contents('server.php');
|
||||
$php = strtr($php, [
|
||||
'//__KD2\HTTP\Server__' => clean_php_source('lib/KD2/HTTP/Server.php'),
|
||||
'//__KD2\WebDAV\Exception__' => clean_php_source('lib/KD2/WebDAV/Exception.php'),
|
||||
'//__KD2\WebDAV\Server__' => clean_php_source('lib/KD2/WebDAV/Server.php'),
|
||||
'//__KD2\WebDAV\AbstractStorage__' => clean_php_source('lib/KD2/WebDAV/AbstractStorage.php'),
|
||||
'/*__HTACCESS__*/' => var_export(file_get_contents('.htaccess'), true),
|
||||
|
|
|
|||
BIN
scr.webp
BIN
scr.webp
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB |
26
server.php
26
server.php
|
|
@ -1,14 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace KD2\HTTP
|
||||
{
|
||||
//__KD2\HTTP\Server__
|
||||
}
|
||||
|
||||
namespace KD2\WebDAV
|
||||
{
|
||||
//__KD2\WebDAV\Exception__
|
||||
|
||||
//__KD2\WebDAV\Server__
|
||||
|
||||
//__KD2\WebDAV\AbstractStorage__
|
||||
|
|
@ -214,23 +207,6 @@ namespace PicoDAV
|
|||
return ['path' => $path];
|
||||
}
|
||||
|
||||
public function fetch(string $uri): ?string
|
||||
{
|
||||
$r = $this->get($uri);
|
||||
|
||||
if (!$r) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$r = file_get_contents($r['path']);
|
||||
|
||||
if ($r === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
public function exists(string $uri): bool
|
||||
{
|
||||
return file_exists($this->path . $uri);
|
||||
|
|
@ -470,6 +446,8 @@ namespace PicoDAV
|
|||
}
|
||||
else {
|
||||
$method($source, $target);
|
||||
|
||||
$this->getResourceProperties($uri)->move($destination);
|
||||
}
|
||||
|
||||
return $overwritten;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue