initial commit
This commit is contained in:
commit
19fe71b4c1
33 files changed
+557
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
eval(FileUtil::getPluginConf($plugin["name"]));
|
||||
|
||||
if (empty($partitionDirectories)) {
|
||||
if (User::isLocalMode() && rTorrentSettings::get()->linkExist && file_exists(rTorrentSettings::get()->directory)) {
|
||||
$partitionDirectories = [rTorrentSettings::get()->directory => ''];
|
||||
} else {
|
||||
$partitionDirectories = [$topDirectory => ''];
|
||||
}
|
||||
}
|
||||
|
||||
$diskOk = function_exists('disk_total_space') && function_exists('disk_free_space');
|
||||
if ($diskOk) {
|
||||
foreach (array_keys($partitionDirectories) as $dir) {
|
||||
if ((disk_total_space($dir) === false) || (disk_free_space($dir) === false)) {
|
||||
$diskOk = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$diskOk) {
|
||||
$jResult .= "plugin.disable();";
|
||||
} else {
|
||||
$jResult .= "plugin.interval = " . $diskUpdateInterval . "; plugin.notifySpaceLimit = " . ($notifySpaceLimit * 1024 * 1024) . ";";
|
||||
$jResult .= "plugin.freeBytesInMeter = " . ($freeBytesInMeter ? 1 : 0) . ";";
|
||||
$jResult .= "plugin.diskCount = " . count($partitionDirectories) . ";";
|
||||
$jResult .= "plugin.diskNames = " . json_encode(array_values($partitionDirectories)) . ";";
|
||||
$theSettings->registerPlugin($plugin["name"], $pInfo["perms"]);
|
||||
}
|
||||
Reference in new issue
Block a user