PHP code example of statflo / php-http

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

    

statflo / php-http example snippets




use Statflo\HTTP\Main;

//$app = Silex\Application;

Main::run($app ?: null, [
    'debug'       =>  (bool) getenv('PHP_APP_DEBUG'),
    'session'     => $_SESSION,
    'config_path' => dirname(__FILE__) . "/../config",
    'parameters'  => [
    ],
    'controllers' => [
        "/api/accounts"       => [
            ['method' => 'get',  'class' => Statflo\Controller\Crm\Accounts::class, 'id' => 'statflo.controller.crm.accounts:findAll'],
        ],
        "/api/accounts/merge" => [
            ['method' => 'post', 'class' => Statflo\Controller\Crm\Accounts::class, 'id' => 'statflo.controller.crm.accounts:merge'],
        ],
    ]
]);

json

{
    "... */
        "statflo/php-http": "dev-master",
    }
}