-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18ece2d
commit 29524ee
Showing
8 changed files
with
156 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
cacheDirectory=".phpunit.cache" | ||
executionOrder="depends,defects" | ||
requireCoverageMetadata="true" | ||
beStrictAboutCoverageMetadata="true" | ||
beStrictAboutOutputDuringTests="true" | ||
failOnRisky="true" | ||
failOnWarning="true"> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true"> | ||
<include> | ||
<directory>.</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
function WriteSettingToFile($settingName, $setting, $plugin = "") | ||
{ | ||
global $settingsFile; | ||
global $settings; | ||
$filename = $settingsFile; | ||
|
||
if ($plugin != "") { | ||
$filename = $settings['configDirectory'] . "/plugin." . $plugin; | ||
} | ||
|
||
$settingsStr = ""; | ||
if (file_exists($filename)) { | ||
$tmpSettings = parse_ini_file($filename); | ||
} | ||
$tmpSettings[$settingName] = $setting; | ||
foreach ($tmpSettings as $key => $value) { | ||
$settingsStr .= $key . " = \"" . $value . "\"\n"; | ||
} | ||
file_put_contents($filename, $settingsStr, LOCK_EX); | ||
} | ||
|
||
function ReadSettingFromFile($settingName, $plugin = "") | ||
{ | ||
global $settingsFile; | ||
global $settings; | ||
$filename = $settingsFile; | ||
|
||
if ($plugin != "") { | ||
$filename = "test" . "/plugin." . $plugin; | ||
// $filename = $settings["configDirectory"] . "/plugin." . $plugin; | ||
} | ||
if (!file_exists($filename)) { | ||
return false; | ||
} | ||
$fd = @fopen($filename, "r"); | ||
$settingsStr = ""; | ||
if ($fd) { | ||
flock($fd, LOCK_SH); | ||
$settingsStr = file_get_contents($filename); | ||
flock($fd, LOCK_UN); | ||
fclose($fd); | ||
} | ||
if (!empty($settingsStr)) { | ||
if (preg_match("/^" . $settingName . "/m", $settingsStr)) { | ||
$result = preg_match("/^" . $settingName . "\s*=(\s*\S*\w*)/m", $settingsStr, $output_array); | ||
if ($result == 0) { | ||
// error_log("The setting " . $settingName . " could not be found in " . $filename); | ||
return false; | ||
} | ||
return trim($output_array[1], " \t\n\r\0\x0B\""); | ||
} else { | ||
// error_log("The setting " . $settingName . " could not be found in " . $filename); | ||
return false; | ||
} | ||
} else { | ||
error_log("The setting file:" . $filename . " could not be found."); | ||
return false; | ||
} | ||
} | ||
|
||
function GetDirSetting($dir) | ||
{ | ||
return ""; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters