本文整理汇总了PHP中ApiBase::makeSuccessResult方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiBase::makeSuccessResult方法的具体用法?PHP ApiBase::makeSuccessResult怎么用?PHP ApiBase::makeSuccessResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiBase
的用法示例。
在下文中一共展示了ApiBase::makeSuccessResult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run($constraints)
{
/*
* use options to choose a query generating function
* then
*/
$table = isset($_GET['table']) ? strtolower($_GET['table']) : null;
$column = isset($_GET['column']) ? strtolower($_GET['column']) : null;
$split = isset($_GET['split']) ? strtolower($_GET['split']) : null;
#choose function based on given parameters
try {
if (isset($table) and isset($column)) {
$warning = 'You cannot specify both table and column; ignoring table parameter. ';
list($response, $warning) = self::splitSelector($split, 'main', $column, $constraints, $warning);
} elseif (isset($table)) {
list($response, $warning) = self::splitSelector($split, $table, NULL, $constraints, $warning);
} elseif (isset($column)) {
list($response, $warning) = self::splitSelector($split, 'main', $column, $constraints, $warning);
} elseif (isset($split)) {
#only split is set
$warning = 'No table specified for split; assuming table = "main". ';
list($response, $warning) = self::splitSelector($split, 'main', NULL, $constraints, $warning);
} else {
$warning = 'Neither column, table nor split parameter defined; assuming table = "all". ';
$response = self::countTable('all', $constraints);
}
} catch (Exception $e) {
return ApiBase::makeErrorResult('620', 'Count Failed. ' . 'Probably wrong parameter name supplied. [' . $e->getMessage() . ']', $warning);
}
return ApiBase::makeSuccessResult($warning, $response);
}