diff options
| author | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 18:28:09 +0100 |
|---|---|---|
| committer | yogg@epsina.com <evan.pisani@etudiant.univ-rennes1.fr> | 2016-01-31 18:28:09 +0100 |
| commit | 6e7c71db77fc68b7c3d1149b830a838b81cdb718 (patch) | |
| tree | c919846f1acf4d3d62dc5543d57399fc046910db /server/core/Image.php | |
| parent | 0db8d0ebbe36528346987cb21db67f31bfbe6017 (diff) | |
Add update_image and download_image
Diffstat (limited to 'server/core/Image.php')
| -rw-r--r-- | server/core/Image.php | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index c9d9845..a986a40 100644 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -67,18 +67,24 @@ class Image { return $image; } - + /** + * Details about an image + * + * @param string $id + * id of the image + * + * @param array $opt + * options for the image creation + **/ public function update_image($id, array $opt){ $service = $this->oidentity; - - //OPTIONS A VOIR $image = $service->getImage($id); $image->update([ - 'minDisk' => 1, - 'minRam' => 1, - 'name' => $opt[name], - 'protected' => false, - 'visibility' => $opt[visibility], + 'minDisk' => $opt['minDisk'], + 'minRam' => $opt['minRam'], + 'name' => $opt['name'], + 'protected' => $opt['protected'], + 'visibility' => $opt['visibility'], ]); return $image; @@ -135,11 +141,17 @@ class Image { $image->uploadData($stream); } - // RETOUR A VOIR - public function download_image($id){ + /** + * Download an image + * + * @param string $id + * identifier of the image + */ + public function download_image($id){ $service = $this->oidentity; $image = $service->getImage($id); $stream = $image->downloadData(); + return $stream; } } ?> |
