PHP code example of boatrace / core

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

    

boatrace / core example snippets




oatrace\Core\CoreContainer;

CoreContainer::addDefinitions(__DIR__ . '/definitions.php');



// definitions.php

use Boatrace\Support\Throttler\ThrottlerDispatcher;
use Boatrace\Types\Contracts\Converter\ConverterDispatcher as ConverterDispatcherContract;
use Boatrace\Types\Contracts\Throttler\ThrottlerDispatcher as ThrottlerDispatcherContract;

return [
    ThrottlerDispatcherContract::class => \DI\autowire(ThrottlerDispatcher::class)
        ->constructor(\DI\get(ConverterDispatcherContract::class), 2.0),
];



// definitions.php

use App\MyBrowserObserver;
use Boatrace\Types\Contracts\Browser\BrowserObserver as BrowserObserverContract;

return [
    BrowserObserverContract::class => \DI\autowire(MyBrowserObserver::class),
];