GithubHelp home page GithubHelp logo

revive-xmlrpc's Introduction

Artistan/Revive-XmlRpc

remote procedure calls - RPC - is a basic API that has existed on Revive since it was OpenX Source. This is a basic update to that system and extracted into a package which can be used in virtually any Php Project to access your Revive server or manage multiple Revive servers. The response data is not exactly pretty for Ads Display, but hopefully I can come up with a version 3 that format the data into a more friendly format.

Revive AdServer xml api

extracted into a package and updated to use packages rather than pear

requires

  • php-xml

uses

SETUP

composer

    "require": {
        "artistan/revive-xmlrpc": "*"
    }

Using The API

phpdoc documentation

Version 2 xml

these examples were tested in Laravel 5.6 Commands

configuration

loads definitions in this order each step will override/replace the previous step

  1. loads /Assets/Config/revive-xmlrpc.php (defaults)
  2. laravel style configs (if function config exists)
  3. constructor array settings (first param can be an array)
  4. constructor individual settings
laravel config/env
php artisan vendor:publish --provider=artistan/revive-xmlrpc

you can edit the config/revive-xmlrpc.php file add these env variables to or .env files

RVRPC_HOST=ads.me.com
RVRPC_BASEPATH=/api/v2/xmlrpc/
RVRPC_USERNAME=admin
RVRPC_PASSWORD=~test~
RVRPC_PORT=0
RVRPC_SSL=1
RVRPC_TIMEOUT=15
use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;
$rpc = new OpenAdsV2ApiXmlRpc();
$list = $rpc->getAgencyList();
custom config initialization

uses ./Assets/Config/revive-xmlrpc.php for config if you do not provide it to the class.

use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;

$config = [
	'host'=>'ads.me.com', 
	'basepath'=>'/www/api/v2/xmlrpc/',
	'username'=>'admin', 
	'password'=>'~test~', 
	'port'=>0, 
	'ssl'=>true, 
	'timeout'=>15
]


$rpc = new OpenAdsV2ApiXmlRpc($config);
$list = $rpc->getAgencyList();
full initialization
use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;
$rpc = new OpenAdsV2ApiXmlRpc('ads.me.com', '/www/api/v2/xmlrpc/', 'admin', '~test~', 0, true, 15);
$list = $rpc->getAgencyList();

API Version 1 xml

use Artistan\ReviveXmlRpc\OpenAdsV1ApiXmlRpc;
$rpc = new OpenAdsV1ApiXmlRpc('ads.me.com', '/www/api/v1/xmlrpc/', 'admin', '~test~', 0, true, 15);
$list = $rpc->getAgencyList();

Ad Display Retrieval xml

        $rpc = new OpenAdsDisplayXmlRpc('ads.me.com', '/www/delivery/axmlrpc.php', 443, true, 15);
        $rpc->setRemoteInfo('remote_addr', 'chuck-dev');
        $list = $rpc->view(
        	/* string    zone */ 'zone:1', 
        	/* int campaignid */ 0, 
        	/* string  target */ '', 
        	/* string  source */ '', 
        	/* 0|1   withText */ 0, 
        	/* array  contect */ [], 
        	/* strubg charset */ ''
		);
        var_dump(json_decode(json_encode($list),true));

PHP-Markdown-Documentation-Generator

./vendor/bin/phpdoc-md generate --ignore=test,examples src > api.md

revive-xmlrpc's People

Contributors

artistan avatar olexandrpopov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

revive-xmlrpc's Issues

Providing array to OpenAdsV2ApiXmlRpc()

Providing an array as first parameter to the OpenAdsV2ApiXmlRpc() constructor is broken:

PHP Notice:  Array to string conversion in vendor/phpxmlrpc/phpxmlrpc/src/Client.php on line 909
PHP Fatal error:  XML-RPC Error (8): CURL error: Could not resolve host: Array in method ox.logon() in vendor/artistan/revive-xmlrpc/src/OpenAdsV2ApiXmlRpc.php on line 220

Auto-generate API docs

It would be great to have API docs (auto-generated from OpenAdsV{1,2}ApiXmlRpc.php) available

Mistake in docs

Hi,
There is wrong return type annouced:
getBannerListByCampaignId(int $campaignId) : array array CampaignInfo objects

In fact that is array of BannerInfo objects.

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.