PHP code example of bear / devtools

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

    

bear / devtools example snippets


use BEAR\Dev\Halo\HaloModule;
use Ray\Di\AbstractModule;

class DevModule extends AbstractModule
{
    protected function configure(): void
    {
        $this->install(new HaloModule($this));
    }
}

use BEAR\Dev\Http\HttpResource;

// Start server and create HTTP client
$resource = new HttpResource('127.0.0.1:8099', '/path/to/index.php', '/path/to/curl.log');

// Make HTTP requests
$ro = $resource->get('/users');
assert($ro->code === 200);

$ro = $resource->post('/users', ['name' => 'John', 'email' => '[email protected]']);
assert($ro->code === 201);