fedemotta/yii2-appnexusapiclient
为yii2框架的AppNexus API客户端
v1.2
2015-04-25 05:58 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-14 16:29:31 UTC
README
此扩展为Yii2框架提供了AppNexus API客户端集成。
安装
安装此扩展的首选方法是通过composer。
运行以下命令:
php composer.phar require --prefer-dist fedemotta/yii2-appnexusapiclient "*"
或
"fedemotta/yii2-appnexusapiclient": "*"
将以下内容添加到您的composer.json
文件的require部分。
使用方法
要使用此扩展,只需在您的应用程序配置中添加以下代码
return [ //.... 'components' => [ 'appnexusapiclient' => [ 'class' => 'fedemotta/appnexusapiclient/AppNexusApiClient', 'username' => 'yourusername', 'password' => 'yourpassword', 'host' => 'http://api-console.client-testing.adnxs.net/', //or http:://api.appnexus.com 'storage_type' => 'Apc', //available token storage are Array, Apc and Memcached 'storage_type_settings' => ['prefix_',0], //specifies the storage type settings ], ], ];
从AppNexus获取用户
$users = Yii::$app->appnexusapiclient->get('/user');
修改AppNexus中的发布者名称
Yii::$app->appnexusapiclient->put('/publisher?id=1',["publisher"=>["name"=>"The new name"]]);