addvilz/what_loaded

确定在执行期间加载了哪些包、类和供应商

dev-master 2015-08-03 16:07 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:27:18 UTC


README

WhatLoaded本质上是一个自动加载钩子,它监听自动加载调用并注册通过自动加载加载的所有类。之后可以分析这些数据以了解依赖关系以及其他可以从这些数据中提取的指标。

安装

composer require addvilz/what_loaded

使用

重要: WhatLoaded::start必须在注册任何其他自动加载处理程序之后调用。例如,如果您使用composer,必须在调用require '/vendor/autoload.php'之后调用WhatLoaded::start

手动渲染统计数据

    \Addvilz\WhatLoaded\WhatLoaded::start();
    // ... code
    \Addvilz\WhatLoaded\WhatLoaded::render();

检索收集到的数据

    \Addvilz\WhatLoaded\WhatLoaded::start();
    // ... code
    $data = \Addvilz\WhatLoaded\WhatLoaded::collect();

在关闭时渲染统计数据

    \Addvilz\WhatLoaded\WhatLoaded::start();
    \Addvilz\WhatLoaded\WhatLoaded::renderOnShutdown();
    // ... code

许可证

根据Apache 2.0许可证的条款和条件许可。