Quality of life improvements all around.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
12
src/App.php
12
src/App.php
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
@ -11,21 +13,17 @@ use League\Config\Configuration;
|
||||
use Nette\Schema\Expect;
|
||||
|
||||
/**
|
||||
* Application class
|
||||
*
|
||||
* Mostly working as a register pattern for the logging and configuration.
|
||||
*
|
||||
* @author Jens True <jens.chr.true@gmail.com>
|
||||
* @license https://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @link https://jcktrue.dk
|
||||
*/
|
||||
class App
|
||||
{
|
||||
/// Logging instance
|
||||
protected Logger $logger;
|
||||
/// Configuration singleton
|
||||
protected Configuration $config;
|
||||
|
||||
/**
|
||||
* Create a new instance providing a config file
|
||||
* Create a new instance providing a config file.
|
||||
*
|
||||
* @param string $configFile Relative or full path to YML config.
|
||||
* @SuppressWarnings(PHPMD.StaticAccess)
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
@ -28,6 +30,18 @@ class CommandBackup extends Command
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the backup process.
|
||||
*
|
||||
* 1. Read the configuration file.
|
||||
* 2. For each configured backup entry
|
||||
* 1. Get the size of the source
|
||||
* 2. Get the size of the destination
|
||||
* 3. Perform the backup
|
||||
* 4. Get the new size of the destination
|
||||
* 5. Send push notifications.
|
||||
* 3. Report final success
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$sio = new SymfonyStyle($input, $output);
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Notification;
|
||||
|
||||
use App\Notification\Ntfy;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Notification;
|
||||
|
||||
interface NotificationInterface
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Notification;
|
||||
|
||||
use Ntfy\Server;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Rclone;
|
||||
|
||||
use Psr\Log\LoggerAwareTrait;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Template;
|
||||
|
||||
use Twig\Environment;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Template;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
Reference in New Issue
Block a user