PHP code example of pedrotroller / trace-debug

1. Go to this page and download the library: Download pedrotroller/trace-debug library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pedrotroller / trace-debug example snippets


class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            // ...
            $bundles[] = new PedroTroller\TraceDebug\Bundle\TraceDebugBundle();
        }

        return $bundles;
    }
}

class SomeClass
{
    public function someFunction() {
        // ...
        trace();
        // ...
    }
}

class SomeClass
{
    public function someFunction() {
        // ...
        trace('capture1');
        // ...
    }

    public function someOtherFunction() {
        // ...
        trace('capture2');
        // ...
    }
}