Skip to content

Commit

Permalink
Add a selfoss CLI tool
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jtojnar committed Jun 15, 2023
1 parent f2fcaa8 commit 2e5dbda
Show file tree
Hide file tree
Showing 11 changed files with 748 additions and 701 deletions.
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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Back-end source code is now checked using [PHPStan](https://phpstan.org/). ([#1409](https://github.com/fossar/selfoss/pull/1409))
- Content Extraction spout will no longer try to extract content we have already extracted. ([#1413](https://github.com/fossar/selfoss/pull/1413))
- Source filters are stricter, they need to start and end with a `/`. ([#1423](https://github.com/fossar/selfoss/pull/1423))
- **`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))

## 2.19 – 2022-10-12
**This version requires PHP ~~5.6~~ 7.2 (see known regressions section) or newer. It is also the last version to support PHP 7.**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For more information visit our [web site](https://selfoss.aditu.de).
2. Make the directories `data/cache`, `data/favicons`, `data/logs`, `data/thumbnails` and `data/sqlite` writeable.
3. Insert database access data in `config.ini` (see below). You do not need to change anything if you want to use SQLite.
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).
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.
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.

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

Expand Down
16 changes: 16 additions & 0 deletions bin/selfoss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/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\UpdateCommand;
use Symfony\Component\Console\Application;

$application = new Application();

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

$application->run();
22 changes: 0 additions & 22 deletions cliupdate.php

This file was deleted.

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 @@ -43,13 +44,17 @@
],
"autoload": {
"psr-4": {
"Commands\\": "src/Commands/",
"controllers\\": "src/controllers/",
"daos\\": "src/daos/",
"helpers\\": "src/helpers/",
"spouts\\": "src/spouts/",
"Tests\\": "tests/"
}
},
"bin": [
"bin/selfoss"
],
"config": {
"platform": {
"php": "7.4.0"
Expand Down
Loading

0 comments on commit 2e5dbda

Please sign in to comment.