A
A
Ann20162016-10-16 15:54:20
PHP
Ann2016, 2016-10-16 15:54:20

Connecting a package without a namespace, how?

How to include a package in a project that doesn't have a namespace, more precisely how to make it usable for a laravel project.
serj1chen/way-for-pay-sdk-php - this package is interesting.
connected it via composer.json

"type": "package",
            "package": {
                "name": "serj1chen/way-for-pay-sdk-php",
                "version": "dev-master",
                "source": {
                    "url": "https://github.com/serj1chen/way-for-pay-sdk-php.git",
                    "type": "git",
                    "reference": "origin/master"
                }
            }

but how to use it correctly in the project is not very clear, I will be very grateful for the answers

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Ann2016, 2016-10-16
@Ann2016

You need to set the path to the class

"autoload": {
        "classmap": [
            "vendor/serj1chen/way-for-pay-sdk-php/WayForPay.php"
        ]
    },

S
Sergey Semenko, 2016-10-16
@abler98

Make fork and rewrite under namespace`s.

D
Denis, 2016-10-16
@prototype_denis

In the package section, add autoload files.

"autoload": {
  "files": [
     ...
  ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question