Files

47 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2010-07-10 04:51:05 +00:00
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version $Id: Controller.php 1420 2009-08-22 13:23:16Z vipsoft $
*
* @category Piwik_Plugins
* @package Piwik_API
*/
/**
*
* @package Piwik_API
*/
class Piwik_API_Controller extends Piwik_Controller
{
function index()
{
// when calling the API through http, we limit the number of returned results
if(!isset($_GET['filter_limit']))
{
$_GET['filter_limit'] = Zend_Registry::get('config')->General->API_datatable_default_limit;
}
$request = new Piwik_API_Request('token_auth='.Piwik_Common::getRequestVar('token_auth', 'anonymous', 'string'));
echo $request->process();
}
public function listAllMethods()
{
$ApiDocumentation = new Piwik_API_DocumentationGenerator();
echo $ApiDocumentation->getAllInterfaceString( $outputExampleUrls = true, $prefixUrls = Piwik_Common::getRequestVar('prefixUrl', '') );
}
public function listAllAPI()
{
$view = Piwik_View::factory("listAllAPI");
$this->setGeneralVariablesView($view);
$ApiDocumentation = new Piwik_API_DocumentationGenerator();
$view->countLoadedAPI = Piwik_API_Proxy::getInstance()->getCountRegisteredClasses();
$view->list_api_methods_with_links = $ApiDocumentation->getAllInterfaceString();
echo $view->render();
}
}