dongzuan4917
2015-01-19 20:33
浏览 43
已采纳

使用作曲家安装后使用Zend Service Amazon S3 - Zend Framework 2.3

I just installed Zend Service Amazon 2.0.3 with composer.

Amazon Packagist here

Composers worked fine and the S3's dir is:

vendor:
------>zendframework:
------------->zendservice-amazon:
---------------------------->library:
---------------------------------->ZendService:
---------------------------------------------->Amazon:
------------------------------------------------------>S3:

within autoload_namespaces.php file:

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Zend\\' => array($vendorDir . '/zendframework/zendframework/library'),
    'ZendXml' => array($vendorDir . '/zendframework/zendxml/library'),
    'ZendService\\Amazon\\' => array($vendorDir . '/zendframework/zendservice-amazon/library'),
    'ZendRest' => array($vendorDir . '/zendframework/zendrest/library'),
);

I don't understand to use S3 class. I tried to use:

$s3 = new ZendService\Amazon\S3($k1, $k2);

or

use ZendService\Amazon;
$s3 = new ZendService\Amazon\S3($k1, $k2);

or

use ZendService\Amazon\S3;
$s3 = new Amazon\S3($k1, $k2);

or

use ZendService\Amazon\S3;
$s3 = new S3($k1, $k2);

but the errors are like this:

Fatal error: Class 'ZendService\Amazon\S3' not found in C:\Program Files (x86)\xampp\htdocs\my-site\module\Upload\src\Upload\Controller\UploadController.php on line 38

how can I use S3 class?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dory4404 2015-01-20 10:22
    已采纳

    I done it

    $s3 = new \ZendService\Amazon\S3\S3($AccKey, $SecrKey);
    

    but I don't doing anything! example,

    $s3->createBucket('my-bucket-name-is-secret', 'eu-central-1');
    

    apparently doesn't appear any error, but if I check in my s3's console, there isn't any bucket.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题