From 9f64ec9b0fde5101eaf4c5347c3d7fe30a505d87 Mon Sep 17 00:00:00 2001 From: Phie Date: Sat, 9 Mar 2019 11:17:23 +0100 Subject: emergency update --- appinfo/info.xml | 2 +- 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]]> - 0.13.2 + 0.13.4 agpl Phie Carnet 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){ + } -- cgit v1.2.3