/** * rename a blob url * @param type $url * @param type $newname, the name of the new blob * @return boolean */ public function renameBlob($url, $newname) { try { $dir = $this->getContainer($url); $file = $this->getBlobName($url); } catch (Exception $ex) { echo $ex->getMessage(); } try { mkdir('azure_tmp_url'); if (parent::getBlob($dir, $file, 'azure_tmp_url/' . $newname)) { $this->delete($url); $oldblobname = explode('/', $file); $newUrl = str_replace(end($oldblobname), $newname, $url); $this->addBlob($newUrl, 'azure_tmp_url/' . $newname); exec('rm -rf azure_tmp_url'); return true; } } catch (ServiceException $ex) { return false; } }
/** * Download from the Azure cloud the blob in the container * @param string $destinationFilename * @param string $path is the container * @return boolean */ public function get($path, $destinationFilename = null) { return parent::getBlob($path, '', $destinationFilename); }