1. Go to this page and download the library: Download dockcodes/dock-thor 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/ */
dockcodes / dock-thor example snippets
use function Dock\Thor\init;
init([
'token' => 'PROJECT_TOKEN',
'private_key' => 'PROJECT_PRIVATE_KEY',
'url' => 'https://thor.dock.codes',
'environment' => 'production',
'release' => '1.4.0',
]);
use Dock\Thor\Framework\HttpTransaction;
$transaction = HttpTransaction::start('GET /checkout', $url, 'GET');
$transaction->measureHandling('app.handle');
// ... handle the request ...
$transaction->finish($response->getStatusCode());
use Dock\Thor\Browser\BrowserEvent;
use Dock\Thor\Browser\Collector;
// Rendering the page: point the collector at your own endpoint.
$config = Collector::config(endpoint: '/errors/browser', token: $csrfToken);
// Collector::scriptPath() is the file to serve or enqueue.
// Receiving a report: everything in $payload is untrusted.
$event = BrowserEvent::fromArray($payload, $referer, $userAgent);
if ($event !== null) {
$hub->captureEvent($event);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.