GithubHelp home page GithubHelp logo

Comments (6)

jeskew avatar jeskew commented on May 29, 2024

Is MyApp\PromoBundle\EndpointProvider autoloadable by composer?

from aws-sdk-php-symfony.

mcsouto avatar mcsouto commented on May 29, 2024

I think so

composer.json
`"autoload": {
"psr-4": {
"MyApp\PromoBundle": "src/MyApp/PromoBundle/",
"MyApp\UserBundle": "src/MyApp/UserBundle/",
"MyApp\PromoBundle\EndpointProvider":"src/MyApp/PromoBundle/EndpointProvider/",
"AppBundle": "src/AppBundle/"},
"files": [ "app/AppKernel.php" ]
},

`

from aws-sdk-php-symfony.

jeskew avatar jeskew commented on May 29, 2024

Do you get the same error if you run a script like the following in your project root?

<?php

require 'vendor/autoload';

var_dump(MyApp\PromoBundle\EndpointProvider::getEndPoint(['region' => 'us-east-1']));

from aws-sdk-php-symfony.

mcsouto avatar mcsouto commented on May 29, 2024

First, I change "app\config\services.yml" with a value for the key "endpoint". If not, I cannot run the application.

aws_s3.client:
    class: Aws\S3\S3Client
    factory_class: Aws\S3\S3Client
    factory_method: 'factory' 
    arguments: 
        options:
            region: '%aws.region%'
            version: '%aws.version%'
            base_url: '%aws.base_url%'
            endpoint: '%aws.base_url%'
            endpoint_provider: MyApp\PromoBundle\EndpointProvider::getEndPoint
            credentials:
                key: %aws.key%
                secret: %aws.secret%

Then, I could run the application and request test.1.php

<?php

require '../vendor/autoload.php';

var_dump(MyApp\PromoBundle\EndpointProvider::getEndPoint(['region' => 'us-east-1']));

Dump:

C:\_proyectos\TestAws\public\test.1.php:5:
array (size=1)
  'endpoint' => string 'us-east-1.example.com' (length=21)

Thank you

from aws-sdk-php-symfony.

jeskew avatar jeskew commented on May 29, 2024

I was able to reproduce this on OS X with PHP 5.6.17, where supplying '\Fully\Namespaced\Class::staticMethod' produced a fatal error, whereas ['\Fully\Namespaced\Class', 'staticMethod'] did not. php.net states that both forms should work, but that does not seem to be the case on all systems.

The SDK invokes the endpoint provider by assigning it to a variable ($provider) and calling $result = $provider($args);, so I don't believe this is an issue with the SDK.

from aws-sdk-php-symfony.

mcsouto avatar mcsouto commented on May 29, 2024

Arg! ok , now all works correctly .
thanks all

from aws-sdk-php-symfony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.