Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
development:php [2020/03/03 13:01] kalenpw [PSR4 Autoloading] |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== PHP ====== | ||
| - | * [[.php : laravel | Laravel ]] | ||
| - | * [[.php : xdebug | Xdebug ]] | ||
| - | ---- | ||
| - | ===== PSR4 Autoloading ===== | ||
| - | add the following to '' | ||
| - | <code json> | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | '' | ||
| - | eg: | ||
| - | <code php> | ||
| - | namespace App\Util\Whatever; | ||
| - | </ | ||
| - | |||
| - | Now generate autoload.php | ||
| - | <code bash> | ||
| - | composer dump-autoload -o | ||
| - | </ | ||
| - | |||
| - | In core PHP file include '' | ||
| - | <code php> | ||
| - | require_once(' | ||
| - | </ | ||
| - | |||
| - | Then simply give each file a namespace matching its directory and '' | ||