当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Service_Amazon_S3::registerStreamWrapper方法代码示例

本文整理汇总了PHP中Zend_Service_Amazon_S3::registerStreamWrapper方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_Amazon_S3::registerStreamWrapper方法的具体用法?PHP Zend_Service_Amazon_S3::registerStreamWrapper怎么用?PHP Zend_Service_Amazon_S3::registerStreamWrapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Service_Amazon_S3的用法示例。


在下文中一共展示了Zend_Service_Amazon_S3::registerStreamWrapper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(array $config)
 {
     if (empty($config['bucket'])) {
         throw new Storage_Service_Exception('No bucket specified');
     }
     $this->_bucket = $config['bucket'];
     $this->_internalService = new Zend_Service_Amazon_S3($config['accessKey'], $config['secretKey'], $config['region']);
     if (!empty($config['path'])) {
         $this->_path = $config['path'];
     } else {
         $this->_path = 'public';
     }
     if (!empty($config['baseUrl'])) {
         $this->_baseUrl = $config['baseUrl'];
         unset($config['baseUrl']);
         // Add http:// if no protocol
         if (false === strpos($this->_baseUrl, '://')) {
             $this->_baseUrl = 'http://' . $this->_baseUrl;
         }
     }
     // Should we register the stream wrapper?
     $this->_streamWrapperName = 's3' . (int) @$config['service_id'];
     $this->_internalService->registerStreamWrapper($this->_streamWrapperName);
     parent::__construct($config);
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:25,代码来源:S3.php

示例2: indexAction

 public function indexAction()
 {
     $s3 = new Zend_Service_Amazon_S3('AKIAJ5HTOSBB7ITPA6VQ', 'n8ZjV8xz/k/FxBGhrVduYlSXVFFmep7aZJ/NOsoj');
     $this->view->buckets = $s3->getBuckets();
     $bucketName = 'vaultman';
     $ret = $s3->getObjectsByBucket($bucketName);
     $this->view->objects = $ret;
     $this->view->form = new Mybase_Form_Files();
     $formData = $this->getRequest()->getPost();
     if ($this->_request->isPost()) {
         $s3->registerStreamWrapper("s3");
         //file_put_contents("s3://".$bucketName."/".$_FILES['img']['name'], fopen($_FILES['img']['tmp_name'], 'r'));
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $adapter->setDestination("s3://" . $bucketName . "/");
         //$adapter->receive();
     }
 }
开发者ID:besters,项目名称:My-Base,代码行数:17,代码来源:FilesController.php


注:本文中的Zend_Service_Amazon_S3::registerStreamWrapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。