Contents

PHP Composer Autoload

Composer

This is a package manager in PHP.
The official site is a here

Initialize Composer

1
composer init

Configuration composer.json

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "name": "<vendor>/<name>",
  "type": "<type>",
  "authors": [
    {
      "name": "<name>",
      "email": "<email>"
    }
  ],
  "autoload": {
    "psr-4": {
      "App\\": "<path/to/class>"
    }
  },
  "description": "<description>"
}

Apply Configuration to Composer

1
composer dump-autoload