From a52d029ac853302e26f6031e3cf539981c1f2c3c Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Mon, 8 Jun 2020 16:04:32 +0200 Subject: [PATCH] - composer updates - embargo date optional in oai datacite and dc - cmpare unix timestamps --- .../Controllers/Oai/RequestController.php | 8 ++- composer.lock | 68 +++++++++++-------- public/datasetxml2oai-pmh.xslt | 5 +- public/prefixes/oai_datacite.xslt | 2 +- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php index 4cdb3b4..7f34cdd 100644 --- a/app/Http/Controllers/Oai/RequestController.php +++ b/app/Http/Controllers/Oai/RequestController.php @@ -68,8 +68,8 @@ class RequestController extends Controller { //$this->middleware('auth'); // Initialize member variables. - $this->xml = new \DomDocument; - $this->proc = new \XSLTProcessor; + $this->xml = new \DomDocument(); + $this->proc = new \XSLTProcessor(); $this->configuration = new OaiModelConfiguration(); } @@ -115,6 +115,10 @@ class RequestController extends Controller // Set response time $this->proc->setParameter('', 'responseDate', date("Y-m-d\TH:i:s\Z")); + // set timestamp + $date = new \DateTime(); + $unixTimestamp = $date->getTimestamp(); + $this->proc->setParameter('', 'unixTimestamp', $unixTimestamp); // set OAI base url $uri = explode('?', $_SERVER['REQUEST_URI'], 2); diff --git a/composer.lock b/composer.lock index 630ac5c..dadcd05 100755 --- a/composer.lock +++ b/composer.lock @@ -745,16 +745,16 @@ }, { "name": "laravel/framework", - "version": "v6.18.16", + "version": "v6.18.18", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "73f18a6bc58fb91aa83925161db25aa3674b73e9" + "reference": "9e5226ecc28f960cba1bd38b6d1d82a52e072dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/73f18a6bc58fb91aa83925161db25aa3674b73e9", - "reference": "73f18a6bc58fb91aa83925161db25aa3674b73e9", + "url": "https://api.github.com/repos/laravel/framework/zipball/9e5226ecc28f960cba1bd38b6d1d82a52e072dc3", + "reference": "9e5226ecc28f960cba1bd38b6d1d82a52e072dc3", "shasum": "" }, "require": { @@ -765,7 +765,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "league/commonmark": "^1.3", - "league/flysystem": "^1.0.8", + "league/flysystem": "^1.0.34", "monolog/monolog": "^1.12|^2.0", "nesbot/carbon": "^2.0", "opis/closure": "^3.1", @@ -888,7 +888,7 @@ "framework", "laravel" ], - "time": "2020-05-26T14:31:44+00:00" + "time": "2020-06-02T22:32:07+00:00" }, { "name": "laravel/tinker", @@ -1450,16 +1450,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.4.0", + "version": "v4.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" + "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463", + "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463", "shasum": "" }, "require": { @@ -1498,20 +1498,20 @@ "parser", "php" ], - "time": "2020-04-10T16:34:50+00:00" + "time": "2020-06-03T07:24:19+00:00" }, { "name": "opis/closure", - "version": "3.5.3", + "version": "3.5.4", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca" + "reference": "1d0deef692f66dae5d70663caee2867d0971306b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/cac47092144043d5d676e2e7cf8d0d2f83fc89ca", - "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca", + "url": "https://api.github.com/repos/opis/closure/zipball/1d0deef692f66dae5d70663caee2867d0971306b", + "reference": "1d0deef692f66dae5d70663caee2867d0971306b", "shasum": "" }, "require": { @@ -1559,7 +1559,7 @@ "serialization", "serialize" ], - "time": "2020-05-25T09:32:45+00:00" + "time": "2020-06-07T11:41:29+00:00" }, { "name": "paragonie/random_compat", @@ -1608,16 +1608,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.7.3", + "version": "1.7.4", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "4acfd6a4b33a509d8c88f50e5222f734b6aeebae" + "reference": "b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/4acfd6a4b33a509d8c88f50e5222f734b6aeebae", - "reference": "4acfd6a4b33a509d8c88f50e5222f734b6aeebae", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3", + "reference": "b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3", "shasum": "" }, "require": { @@ -1659,7 +1659,17 @@ "php", "type" ], - "time": "2020-03-21T18:07:53+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2020-06-07T10:40:07+00:00" }, { "name": "psr/container", @@ -3879,27 +3889,27 @@ }, { "name": "vlucas/phpdotenv", - "version": "v3.6.5", + "version": "v3.6.6", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "8b64814b356b96a90d2bc942b152c80d8888b8d4" + "reference": "4669484ccbc38fe7c4e0c50456778f2010566aad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8b64814b356b96a90d2bc942b152c80d8888b8d4", - "reference": "8b64814b356b96a90d2bc942b152c80d8888b8d4", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/4669484ccbc38fe7c4e0c50456778f2010566aad", + "reference": "4669484ccbc38fe7c4e0c50456778f2010566aad", "shasum": "" }, "require": { "php": "^5.4 || ^7.0 || ^8.0", - "phpoption/phpoption": "^1.5", - "symfony/polyfill-ctype": "^1.9" + "phpoption/phpoption": "^1.5.2", + "symfony/polyfill-ctype": "^1.16" }, "require-dev": { "ext-filter": "*", "ext-pcre": "*", - "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0" }, "suggest": { "ext-filter": "Required to use the boolean validator.", @@ -3948,7 +3958,7 @@ "type": "tidelift" } ], - "time": "2020-05-23T09:42:03+00:00" + "time": "2020-06-02T14:08:54+00:00" }, { "name": "yajra/laravel-datatables-oracle", diff --git a/public/datasetxml2oai-pmh.xslt b/public/datasetxml2oai-pmh.xslt index ee65f64..af575cb 100644 --- a/public/datasetxml2oai-pmh.xslt +++ b/public/datasetxml2oai-pmh.xslt @@ -17,6 +17,7 @@ + @@ -379,7 +380,7 @@ - + embargo @@ -524,12 +525,14 @@ + info:eu-repo/date/embargoEnd/ - - + diff --git a/public/prefixes/oai_datacite.xslt b/public/prefixes/oai_datacite.xslt index 4857f1b..ea18e99 100644 --- a/public/prefixes/oai_datacite.xslt +++ b/public/prefixes/oai_datacite.xslt @@ -124,7 +124,7 @@ - + Available