Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a selfoss CLI tool #1283

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
->exclude('client')
->exclude('utils')
->in(__DIR__)
->name('*.phtml');
->name('*.phtml')
->name('selfoss');

$rules = [
'@Symfony' => true,
Expand Down
23 changes: 23 additions & 0 deletions bin/selfoss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php

// SPDX-FileCopyrightText: 2023 Jan Tojnar <[email protected]>
// SPDX-License-Identifier: GPL-3.0-or-later

require __DIR__ . '/../src/common.php';

use Commands\Database\ExportCommand as DatabaseExportCommand;
use Commands\Database\ImportCommand as DatabaseImportCommand;
use Monolog\Handler\StreamHandler;
use Symfony\Component\Console\Application;

$application = new Application();

$log->popHandler();
$handler = new StreamHandler('php://stderr');
$log->pushHandler($handler);

$application->add($dice->create(DatabaseExportCommand::class));
$application->add($dice->create(DatabaseImportCommand::class));

$application->run();
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"simplepie/simplepie": "^1.8",
"smottt/wideimage": "^1.1",
"symfony/cache": "^5.4",
"symfony/console": "^5.4",
"symfony/polyfill-php80": "^1.26",
"violet/streaming-json-encoder": "^1.1",
"vstelmakh/url-highlight": "^3.0",
Expand All @@ -42,7 +43,11 @@
}
],
"autoload": {
"files": [
"src/helpers/Functions.php"
],
"psr-4": {
"Commands\\": "src/Commands/",
"controllers\\": "src/controllers/",
"daos\\": "src/daos/",
"helpers\\": "src/helpers/",
Expand Down
Loading