diff options
author | Phie <phie@phie.ovh> | 2019-03-09 13:17:23 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-03-09 13:17:23 +0300 |
commit | 9f64ec9b0fde5101eaf4c5347c3d7fe30a505d87 (patch) | |
tree | 2757e982854b20db59b5fa3391374a24d39f6adf | |
parent | 8fed1e57a70d615c72f2fbdf5ee25b3221523930 (diff) |
-rwxr-xr-x | appinfo/info.xml | 2 | ||||
-rw-r--r-- | lib/Hooks/FSHooks.php | 33 |
2 files changed, 19 insertions, 16 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 6850b6b..0d7c7e5 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -18,7 +18,7 @@ Mac, with sync capabilities - Statistics : words/sentences/characters - Sync with NextCloud - Online editor as a NextCloud App]]></description> - <version>0.13.2</version> + <version>0.13.4</version> <licence>agpl</licence> <author mail="phie@phie.ovh" >Phie</author> <namespace>Carnet</namespace> diff --git a/lib/Hooks/FSHooks.php b/lib/Hooks/FSHooks.php index 51c036b..344bbd1 100644 --- a/lib/Hooks/FSHooks.php +++ b/lib/Hooks/FSHooks.php @@ -27,22 +27,25 @@ class FSHooks { } public function postWrite($node) { - - if(substr($node->getName(), -3) === "sqd"){ // to avoid getting carnet's path each time a file is writen - //we check if is in our path - - if(substr($node->getPath(), 0, strlen($this->carnetFolder->getPath())) === $this->carnetFolder->getPath()){ - $relativePath = substr($node->getPath(), strlen($this->carnetFolder->getPath())); - if(substr($relativePath, 0, 1) === "/") - $relativePath = substr($relativePath, 1); - /*if(NoteController::$lastWrite === $node->getPath()){ - return; //was already handled in save - }*/ - $cacheManager = new CacheManager($this->db); - $utils = new NoteUtils(); - $metadata = $utils->getMetadata($this->carnetFolder, $relativePath); - $cacheManager->addToCache($relativePath, $metadata, $metadata['lastmodfile']); + try{ + if(substr($node->getName(), -3) === "sqd"){ // to avoid getting carnet's path each time a file is writen + //we check if is in our path + + if(substr($node->getPath(), 0, strlen($this->carnetFolder->getPath())) === $this->carnetFolder->getPath()){ + $relativePath = substr($node->getPath(), strlen($this->carnetFolder->getPath())); + if(substr($relativePath, 0, 1) === "/") + $relativePath = substr($relativePath, 1); + /*if(NoteController::$lastWrite === $node->getPath()){ + return; //was already handled in save + }*/ + $cacheManager = new CacheManager($this->db); + $utils = new NoteUtils(); + $metadata = $utils->getMetadata($this->carnetFolder, $relativePath); + $cacheManager->addToCache($relativePath, $metadata, $metadata['lastmodfile']); + } } + } catch(\PhpZip\Exception\ZipException $e){ + } |