Permalink
Browse files

Fix S3 w. sdk v2

  • Loading branch information...
1 parent 291836f commit 8bec170a62012437181141e036fe633ba6cecda3 @cdujeu cdujeu committed Jun 28, 2016
@@ -27,7 +27,7 @@
*/
namespace Pydio\Access\Driver\StreamProvider\S3;
-use Aws\S3\S3Client;
+use \Aws\S3\S3Client;
use Guzzle\Common\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -34,6 +34,9 @@
require_once(AJXP_INSTALL_PATH . "/plugins/access.fs/FsAccessWrapper.php");
+require_once("aws.phar");
+
+
/**
* Encapsulation of the PEAR webDAV client
* @package AjaXplorer_Plugins
@@ -51,7 +54,7 @@ class S3AccessWrapper extends FsAccessWrapper
*/
protected static function getClientForContext(ContextInterface $ctx, $registerStream = true)
{
- require_once("aws.phar");
+
$repoObject = $ctx->getRepository();
if (!isSet(self::$clients[$repoObject->getId()])) {
// Get a client
@@ -94,7 +97,7 @@ protected static function getClientForContext(ContextInterface $ctx, $registerSt
]);
$s3Client->registerStreamWrapper($repoObject->getId());
} else {
- $s3Client = Aws\S3\S3Client::factory($options);
+ $s3Client = \Aws\S3\S3Client::factory($options);
if ($repoObject->getContextOption($ctx, "VHOST_NOT_SUPPORTED")) {
// Use virtual hosted buckets when possible
require_once("ForcePathStyleListener.php");
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ajxpdriver name="s3" label="CONF_MESSAGE[S3 (Amazon Web Service)]" description="CONF_MESSAGE[Access an AWS server. Requires AWS-SDK v2 for PHP]" mixins="filesystem_commons,slug_provider,template_provider" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
- <class_definition filename="plugins/access.s3/class.s3AccessDriver.php" classname="Pydio\Access\Driver\StreamProvider\S3\s3AccessDriver"/>
+ <class_definition filename="plugins/access.s3/S3AccessDriver.php" classname="Pydio\Access\Driver\StreamProvider\S3\S3AccessDriver"/>
<client_settings icon="plugins/access.fs/icon.png" description_template="{REGION}{STORAGE_URL}/{CONTAINER}" iconClass="icon-sitemap">
<resources>
<i18n namespace="s3_access" path="plugins/access.s3/i18n"/>
@@ -30,5 +30,5 @@
<dependencies>
<pluginClass pluginName="access.fs"/>
</dependencies>
- <class_stream_wrapper filename="plugins/access.s3/class.s3AccessWrapper.php" classname="Pydio\Access\Driver\StreamProvider\S3\s3AccessWrapper" protocol="ajxp.s3"/>
+ <class_stream_wrapper filename="plugins/access.s3/S3AccessWrapper.php" classname="Pydio\Access\Driver\StreamProvider\S3\S3AccessWrapper" protocol="ajxp.s3"/>
</ajxpdriver>

0 comments on commit 8bec170

Please sign in to comment.