Commit 9882e683 authored by Nigel McNie's avatar Nigel McNie
Browse files

Move the field for storing the time the export was generated into the PluginExport parent class.

parent 6054a0a8
......@@ -53,7 +53,6 @@ class PluginExportHtml extends PluginExport {
*/
public function __construct(User $user, $views, $artefacts) {
parent::__construct($user, $views, $artefacts);
$this->export_time = time(); // TODO: move into parent class
// TODO move this normalisation into a method
$this->rootdir = 'portfolio-for-' . preg_replace('#[^a-zA-Z0-9_-]+#', '-', $user->get('username'));
......
......@@ -68,12 +68,6 @@ class PluginExportLeap extends PluginExport {
*/
protected $zipfile;
/**
* time that the export took place
*/
protected $export_time;
/**
* special cases - artefact plugins that want to override stuff PER PLUGIN
* rather than per type or per instance.
......@@ -92,7 +86,6 @@ class PluginExportLeap extends PluginExport {
public function __construct(User $user, $views, $artefacts) {
parent::__construct($user, $views, $artefacts);
$this->smarty = smarty_core();
$this->export_time = time();
if (!check_dir_exists($this->exportdir . '/' . $this->filedir)) {
throw new SystemException("Couldn't create the temporary export directory $this->exportdir");
......
......@@ -81,6 +81,13 @@ abstract class PluginExport extends Plugin {
*/
protected $user;
/**
* The time the export was generated.
*
* Technically, this is the time at which the export object was created.
*/
protected $export_time;
/**
* Constructor. Sets up all the artefacts and views correctly
* Also sets up temporary export directories
......@@ -105,6 +112,7 @@ abstract class PluginExport extends Plugin {
* - ArtefactType subclasses
*/
public function __construct(User $user, $views, $artefacts) {
$this->export_time = time();
$this->user = $user;
$vaextra = '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment