-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathSetupCheckFunctions.php
More file actions
33 lines (28 loc) · 906 Bytes
/
SetupCheckFunctions.php
File metadata and controls
33 lines (28 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Libresign\SetupCheck;
if (!function_exists('OCA\Libresign\SetupCheck\file_exists')) {
function file_exists(string $filename): bool
{
if (array_key_exists($filename, FileSystemMock::$files)) {
return FileSystemMock::$files[$filename];
}
return \file_exists($filename);
}
}
if (!function_exists('OCA\Libresign\SetupCheck\exec')) {
function exec(string $command, &$output = null, &$result_code = null): string|false
{
if (array_key_exists($command, ExecMock::$commands)) {
$mock = ExecMock::$commands[$command];
$output = $mock['output'];
$result_code = $mock['result_code'];
return $output ? implode("\n", $output) : '';
}
return \exec($command, $output, $result_code);
}
}