PHP code example of michaeljennings / snapshot

1. Go to this page and download the library: Download michaeljennings/snapshot 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/ */

    

michaeljennings / snapshot example snippets


"michaeljennings/snapshot": "0.3.*"

'providers' => array(

  'Michaeljennings\Snapshot\SnapshotServiceProvider'
  
);

'aliases' => array(

  'Snapshot' => 'Michaeljennings\Snapshot\Facades\Snapshot',

);

Snapshot::capture();

public function __construct(Michaeljennings\Snapshot\Contracts\Snapshot $snapshot)
{
    $this->snapshot = $snapshot;
}

'providers' => array(

  'Michaeljennings\Snapshot\Laravel4ServiceProvider'
  
);

'aliases' => array(

  'Snapshot' => 'Michaeljennings\Snapshot\Facades\Snapshot',

);

Snapshot::capture();

public function __construct(Michaeljennings\Snapshot\Contracts\Snapshot $snapshot)
{
    $this->snapshot = $snapshot;
}

// Require the composer autoload
ig = ore = new $config['store']['class']($config);
$renderer = new $config['renderer'];
$dispatcher = new \Michaeljennings\Snapshot\Dispatcher(new \League\Event\Emitter());

// Create the snapshot class
$snapshot = new Snapshot($store, $renderer, $dispatcher, $config);

$snapshot = new Snapshot($store, $renderer, $dispatcher, $config);

$snapshot->capture();

$snapshot->capture(['user_id' => 1]);
 
$snapshot->captureException($exception);

$snapshot->captureException($exception, 500, 'Internal Server Error', ['user_id' => 1]);

$snapshot->render(1);

$snapshot->find(1);

'listeners' => [

    'Michaeljennings\Snapshot\Events\SnapshotCaptured' => [
        'Michaeljennings\Snapshot\Listeners\SendToSlack',
        'MyCustomListener'
    ]

]

$snapshot->addListener('Michaeljennings\Snapshot\Events\SnapshotCaptured', 'Michaeljennings\Snapshot\Listeners\SendToSlack');

$snapshot->addListener('Michaeljennings\Snapshot\Events\SnapshotCaptured', function($event) {
    // Handle event
});