27 lines
561 B
PHP
27 lines
561 B
PHP
<?php
|
|
|
|
class Updates implements IPluggable
|
|
{
|
|
|
|
|
|
public function check(): ?bool
|
|
{
|
|
$data = str_replace("=", "", @shell_exec("git --no-pager fetch --dry-run --porcelain --verbose 2>&1 | grep refs"));
|
|
$parts = explode(" ", trim($data));
|
|
if (count($parts) < 3) {
|
|
return null;
|
|
}
|
|
|
|
return $parts[0] != $parts[1];
|
|
}
|
|
|
|
public function install(): string|bool|null
|
|
{
|
|
return @shell_exec("git --no-pager pull --verbose 2>&1");
|
|
}
|
|
|
|
public function init(PluginContext $context)
|
|
{
|
|
|
|
}
|
|
} |