1752171309 gFFBC%2BJB4H%3AphpDocumentor-projectDescriptor-files-c7aa950ca360868684b1e50fce5c8b6f O:39:"phpDocumentor\Descriptor\FileDescriptor":23:{s:8:"*fqsen";N;s:7:"*name";s:16:"codecoverage.php";s:12:"*namespace";s:0:"";s:10:"*package";s:9:"Profiling";s:10:"*summary";s:47:"Setup remote code coverage support if requested";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:687:"PHP version 8 Copyright (C) The National Library of Finland 2023. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:5:{s:8:"category";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:8:"category";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:6:"VuFind";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:9:"Profiling";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"author";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\AuthorDescriptor":3:{s:7:"*name";s:6:"author";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:37:"Ere Maijala ";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"license";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"license";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:69:"http://opensource.org/licenses/gpl-2.0.php GNU General Public License";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:4:"link";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:43:"phpDocumentor\Descriptor\Tag\LinkDescriptor":4:{s:7:"*name";s:4:"link";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:4:"Wiki";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:7:"*link";s:58:"https://vufind.org/wiki/development:plugins:record_drivers";}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:7:"*hash";s:32:"34e6e5ef9b5cd843b74e7452bb745814";s:7:"*path";s:33:"VuFind/functions/codecoverage.php";s:9:"*source";s:3397:" * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki */ use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\Selector; use SebastianBergmann\CodeCoverage\Filter; use SebastianBergmann\CodeCoverage\Report\PHP as PHPReport; /** * Setup remote code coverage support if requested * * @param array $modules Active modules * * @return void */ function setupVuFindRemoteCodeCoverage(array $modules): void { if (!($coverageHeader = $_SERVER['HTTP_X_VUFIND_REMOTE_COVERAGE'] ?? null)) { return; } $error = function ($msg) { error_log("setupVuFindRemoteCodeCoverage: $msg"); throw new \Exception($msg); }; if (!($command = json_decode($coverageHeader, true))) { $error('Cannot decode remote coverage header'); } $action = $command['action'] ?? null; $testName = $command['testName'] ?? null; $outputDir = $command['outputDir'] ?? null; if ('record' !== $action || !$testName || !$outputDir) { $error('Invalid remote coverage command'); } if (!is_dir($outputDir)) { $error("setupVuFindRemoteCodeCoverage: Bad output directory $outputDir"); } try { $filter = new Filter(); foreach ($modules as $module) { $moduleDir = __DIR__ . "/../../$module"; if (!str_contains($module, '\\') && is_dir($moduleDir)) { $filter->includeDirectory("$moduleDir/src/"); } } $coverage = new CodeCoverage( (new Selector())->forLineCoverage($filter), $filter ); } catch (\Exception $e) { $error('Failed to create collector: ' . (string)$e); } $outputDir .= '/' . urlencode($testName); if (!is_dir($outputDir)) { if (!mkdir($outputDir)) { $error("Failed to create output directory $outputDir"); } } $outputFile = $outputDir . '/coverage-' . time() . '-' . getmypid() . '.cov'; header('X-VuFind-Coverage: ' . basename($outputFile)); $coverage->start($testName); // Write coverage report on shutdown: $shutdownFunc = function () use ($coverage, $outputFile): void { $coverage->stop(); $reporter = new PHPReport(); $result = $reporter->process($coverage); file_put_contents($outputFile, $result); }; register_shutdown_function($shutdownFunc); } ";s:19:"*namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:11:"*includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:32:"\setupVuFindRemoteCodeCoverage()";O:43:"phpDocumentor\Descriptor\FunctionDescriptor":14:{s:8:"*fqsen";O:30:"phpDocumentor\Reflection\Fqsen":2:{s:37:"phpDocumentor\Reflection\Fqsenfqsen";s:32:"\setupVuFindRemoteCodeCoverage()";s:36:"phpDocumentor\Reflection\Fqsenname";s:29:"setupVuFindRemoteCodeCoverage";}s:7:"*name";s:29:"setupVuFindRemoteCodeCoverage";s:12:"*namespace";s:1:"\";s:10:"*package";N;s:10:"*summary";s:47:"Setup remote code coverage support if requested";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:0:"";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:17:"*fileDescriptor";r:1;s:7:"*line";i:42;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:3:{s:7:"package";r:27;s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:7:"*name";s:5:"param";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:14:"Active modules";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*types";O:37:"phpDocumentor\Reflection\Types\Array_":3:{s:12:"*valueType";O:37:"phpDocumentor\Reflection\Types\Mixed_":0:{}s:10:"*keyType";N;s:17:"*defaultKeyType";O:39:"phpDocumentor\Reflection\Types\Compound":2:{s:52:"phpDocumentor\Reflection\Types\AggregatedTypetypes";a:2:{i:0;O:38:"phpDocumentor\Reflection\Types\String_":0:{}i:1;O:38:"phpDocumentor\Reflection\Types\Integer":0:{}}s:52:"phpDocumentor\Reflection\Types\AggregatedTypetoken";s:1:"|";}}s:15:"*variableName";s:7:"modules";}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:7:"*name";s:6:"return";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:0:"";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*types";O:36:"phpDocumentor\Reflection\Types\Void_":0:{}}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:7:"modules";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":16:{s:8:"*fqsen";N;s:7:"*name";s:7:"modules";s:12:"*namespace";s:0:"";s:10:"*package";N;s:10:"*summary";s:0:"";s:14:"*description";r:108;s:17:"*fileDescriptor";N;s:7:"*line";i:42;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:9:"*method";N;s:7:"*type";r:115;s:10:"*default";N;s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;}}}s:55:"phpDocumentor\Descriptor\FunctionDescriptorreturnType";O:36:"phpDocumentor\Reflection\Types\Void_":0:{}s:65:"phpDocumentor\Descriptor\FunctionDescriptorhasReturnByReference";b:0;}}}s:10:"*classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:13:"*interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:46:"phpDocumentor\Descriptor\FileDescriptorenums";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}