diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-06-19 02:42:18 -0700 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-06-19 02:42:18 -0700 |
commit | 904227a0e4b95be4f1a0aa87b9173fd2fea966c8 (patch) | |
tree | 632dcffaed9039b38e6a8c1093eea99b64ccde3a /lib | |
parent | dd231b530d6cbf168c85bb83b2a268b1d70b8ce8 (diff) | |
parent | 87521f6c6e19bb2cff21ad0792604d24a6d6403e (diff) | |
download | nextcloud-server-904227a0e4b95be4f1a0aa87b9173fd2fea966c8.tar.gz nextcloud-server-904227a0e4b95be4f1a0aa87b9173fd2fea966c8.zip |
Merge pull request #3661 from owncloud/fixing-windows-server-master
Fixing windows server master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoloader.php | 4 | ||||
-rw-r--r-- | lib/files/cache/updater.php | 5 | ||||
-rw-r--r-- | lib/files/view.php | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php index 9615838a9a2..21170639092 100644 --- a/lib/autoloader.php +++ b/lib/autoloader.php @@ -96,8 +96,8 @@ class Autoloader { } else { foreach ($this->prefixPaths as $prefix => $dir) { if (0 === strpos($class, $prefix)) { - $path = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; - $path = str_replace('_', DIRECTORY_SEPARATOR, $path); + $path = str_replace('\\', '/', $class) . '.php'; + $path = str_replace('_', '/', $path); $paths[] = $dir . '/' . $path; } } diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php index 417a47f3830..87c33a313a4 100644 --- a/lib/files/cache/updater.php +++ b/lib/files/cache/updater.php @@ -7,6 +7,7 @@ */ namespace OC\Files\Cache; +use OCP\Util; /** * listen to filesystem hooks and change the cache accordingly @@ -102,7 +103,7 @@ class Updater { static public function correctFolder($path, $time) { if ($path !== '' && $path !== '/') { $parent = dirname($path); - if ($parent === '.') { + if ($parent === '.' || $parent === '\\') { $parent = ''; } /** @@ -116,6 +117,8 @@ class Updater { if ($id !== -1) { $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath))); self::correctFolder($parent, $time); + } else { + Util::writeLog('core', 'Path not in cache: '.$internalPath, Util::ERROR); } } } diff --git a/lib/files/view.php b/lib/files/view.php index e2fc8d965b8..25071709fbe 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -386,6 +386,12 @@ class View { $source = $this->fopen($path1 . $postFix1, 'r'); $target = $this->fopen($path2 . $postFix2, 'w'); list($count, $result) = \OC_Helper::streamCopy($source, $target); + + // close open handle - especially $source is necessary because unlink below will + // throw an exception on windows because the file is locked + fclose($source); + fclose($target); + if ($result !== false) { list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); $storage1->unlink($internalPath1); |