コード例 #1
0
ファイル: index.php プロジェクト: NIIF/DiscoJuice-Backend
     $data = array();
     $clientIP = $_SERVER['REMOTE_ADDR'];
     $data['country'] = $geoservice->countryFromIP($clientIP);
     $data['geo'] = $geoservice->geoFromIP($clientIP);
     $response = $data;
 } else {
     if (DiscoUtils::route('get', '^/pipe/([a-z0-9\\-_]+)$', $parameters, $body)) {
         $response = $store->getPipe($parameters[1]);
         unset($response['_id']);
     } else {
         if (DiscoUtils::route('get', '^/pipe/([a-z0-9\\-_]+)/disco$', $parameters, $body)) {
             $c = $store->getPipe($parameters[1]);
             if ($c === null) {
                 echo "not found pipe " . $parameters[1];
             }
             $pipe = Pipe::fromDB($c);
             $query = $pipe->getQuery();
             $response = $store->getIdPs($query);
             // $response = $query;
             // $response = $store->getFeed($parameters[1]);
         } else {
             if (DiscoUtils::route('get', '^/feed/([a-z0-9\\-_]+)/disco$', $parameters, $body)) {
                 $response = $store->getFeed($parameters[1]);
             } else {
                 if (DiscoUtils::route('get', '^/feed/([a-z0-9\\-_]+)/metadata$', $parameters, $body)) {
                     $response = $store->getFeedMetadata($parameters[1]);
                 } else {
                     if (DiscoUtils::route('get', '^/apps$', $parameters, $body)) {
                         $response = array('foo' => 'bar');
                     } else {
                         if (DiscoUtils::route('get', '^/logo$', $parameters, $qs)) {