2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-23 18:12:16 +00:00
Files
website/doc/libraries.json.php
Daniel James d404463956 TODO notes where might want to use hidden libraries.
Currently just pretend they don't exist.
2016-07-04 23:31:35 +01:00

29 lines
827 B
PHP

<?php
require_once(__DIR__.'/../common/code/boost.php');
if (isset($_GET['version'])) {
try {
$version = BoostVersion::from($_GET['version']);
}
catch (BoostVersion_Exception $e) {
echo json_encode(Array(
'error' => $e->getMessage(),
));
exit(0);
}
} else {
$version = BoostVersion::current();
}
// TODO: This is a bit awkard, should probably have an alternative
// to 'get_for_version' which returns a BoostLibraries instance
// rather than an array.
// TODO: Include hidden libraries.
$version_libs = array_map(function($lib) { return new BoostLibrary($lib); },
BoostLibraries::load()->get_for_version($version));
header('Content-type: application/json');
echo BoostLibrary::get_libraries_json($version_libs);
echo $version_libs->to_json();