Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
require_once __DIR__ . '/vendor/autoload.php';
define('KINT_LOG', '/vagrant/logs/kint.log.html');
/**
* Logs Kint::dump() to file
*/
function l()
{
if ( !Kint::enabled() ) return;
$args = func_get_args();
foreach ($args as $arg) {
$dump = @Kint::dump($arg);
$content = sprintf('%s:<br />%s', date('Y-m-d H:i:s'), $dump);
file_put_contents(KINT_LOG, $content);
}
}
/**
* Logs Kint::dump() to file
* [!!!] IMPORTANT: execution will halt after call to this function
*/
function ld()
{
if ( !Kint::enabled() ) return;
$args = func_get_args();
call_user_func_array('l', $args);
die;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.