dc-rest/inc/class.rest.query.get.specs.php

19 lines
699 B
PHP
Raw Normal View History

2017-05-01 00:51:42 +02:00
<?php
2017-05-01 22:05:03 +02:00
class RestQueryGetSpecs extends RestQuery
2017-05-01 00:51:42 +02:00
{
public function __construct($user){
global $core;
$this->response_code = 200;
$specs = json_decode(file_get_contents(dirname(__FILE__).'/../documentation/swagger.json'),true);
//change some parameters
$url = parse_url($core->blog->url.$core->url->getBase('rest'));
$specs['host'] = $url['host'];
$specs['schemes'] = $url['scheme'];
preg_match('/https?:\/\/[^\/]*(\/.*)/',$core->blog->url.$core->url->getBase('rest'),$end);
$specs['basePath'] = $end[1];
$this->response_message = $specs;
return;
}
}