Closing tags at the end of file are not mandatory. It is often suggested to omit to closing tags at the end of file to prevent unwanted effects as PHP will start output buffering if there is any character after closing tag. Reference: http://php.net/manual/en/language.basic-syntax.phptags.php Signed-off-by: Rahul Kadyan <hi@znck.me>
29 lines
704 B
PHP
29 lines
704 B
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
* A caching proxy for retrieving version information from phpmyadmin.net
|
|
*
|
|
* @package PhpMyAdmin
|
|
*/
|
|
|
|
// Sets up the session
|
|
define('PMA_MINIMUM_COMMON', true);
|
|
require_once 'libraries/common.inc.php';
|
|
require_once 'libraries/Util.class.php';
|
|
|
|
// Always send the correct headers
|
|
header('Content-type: application/json; charset=UTF-8');
|
|
|
|
$version = PMA_Util::getLatestVersion();
|
|
|
|
if (empty($version)) {
|
|
echo json_encode(array());
|
|
} else {
|
|
echo json_encode(
|
|
array(
|
|
'version' => (! empty($version->version) ? $version->version : ''),
|
|
'date' => (! empty($version->date) ? $version->date : ''),
|
|
)
|
|
);
|
|
}
|