8 namespace Fossology\UI\Page;
15 use Symfony\Component\HttpFoundation\Request;
16 use Symfony\Component\HttpFoundation\Response;
20 const NAME =
"admin_license_to_yaml";
22 function __construct()
24 parent::__construct(self::NAME, array(
25 self::TITLE =>
"Admin License Rules Export",
26 self::MENU_LIST =>
"Admin::License Admin::Rules Export",
27 self::REQUIRES_LOGIN =>
true,
36 protected function handle(Request $request)
39 $dbManager = $this->
getObject(
'db.manager');
41 $compatibilityDao = $this->
getObject(
'dao.compatibility');
44 $content = $licenseYamlExport->createYaml(0);
45 $fileName =
"fossology-license-comp-rules-export-".date(
"YMj-Gis");
47 'Content-type' =>
'text/x-yaml, charset=UTF-8',
48 'Content-Disposition' =>
'attachment; filename='.$fileName.
'.yaml',
49 'Pragma' =>
'no-cache',
50 'Cache-Control' =>
'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0',
51 'Expires' =>
'Expires: Thu, 19 Nov 1981 08:52:00 GMT');
53 return new Response($content, Response::HTTP_OK, $headers);
Helper class to export license list as a YAML from the DB.
Contains the constants and helpers for authentication of user.