Skip to content

Commit

Permalink
Fixes and bumps for nextcloud v25
Browse files Browse the repository at this point in the history
  • Loading branch information
Erikvv committed Oct 26, 2022
1 parent 4151eac commit 0c00c76
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ $CONFIG = [
<screenshot>https://link.storjshare.io/raw/jvfizc37vgr5ohyxwreg7abnxxrq/nextcloud-app-assets/storj-logo.svg</screenshot>
<dependencies>
<lib>FFI</lib>
<nextcloud min-version="20" max-version="23"/>
<nextcloud min-version="20" max-version="25"/>
</dependencies>
</info>
32 changes: 3 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,15 @@
}
],
"require": {
"storj/uplink": "^1.1"
"storj/uplink": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"repositories": {
"storj/uplink": {
"type": "package",
"package": {
"name": "storj/uplink",
"version": "1.1.0",
"license": "MIT/Expat",
"dist": {
"url": "https://link.us1.storjshare.io/raw/jxmgbsqc4k2bbhuv27556pcoh7ra/uplink-php-releases/uplink-php-v1.1.0.zip",
"type": "zip"
},
"autoload": {
"psr-4": {
"Storj\\Uplink\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Storj\\Uplink\\Test\\": "test/"
}
},
"require": {
"php": ">=7.4",
"ext-ffi": "*",
"psr/http-message": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.2"
}
}
"type": "composer",
"url": "https://raw.githubusercontent.com/storj-thirdparty/uplink-php/main/"
}
}
}
18 changes: 13 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion lib/StorjStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,22 @@ public function touch($path, $mtime = null)
{
$this->logger->debug('Storj::touch("{path}")', ['path' => $path]);

return false;
$path = $this->normalizePath($path);

if ($this->file_exists($path)) {
// matches native PHP touch behavior
return true;
}

try {
$upload = $this->project->uploadObject($this->bucket, $path);
$upload->commit();
} catch (UplinkException $e) {
$this->logger->error($e->getMessage());
return false;
}

return true;
}

private function normalizePath($path)
Expand Down

0 comments on commit 0c00c76

Please sign in to comment.