Skip to content

m7-malmir/autoload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup for autoload with composer:
1- run 'composer init' in vscode terminal
2- run 'composer require guzzlehttp/guzzle' in vscode terminal
3- put this command in the index.php file
        $client = new \GuzzleHttp\Client();
        $response = $client->request('GET', 'http://jsonplaceholder.typicode.com/users');

        echo $response->getStatusCode(); // 200
        echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
        echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'

4- run index.php in vscode terminal
5- chech composer.json file 
        "autoload": {
                "psr-4": {"": "./src"}
            }
6- create src folder and put classes there
7- run composer update in vscode terminal
8- run index.php and see every things is ok

About

autoload file with composer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages