WhatLoaded?!
WhatLoaded is essentially a autoloader hook that listens for autoload calls and registers all classes that is loaded via autoloader.
It is later possible to analyze this data to get insight on dependencies and whatever other metrics you could extract from this., (*1)
Installation
composer require addvilz/what_loaded
, (*2)
Usage
IMPORTANT: WhatLoaded::start
must be invoked AFTER any other autoload handlers are registered.
For example, if you are using composer, you must invoke WhatLoaded::start
after require '/vendor/autoload.php'
., (*3)
Rendering stats manually
\Addvilz\WhatLoaded\WhatLoaded::start();
// ... code
\Addvilz\WhatLoaded\WhatLoaded::render();
Retrieving collected data
\Addvilz\WhatLoaded\WhatLoaded::start();
// ... code
$data = \Addvilz\WhatLoaded\WhatLoaded::collect();
Rendering stats on shutdown
\Addvilz\WhatLoaded\WhatLoaded::start();
\Addvilz\WhatLoaded\WhatLoaded::renderOnShutdown();
// ... code
License
Licensed under terms and conditions of Apache 2.0 license., (*4)