Skip to main content
deleted 130 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

An even more in depth article can be found here on WPKrauts.

EDIT The obviously correct way is to use namespaced code, prepared for PSR-4 autoloading by putting everything in the appropriate directory that already is defined via the namespace. Then just use Composer and a composer.json to manage your dependencies and let it auto-build your PHP autoloader (that imports automatically a file by just calling use \<namespace>\ClassName). That's the de-facto standard in the PHP world, the easiest way to go and even more pre-automated and simplified by WP Starter.

An even more in depth article can be found here on WPKrauts.

EDIT The obviously correct way is to use namespaced code, prepared for PSR-4 autoloading by putting everything in the appropriate directory that already is defined via the namespace. Then just use Composer and a composer.json to manage your dependencies and let it auto-build your PHP autoloader (that imports automatically a file by just calling use \<namespace>\ClassName). That's the de-facto standard in the PHP world, the easiest way to go and even more pre-automated and simplified by WP Starter.

EDIT The obviously correct way is to use namespaced code, prepared for PSR-4 autoloading by putting everything in the appropriate directory that already is defined via the namespace. Then just use Composer and a composer.json to manage your dependencies and let it auto-build your PHP autoloader (that imports automatically a file by just calling use \<namespace>\ClassName). That's the de-facto standard in the PHP world, the easiest way to go and even more pre-automated and simplified by WP Starter.

Added Composer
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

EDIT The obviously correct way is to use namespaced code, prepared for PSR-4 autoloading by putting everything in the appropriate directory that already is defined via the namespace. Then just use Composer and a composer.json to manage your dependencies and let it auto-build your PHP autoloader (that imports automatically a file by just calling use \<namespace>\ClassName). That's the de-facto standard in the PHP world, the easiest way to go and even more pre-automated and simplified by WP Starter.

EDIT The obviously correct way is to use namespaced code, prepared for PSR-4 autoloading by putting everything in the appropriate directory that already is defined via the namespace. Then just use Composer and a composer.json to manage your dependencies and let it auto-build your PHP autoloader (that imports automatically a file by just calling use \<namespace>\ClassName). That's the de-facto standard in the PHP world, the easiest way to go and even more pre-automated and simplified by WP Starter.

Added link to Krauts article
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

Summed up

An even more in depth article can be found here on WPKrauts.

Summed up

An even more in depth article can be found here on WPKrauts.

extended with newer code
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
Loading
added 591 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
Loading
the -> to
Source Link
Adam
  • 16.5k
  • 1
  • 44
  • 62
Loading
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244
Loading