找不到类CreateBlobOptions

时间:2015-03-11 18:19:14

标签: php azure azure-cdn

我试图使用azure cdn服务,我在以下代码中遇到此错误,我已经到处搜索但我没有在互联网或官方天蓝色git呼吸中找到CreateBlobOption类或者在他们的网站上,帮助我,我坚持下去

<?php
    require_once __DIR__.'/vendor/autoload.php';
    use WindowsAzure\Common\ServicesBuilder;
    use WindowsAzure\Common\ServiceException;


    $connectionString = 'DefaultEndpointsProtocol=http;AccountName=myaccount;AccountKey=my_key';
    $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
    $content = fopen('my_file.jpg','r');
    $blob_name = 'my_file.jpg';
    $options = new CreateBlobOptions();
    $options->setBlobContentType('image/jpeg');
    try
    {
        $blobRestProxy->createBlockBlob("images", $blob_name, $content,$options);
    }
    catch(ServiceException $e)
    {
        $code = $e->getCode();
        $error_message = $e->getMessage();
        echo $code.": ".$error_message."<br />";
    }

2 个答案:

答案 0 :(得分:1)

您可以在SDK安装中的CreateBlobOptions文件夹下找到WindowsAzure\Blob\Models课程。链接到源代码:https://github.com/Azure/azure-sdk-for-php/blob/master/WindowsAzure/Blob/Models/CreateBlobOptions.php

答案 1 :(得分:1)