1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- $params = array_merge(
- require __DIR__ . '/../../common/config/params.php',
- require __DIR__ . '/../../common/config/params-local.php',
- require __DIR__ . '/params.php',
- require __DIR__ . '/params-local.php'
- );
- return [
- 'id' => 'app-api',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log'],
- 'modules' => [
- 'v1' => [
- 'class' => 'api\modules\v1\Module'
- ]
- ],
- 'controllerNamespace' => 'api\controllers',
- 'components' => [
- 'user' => [
- 'identityClass' => 'common\models\User',
- 'enableAutoLogin' => false, // API change to false
- 'enableSession' => false, // API ++
- 'loginUrl' => null // API ++
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- ],
- ],
- ],
- 'request' => [
- 'class' => '\yii\web\Request',
- 'enableCookieValidation' => false,
- 'parsers' => [
- 'application/json' => 'yii\web\JsonParser',
- ],
- 'cookieValidationKey' => 'O1d232trde1xww-M97_7QvwPo-5QGdkLMp#@#@',
- ],
- 'errorHandler' => [
- 'errorAction' => 'site/error',
- ],
- 'urlManager' => [
- 'class' => 'yii\web\UrlManager',
- 'enablePrettyUrl' => true,
- 'enableStrictParsing' => true,
- 'showScriptName' => false,
- 'rules' => [
- '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
- '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
- '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
- // '' => 'site/index',
- // ['class' => 'yii\rest\UrlRule', 'controller' => 'customer/api',
- // 'pluralize' => false,
- // ],
- // # 定义方法: public function actionSearch($id); <id> 就是search方法传入的参数
- // # http://10.10.10.252:599/v1/wishorder/2015-08-11+12:12:12/2015-09-11+12:12:12?access-token=pBJi3hyFsLsTuvUM9paFpWjYRatn3qwS
- // # 分页:http://10.10.10.252:599/v1/wishorder/2015-08-11+12:12:12/2015-09-11+12:12:12?page=2&access-token=pBJi3hyFsLsTuvUM9paFpWjYRatn3qwS
- // 'GET v1/wishorder/<begin_datetime>/<end_datetime>' => 'v1/wishorder/viewbydate',
- // 'GET v1/ebayorder/<begin_datetime>/<end_datetime>' => 'v1/ebayorder/viewbydate',
- ]
- ],
- 'db' => require __DIR__ . '/../../common/config/db.php'
- ],
- 'params' => $params,
- ];
|