S
S
sul_evil2021-12-29 19:16:12
1C-Bitrix
sul_evil, 2021-12-29 19:16:12

How to use Bitrix\Main\Diag\Debug::dumpToFile?

I am doing my work in local/php_interface/init.php and there is a handler there

AddEventHandler("main", "OnBeforeEventSend", "OnBeforeEventAddHandler");
function OnBeforeEventAddHandler(&$event, &$lid, &$arFields){
    if ($event == "SALE_NEW_ORDER") {
        Bitrix\Main\Diag\Debug::dumpToFile($arFields,"arFields","textarr.txt");
    }
}

I want to catch the &$arFields array to see what's in it.
And it seems like dumpToFile should write it to textarr.txt (located in the same directory as init.php), but it's empty, how can I make it work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-12-29
@sul_evil

The path from the site root is indicated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question