PHPackages                             fishingboy/madump - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fishingboy/madump

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fishingboy/madump
=================

Magento Data Object Dump Tool

1.1.3(4y ago)055[3 issues](https://github.com/fishingboy/MaDump/issues)MITPHP

Since Sep 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fishingboy/MaDump)[ Packagist](https://packagist.org/packages/fishingboy/madump)[ RSS](/packages/fishingboy-madump/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (1)Versions (14)Used By (0)

MaDump
======

[](#madump)

為什麼需要 MaDump ?
--------------

[](#為什麼需要-madump-)

因為 Magento 的物件如果直接用 var\_dump() 或是 print\_r() ，都會出現記憶體不足的錯誤，所以寫了一個 dump 工具只 dump 出物件的第一層方便開發。

安裝
--

[](#安裝)

```
composer require fishingboy/madump
```

使用方法
----

[](#使用方法)

1. 直接輸出

    ```
    use Fishingboy\MaDump\MaDump;
    MaDump::dump($product);
    ```

    Output:

    ```

    Magento\Catalog\Model\Product\Interceptor
        ->addAttributeUpdate($code, $value, $store)
        ->addCustomOption($code, $value, $product)
        ->addData(array $arr)
        ->addImageToMediaGallery($file, $mediaAttribute, $move, $exclude)
        ->addOption(Magento\Catalog\Model\Product\Option $option)
        ->afterCommitCallback()
        ->afterDelete()
        ->afterDeleteCommit()
        ->formatUrlKey($str)
        ->fromArray(array $data)
        ->getAttributeDefaultValue($attributeCode)
        ->getAttributeSetId() : 16 (string)
        ->getAttributeText($attributeCode)
        ->getAttributes($groupId, $skipSuper)
        ->getAvailableInCategories() : array
        ->getCacheIdTags() : array
        ->getCacheTags() : array
        ->getCalculatedFinalPrice() :  (NULL)
        ->getCategory() :  (NULL)
        ->getCategoryCollection() : Magento\Catalog\Model\ResourceModel\Category\Collection\Interceptor
        ...

    ```
2. 記在 Log (把 output 內容 return 回來)

    ```
    use Fishingboy\MaDump\MaDump;
    $product_dump = MaDump::dump($product, true);
    $this->_logger->info("product => " . $product_dump);
    ```
3. 有時候可能需要直接中斷執行，請直接用 exit

    ```
    use Fishingboy\MaDump\MaDump;
    MaDump::dump($product);
    exit;
    ```
4. 通常 Trace Code 的時候過程會長這樣

    step.1

    ```
    MaDump::dump($product);
    ```

    step.2

    ```
    MaDump::dump($product->getCustomAttributes());
    ```

    step.3

    ```
    MaDump::dump($product->getCustomAttributes()[0]);
    ```

    自己在程式一層一層往下去找

Output 說明
---------

[](#output-說明)

1. 如果是物件

    ```

    Magento\Catalog\Model\Product\Interceptor
        ->addAttributeUpdate($code, $value, $store)
        ->addCustomOption($code, $value, $product)
        ->addData(array $arr)
        ->addImageToMediaGallery($file, $mediaAttribute, $move, $exclude)
        ->addOption(Magento\Catalog\Model\Product\Option $option)
        ->afterCommitCallback()
        ->afterDelete()
        ->afterDeleteCommit()
        ->formatUrlKey($str)
        ->fromArray(array $data)
        ->getAttributeDefaultValue($attributeCode)
        ->getAttributeSetId() : 16 (string)
        ->getAttributeText($attributeCode)
        ->getAttributes($groupId, $skipSuper)
        ->getAvailableInCategories() : array
        ->getCacheIdTags() : array
        ->getCacheTags() : array
        ->getCalculatedFinalPrice() :  (NULL)
        ->getCategory() :  (NULL)
        ->getCategoryCollection() : Magento\Catalog\Model\ResourceModel\Category\Collection\Interceptor
        ...

    ```

    如果是 getter method 而且不需要帶參數的話，會直接把呼叫後的值秀出來看，像這樣：

    ```
        ->getAttributeSetId() : 16 (string)
        ->getCategoryCollection() : Magento\Catalog\Model\ResourceModel\Category\Collection\Interceptor
        ->getCacheIdTags() : array
    ```
2. 如果是陣列

    ```

    Array(52) =>
    [0] => (Magento\Framework\Api\AttributeValue)
    [10] => (Magento\Framework\Api\AttributeValue)
    [11] => (Magento\Framework\Api\AttributeValue)
    [12] => (Magento\Framework\Api\AttributeValue)
    ...

    ```

    或是這樣

    ```

    Array(2) =>
    [0] => 101
    [1] => 102

    ```
3. 如果只是一般的值

    ```
    1 (integer)
    ```

    ```
    true (boolean)
    ```

    ```
    sku-123 (string)
    ```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~0 days

Total

13

Last Release

1509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45bf9bc379ef669c12d4f474f48d65b40cc371652e668ec213954817a048309d?d=identicon)[fishingboy](/maintainers/fishingboy)

---

Top Contributors

[![fishingboy](https://avatars.githubusercontent.com/u/4921524?v=4)](https://github.com/fishingboy "fishingboy (49 commits)")

---

Tags

magentovar\_dumpdd

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fishingboy-madump/health.svg)

```
[![Health](https://phpackages.com/badges/fishingboy-madump/health.svg)](https://phpackages.com/packages/fishingboy-madump)
```

###  Alternatives

[mage2tv/magento-cache-clean

This package has been migrated to mage-os/magento-cache-clean. Please switch over at your convenience.

5432.1M3](/packages/mage2tv-magento-cache-clean)[magento/magento-composer-installer

Composer installer for Magento modules

7523.3M318](/packages/magento-magento-composer-installer)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[magento-hackathon/magento-composer-installer

Composer installer for Magento modules

214757.6k374](/packages/magento-hackathon-magento-composer-installer)[yireo/magento2-googletagmanager2

Add Google Tag Manager to Magento

167930.4k5](/packages/yireo-magento2-googletagmanager2)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
