File: Api.php

package info (click to toggle)
wikidiff2 1.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,908 kB
  • sloc: cpp: 2,875; php: 417; makefile: 14; sh: 3
file content (13 lines) | stat: -rw-r--r-- 272 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

class Api {
	public static function request( array $params ) {
		global $apiUrl;

		$params['format'] = 'json';
		$query = http_build_query( $params );
		$url = "$apiUrl?$query";
		$response = file_get_contents( $url );
		return json_decode( $response, true );
	}
}