Symfony external library - Payone

547 Views Asked by At

Has anybody ever used Symfony in conjunction with payone(payone.de)?

I got the SDK and it has the folders js, locale and php.

My problem: I don't really know how to include/use them in my project(inexperienced in Symfony) because I don't know where I should place it and how to include it. I read about the auto loader but since the SDK doesn't follow the standards needed(concerning folder structure) I guess it's not the way to go.

1

There are 1 best solutions below

5
On BEST ANSWER

You can autoload all classes with the psr-0 too if the classes are following the PEAR-style non-namespaced convention.

To manage the vendor download via composer, you can define a package in your composer.json directly.

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "payone/php-sdk",
                "version": "1.0.0",
                "dist": {
                    "url": "http://github.com/PAYONE/PHP-SDK/archive/master.zip",
                    "type": "zip"
                },
                "autoload": {
                    "psr-0": { "Payone_": "php/" }
                }
            }
        }
    ],
    "require": {
        "payone/php-sdk": "1.0.*"
    }
}

Note: This repository type has a few limitations and should be avoided whenever possible:

  • Composer will not update the package unless you change the version field.