statflo / php-http
statflo php项目的HTTP包
1.4.1
2022-07-02 20:21 UTC
Requires
- silex/silex: >=1.3
- statflo/php-di: >=1.2 <2.0
README
安装
composer.json
{ "require": { /* ... */ "statflo/php-http": "dev-master", } }
使用方法
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'], ], ] ]);