定制 lnc/azure-file-service 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lnc/azure-file-service

最新稳定版本:0.0.7

Composer 安装命令:

composer require lnc/azure-file-service

包简介

File Service for Microsoft Azure SDK for PHP

README 文档

README

File Service for Microsoft Azure SDK for PHP

Getting Started

##Install via Composer

  1. Create a file named composer.json in the root of your project and add the following code to it:
{
  "require": {
    "lnc/azure-file-service": "^0"
  },
  "repositories":      [
    {
      "type": "pear",
      "url":  "http://pear.php.net"
    }
  ],
  "minimum-stability": "dev"
}

Usage

Getting Started

<?php
    require_once __DIR__ . '/vendor/autoload.php';
    use WindowsFileService\Common\ServicesBuilder;
    use WindowsFileService\Facade;

    $accountName = '';
    $accountKey  = '';
    $isSecure    = true;

    $connectionString = sprintf(
            'DefaultEndpointsProtocol=%s;AccountName=%s;AccountKey=%s',
            $isSecure
                    ? 'https'
                    : 'http',
            $accountName,
            $accountKey
    );
    
### USING FACADE    
    
    $result = new Facade( $connectionString );
    $result->uploadFile(
           'test',
           'test',
           'test.dat',
           '/home/test.dat'
    );
    
### DIRECTLY            

    $fileRestProxy = ServicesBuilder::getInstance()
                                    ->createFileService( $connectionString );


    $result = $fileRestProxy->createShare(
                                'test'
    );
    
    $result = $fileRestProxy->createDirectory(
                                'test',
                                'test'
    );
        
    $result = $fileRestProxy->createFile(
                            'test',
                            'test',
                            'test.txt',
                            4
    );
    
    $result = $fileRestProxy->createFileContents(
                                'test',
                                'test',
                                'test.txt',
                                'test'
    );
    
    OR

    $result = $fileRestProxy->createFileRange(
                            'test',
                            'test',
                            'test.txt',
                            new \WindowsFileService\File\Models\FileRange( 0, 3 ),
                            'test'
    );
    

统计信息

  • 总下载量: 16.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-25