File: Api.php

package info (click to toggle)
wikidiff2 1.2%2Bgit03ea59f-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 276 kB
  • ctags: 240
  • sloc: cpp: 1,357; php: 172; makefile: 13
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 );
	}
}