D
D
Denis2019-11-01 22:07:56
PHP
Denis, 2019-11-01 22:07:56

I don’t understand how to connect the library through composer?

I'm starting to get acquainted with composer and trying to connect the library. I loaded the composer require php-ds/php-ds package via composer , created a file in src, included autoload

require_once  __DIR__ . '/../vendor/autoload.php';

use DS\Stack;

$a = new Stack();

writes the error Uncaught Error: Class 'DS\Stack' not found
composer dump-autoload --optimize wrote
... what's wrong?
json
{
    "require": {
        "php-ds/php-ds": "^1.2"
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid, 2019-11-02
@caballero

try use \DS\Stack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question