60 lines
2.6 KiB
PHP
60 lines
2.6 KiB
PHP
<?php
|
|
|
|
include_once "../../global.inc.php";
|
|
require_once PATH_API . "/PisApi.php";
|
|
include_once PATH_UTILITTY . "/ArrayManager.php";
|
|
|
|
// get reguest header
|
|
$headers = apache_request_headers();
|
|
// instance a new api
|
|
$app = new \api\PisApi($headers);
|
|
|
|
// HTTP-Get-Method
|
|
$app->get(\api\PisApi::$routeParameterPids . \api\PisApi::$routeParameterINames . \api\PisApi::$routParameterIPatter . "(" . \api\PisApi::$routeParameterParent .")", function ($pid, $iNames = array(), $iPatter = "*",$parent = "*") use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
$queryArgs[\api\PisApi::$keyINameList] = $iNames;
|
|
$queryArgs[\api\PisApi::$keyIPatter] = $iPatter;
|
|
$queryArgs[\api\PisApi::$keyParentId] = $parent;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->get(\api\PisApi::$routeParameterPids . \api\PisApi::$routParameterIPatter . "(" . \api\PisApi::$routeParameterParent .")", function ($pid, $iPatter = "*",$parent = "*") use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
$queryArgs[\api\PisApi::$keyIPatter] = $iPatter;
|
|
$queryArgs[\api\PisApi::$keyParentId] = $parent;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->get(\api\PisApi::$routeParameterPids . \api\PisApi::$routeParameterINames . \api\PisApi::$routeParameterParent, function ($pid, $iNames = array(), $parent = "*") use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
$queryArgs[\api\PisApi::$keyINameList] = $iNames;
|
|
$queryArgs[\api\PisApi::$keyParentId] = $parent;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->get(\api\PisApi::$routeParameterPids . \api\PisApi::$routeParameterINames, function ($pid, $iNames = array()) use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
$queryArgs[\api\PisApi::$keyINameList] = $iNames;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->get(\api\PisApi::$routeParameterPids . \api\PisApi::$routeParameterParent, function ($pid, $parent = "*") use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
$queryArgs[\api\PisApi::$keyParentId] = $parent;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->get(\api\PisApi::$routeParameterPids, function ($pid) use ($app) {
|
|
$queryArgs = array();
|
|
$queryArgs[\api\PisApi::$keyPidList] = $pid;
|
|
echo $app->sendPisQuery($queryArgs);
|
|
});
|
|
|
|
$app->run();
|
|
?>
|