statflo/php-http

HTTP package for statflo php projects

1.4.1 2022-07-02 20:21 UTC

This package is auto-updated.

Last update: 2024-03-30 00:18:26 UTC


README

installation

composer.json

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

Usage

web/index.php

<?php

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'],
        ],
    ]
]);