Drupal模块Azure Blob损坏的映像


Drupal module Azure Blob broken images

我刚刚开始用Azure构建Drupal站点。我安装了Azure Blob模块,一切正常(本地环境),包括显示图像和将图像上传到存储Blob。但是,在将站点和数据库部署到临时服务器之后,所有映像都会被破坏。我确保这些图片是存在的,因为我在本地工作时上传了它们。我找不到实际问题是什么。

该模块已经有一段时间没有更新了,我花了一些时间仔细研究该模块的代码,但没有成功。我想知道是否有人遇到过类似的问题,也许可以为我指明正确的方向。提前谢谢。

我终于弄清楚了问题是什么。当所有东西都部署到Azure时,我无法显示或上传图像,不确定确切的问题是什么,我通过逐一排除可能的原因进行了试错。这一切都归结为对模块本身进行更改。在文件"azure_blob.streamwrappers.inc"中,转到函数createStorageClient。您需要在配置中指定Blob端点。

if (!isset(self::$clients[$scheme])) {
  // Obtain user configuration from database
  $configuration = ctools_export_crud_load('azure_blob', $scheme);
  if (isset($configuration)) {
    // @todo Use shared access signature to specify a specific blob endpoint
    $connection_string = 'DefaultEndpointsProtocol=https;AccountName=' .
      $configuration->account . ';AccountKey=' . $configuration->primary_key . ';BlobEndpoint=http://[StorageName].blob.core.windows.net/';
    self::$clients[$scheme] = 
      ServicesBuilder::getInstance()->createBlobService($connection_string);
    // Store other configuration properties in client object
    self::$clients[$scheme]->blob_container = $configuration->blob_container;
    self::$clients[$scheme]->cache_control = $configuration->cache_control;
  }
  else {
    throw new Exception(t('Invalid storage scheme "@stream"', array('@stream' => $scheme)));
  }
}
return self::$clients[$scheme];

我希望这对将来遇到同样问题的人有所帮助。两天来,我一直在努力寻找解决方案:)