Beispiel #1
0
 function index($file = '')
 {
     $xml_path = $file ? '../pub/interfaces/v1/' . $file . '.wadl' : '';
     $schema_path = '../pub/schemas/inc/wadl.xsd';
     $data['file'] = $file . '.wadl';
     $data['xml'] = simplexml_load_valid($xml_path, $schema_path, true);
     $this->load->view('interface', $data);
 }
Beispiel #2
0
<?php

$main_doc = $xml->doc;
$title = $main_doc ? trim((string) $main_doc['title']) : 'Unknown Interface';
$descr = $main_doc ? trim((string) $main_doc) : 'This interface is unknown.';
$last_updated = date('F j, Y', filemtime('../pub/interfaces/v1/' . $file));
$resources = $xml->resources->resource;
global $main_xml, $core_wadl;
$core_wadl = simplexml_load_valid('../pub/interfaces/v1/core.wadl', '../pub/schemas/inc/wadl.xsd', true);
$main_xml = $xml;
function get_param($param)
{
    global $core_wadl;
    if ($param['href']) {
        $href = explode('#', $param['href']);
        if ($href[0] == 'core.wadl') {
            $params = $core_wadl->param;
            foreach ($params as $p) {
                if ($p['id'] == $href[1]) {
                    return $p;
                }
            }
        } else {
            show_error('Cannot parse param ' . $param['href']);
        }
    } else {
        return $param;
    }
}
function get_type($param)
{