Skip to content

Commit 2e5dbda

Browse files
committed
Add a selfoss CLI tool
This replaces the `cliupdate.php` script with a `symfony/console` based entry point: php bin/selfoss update In the future we are going to introduce more commands.
1 parent f2fcaa8 commit 2e5dbda

File tree

11 files changed

+748
-701
lines changed

11 files changed

+748
-701
lines changed

.php-cs-fixer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
->exclude('client')
55
->exclude('utils')
66
->in(__DIR__)
7-
->name('*.phtml');
7+
->name('*.phtml')
8+
->name('selfoss');
89

910
$rules = [
1011
'@Symfony' => true,

NEWS.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- Back-end source code is now checked using [PHPStan](https://phpstan.org/). ([#1409](https://github.com/fossar/selfoss/pull/1409))
3838
- Content Extraction spout will no longer try to extract content we have already extracted. ([#1413](https://github.com/fossar/selfoss/pull/1413))
3939
- Source filters are stricter, they need to start and end with a `/`. ([#1423](https://github.com/fossar/selfoss/pull/1423))
40+
- **`cliupdate.php` program has been replaced with `bin/selfoss update`**. Do not forget to update cron scripts. ([#1440](https://github.com/fossar/selfoss/pull/1440))
4041

4142
## 2.19 – 2022-10-12
4243
**This version requires PHP ~~5.6~~ 7.2 (see known regressions section) or newer. It is also the last version to support PHP 7.**

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For more information visit our [web site](https://selfoss.aditu.de).
1717
2. Make the directories `data/cache`, `data/favicons`, `data/logs`, `data/thumbnails` and `data/sqlite` writeable.
1818
3. Insert database access data in `config.ini` (see below). You do not need to change anything if you want to use SQLite.
1919
4. You do not need to create the database tables, they will be created automatically (ensure that your database user is allowed to create triggers).
20-
5. Create cronjob or systemd timer for updating feeds and point it to https://yourselfossurl.com/update via wget or curl. You can also execute the `cliupdate.php` from command line.
20+
5. Create cronjob or systemd timer for updating feeds and point it to https://yourselfossurl.com/update via wget or curl. You can also execute `bin/selfoss update` from command line.
2121

2222
If you obtained selfoss using Git, some more steps will be required. See the [development](#development) section.
2323

bin/selfoss

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
// SPDX-FileCopyrightText: 2023 Jan Tojnar <[email protected]>
5+
// SPDX-License-Identifier: GPL-3.0-or-later
6+
7+
require __DIR__ . '/../src/common.php';
8+
9+
use Commands\UpdateCommand;
10+
use Symfony\Component\Console\Application;
11+
12+
$application = new Application();
13+
14+
$application->add($dice->create(UpdateCommand::class));
15+
16+
$application->run();

cliupdate.php

-22
This file was deleted.

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"simplepie/simplepie": "^1.8",
2424
"smottt/wideimage": "^1.1",
2525
"symfony/cache": "^5.4",
26+
"symfony/console": "^5.4",
2627
"symfony/polyfill-php80": "^1.26",
2728
"violet/streaming-json-encoder": "^1.1",
2829
"vstelmakh/url-highlight": "^3.0",
@@ -43,13 +44,17 @@
4344
],
4445
"autoload": {
4546
"psr-4": {
47+
"Commands\\": "src/Commands/",
4648
"controllers\\": "src/controllers/",
4749
"daos\\": "src/daos/",
4850
"helpers\\": "src/helpers/",
4951
"spouts\\": "src/spouts/",
5052
"Tests\\": "tests/"
5153
}
5254
},
55+
"bin": [
56+
"bin/selfoss"
57+
],
5358
"config": {
5459
"platform": {
5560
"php": "7.4.0"

0 commit comments

Comments
 (0)