summaryrefslogtreecommitdiff
path: root/app/Core
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-03 15:55:20 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-03 15:55:20 -0400
commitd7c0fabcb79fd72993cd00fe00d49bc5656bc204 (patch)
tree5ca0fe4a53a8552a41e33b8141e1eb8ea4d97b31 /app/Core
parentaeab662d65cdadc044b89c332591b1f1d5b90823 (diff)
Add unit test for FileStorage
Diffstat (limited to 'app/Core')
-rw-r--r--app/Core/ObjectStorage/FileStorage.php5
-rw-r--r--app/Core/ObjectStorage/ObjectStorageInterface.php1
2 files changed, 2 insertions, 4 deletions
diff --git a/app/Core/ObjectStorage/FileStorage.php b/app/Core/ObjectStorage/FileStorage.php
index fa1efe21..75160e79 100644
--- a/app/Core/ObjectStorage/FileStorage.php
+++ b/app/Core/ObjectStorage/FileStorage.php
@@ -53,7 +53,6 @@ class FileStorage implements ObjectStorageInterface
* @access public
* @param string $key
* @param string $blob
- * @return string
*/
public function put($key, &$blob)
{
@@ -78,7 +77,7 @@ class FileStorage implements ObjectStorageInterface
throw new ObjectStorageException('File not found: '.$filename);
}
- return readfile($filename);
+ readfile($filename);
}
/**
@@ -141,7 +140,7 @@ class FileStorage implements ObjectStorageInterface
*/
private function createFolder($key)
{
- $folder = $this->path.DIRECTORY_SEPARATOR.dirname($key);
+ $folder = strpos($key, '/') !== false ? $this->path.DIRECTORY_SEPARATOR.dirname($key) : $this->path;
if (! is_dir($folder) && ! mkdir($folder, 0755, true)) {
throw new ObjectStorageException('Unable to create folder: '.$folder);
diff --git a/app/Core/ObjectStorage/ObjectStorageInterface.php b/app/Core/ObjectStorage/ObjectStorageInterface.php
index 180bdf86..48444d2d 100644
--- a/app/Core/ObjectStorage/ObjectStorageInterface.php
+++ b/app/Core/ObjectStorage/ObjectStorageInterface.php
@@ -25,7 +25,6 @@ interface ObjectStorageInterface
* @access public
* @param string $key
* @param string $blob
- * @return string
*/
public function put($key, &$blob);