diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-08-24 22:06:34 +0200 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2020-08-26 22:48:17 +0200 |
commit | b73c7c0f8a43b5c4e65ca4daeb0ec7dc4c7c2306 (patch) | |
tree | 751e5310b824c343ec0c199fd9c3b1eb1b14b0ff | |
parent | e42150067ba185516caf370b725574f0db68e122 (diff) |
Cleanup appinfo files
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | appinfo/database.xml | 452 | ||||
-rw-r--r-- | appinfo/info.xml | 9 | ||||
-rw-r--r-- | appinfo/register_command.php | 28 | ||||
-rwxr-xr-x | bin/tools/generate_explore.php | 97 | ||||
-rw-r--r-- | composer.lock | 193 | ||||
-rw-r--r-- | lib/AppInfo/Application.php | 5 | ||||
-rw-r--r-- | lib/Migration/Version140200Date20200824201413.php | 289 |
8 files changed, 410 insertions, 665 deletions
@@ -111,7 +111,7 @@ clean: # Reports PHP codestyle violations .PHONY: phpcs phpcs: - ./vendor/bin/phpcs --standard=PSR2 lib + ./vendor/bin/phpcs --standard=PSR2 --ignore=lib/Migration/Version*.php lib # Reports PHP static violations .PHONY: phpstan diff --git a/appinfo/database.xml b/appinfo/database.xml deleted file mode 100644 index d210d3f45..000000000 --- a/appinfo/database.xml +++ /dev/null @@ -1,452 +0,0 @@ -<database> - <name>*dbname*</name> - <create>true</create> - <overwrite>false</overwrite> - <charset>utf8</charset> - <table> - <name>*dbprefix*news_folders</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <notnull>true</notnull> - <autoincrement>true</autoincrement> - <unsigned>true</unsigned> - <primary>true</primary> - <length>8</length> - </field> - <field> - <name>parent_id</name> - <type>integer</type> - <length>8</length> - <notnull>false</notnull> - </field> - <field> - <name>name</name> - <type>text</type> - <length>100</length> - <notnull>true</notnull> - </field> - <field> - <name>user_id</name> - <type>text</type> - <default></default> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>opened</name> - <type>boolean</type> - <default>true</default> - <notnull>true</notnull> - </field> - <field> - <name>deleted_at</name> - <type>integer</type> - <length>8</length> - <default>0</default> - <notnull>false</notnull> - <unsigned>true</unsigned> - </field> - <field> - <name>last_modified</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>false</notnull> - <unsigned>true</unsigned> - </field> - - <index> - <name>news_folders_last_mod_idx</name> - <field> - <name>last_modified</name> - </field> - </index> - - <index> - <name>news_folders_parent_id_idx</name> - <field> - <name>parent_id</name> - </field> - </index> - - <index> - <name>news_folders_user_id_idx</name> - <field> - <name>user_id</name> - </field> - </index> - </declaration> - </table> - - <table> - <name>*dbprefix*news_feeds</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <notnull>true</notnull> - <autoincrement>true</autoincrement> - <primary>true</primary> - <length>8</length> - <unsigned>true</unsigned> - </field> - <field> - <name>user_id</name> - <type>text</type> - <default></default> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>last_modified</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>false</notnull> - <unsigned>true</unsigned> - </field> - <field> - <name>url_hash</name> - <type>text</type> - <length>32</length> - <notnull>true</notnull> - </field> - <field> - <name>url</name> - <type>clob</type> - <notnull>true</notnull> - </field> - <field> - <name>location</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>title</name> - <type>clob</type> - <notnull>true</notnull> - </field> - <field> - <name>link</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>favicon_link</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>http_last_modified</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>http_etag</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>added</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>false</notnull> - <unsigned>true</unsigned> - </field> - <field> - <name>articles_per_update</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>true</notnull> - </field> - <field> - <name>update_error_count</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>true</notnull> - </field> - <field> - <name>last_update_error</name> - <type>clob</type> - <default></default> - <notnull>false</notnull> - </field> - <field> - <name>basic_auth_user</name> - <type>clob</type> - <default></default> - <notnull>false</notnull> - </field> - <field> - <name>basic_auth_password</name> - <type>clob</type> - <default></default> - <notnull>false</notnull> - </field> - <field> - <name>deleted_at</name> - <type>integer</type> - <default>0</default> - <notnull>false</notnull> - <length>8</length> - <unsigned>true</unsigned> - </field> - <field> - <name>folder_id</name> - <type>integer</type> - <length>8</length> - <notnull>true</notnull> - </field> - <field> - <name>prevent_update</name> - <type>boolean</type> - <default>false</default> - <notnull>true</notnull> - </field> - <field> - <name>pinned</name> - <type>boolean</type> - <default>false</default> - <notnull>true</notnull> - </field> - <field> - <name>full_text_enabled</name> - <type>boolean</type> - <default>false</default> - <notnull>true</notnull> - </field> - <field> - <name>ordering</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - </field> - <field> - <name>update_mode</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - </field> - - <index> - <name>news_feeds_last_mod_idx</name> - <field> - <name>last_modified</name> - </field> - </index> - - <index> - <name>news_feeds_user_id_index</name> - <field> - <name>user_id</name> - </field> - </index> - - <index> - <name>news_feeds_folder_id_index</name> - <field> - <name>folder_id</name> - </field> - </index> - - <index> - <name>news_feeds_url_hash_index</name> - <field> - <name>url_hash</name> - </field> - </index> - </declaration> - </table> - - <table> - <name>*dbprefix*news_items</name> - <declaration> - <field> - <name>id</name> - <type>integer</type> - <length>8</length> - <notnull>true</notnull> - <autoincrement>true</autoincrement> - <primary>true</primary> - <unsigned>true</unsigned> - </field> - <field> - <name>guid_hash</name> - <type>text</type> - <notnull>true</notnull> - <length>32</length> - </field> - <field> - <name>fingerprint</name> - <type>text</type> - <notnull>false</notnull> - <length>32</length> - </field> - <field> - <name>content_hash</name> - <type>text</type> - <notnull>false</notnull> - <length>32</length> - </field> - <field> - <name>rtl</name> - <type>boolean</type> - <notnull>true</notnull> - <default>false</default> - </field> - <field> - <name>search_index</name> - <type>clob</type> - </field> - <field> - <name>guid</name> - <type>clob</type> - <notnull>true</notnull> - </field> - <field> - <name>url</name> - <type>clob</type> - </field> - <field> - <name>title</name> - <type>clob</type> - </field> - <field> - <name>author</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>pub_date</name> - <type>integer</type> - <length>8</length> - <unsigned>true</unsigned> - <notnull>false</notnull> - </field> - <field> - <name>updated_date</name> - <type>integer</type> - <length>8</length> - <unsigned>true</unsigned> - <notnull>false</notnull> - </field> - <field> - <name>body</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>enclosure_mime</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>enclosure_link</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>media_thumbnail</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>media_description</name> - <type>clob</type> - <notnull>false</notnull> - </field> - <field> - <name>feed_id</name> - <type>integer</type> - <length>8</length> - <notnull>true</notnull> - </field> - <field> - <name>status</name> - <type>integer</type> - <length>8</length> - <default>0</default> - <notnull>true</notnull> - </field> - <field> - <name>unread</name> - <type>boolean</type> - <default>false</default> - <notnull>true</notnull> - </field> - <field> - <name>starred</name> - <type>boolean</type> - <default>false</default> - <notnull>true</notnull> - </field> - <field> - <name>last_modified</name> - <type>integer</type> - <default>0</default> - <length>8</length> - <notnull>false</notnull> - <unsigned>true</unsigned> - </field> - - <index> - <name>news_items_last_mod_idx</name> - <field> - <name>last_modified</name> - </field> - </index> - - <index> - <name>news_items_fingerprint_idx</name> - <field> - <name>fingerprint</name> - </field> - </index> - - <index> - <name>news_items_item_guid</name> - <field> - <name>guid_hash</name> - </field> - <field> - <name>feed_id</name> - </field> - </index> - - <index> - <name>news_items_unread_feed_id</name> - <field> - <name>unread</name> - </field> - <field> - <name>feed_id</name> - </field> - </index> - - <index> - <name>news_items_starred_feed_id</name> - <field> - <name>starred</name> - </field> - <field> - <name>feed_id</name> - </field> - </index> - - <index> - <name>news_items_unread_id</name> - <field> - <name>unread</name> - </field> - <field> - <name>id</name> - </field> - </index> - </declaration> - </table> -</database> diff --git a/appinfo/info.xml b/appinfo/info.xml index b41983682..6845dc39c 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -50,6 +50,15 @@ Before you update to a new version, [check the changelog](https://github.com/nex </post-migration> </repair-steps> + <commands> + <command>OCA\News\Command\ExploreGenerator</command> + <command>OCA\News\Command\ShowFeed</command> + <command>OCA\News\Command\Updater\AllFeeds</command> + <command>OCA\News\Command\Updater\UpdateFeed</command> + <command>OCA\News\Command\Updater\BeforeUpdate</command> + <command>OCA\News\Command\Updater\AfterUpdate</command> + </commands> + <settings> <admin>OCA\News\Settings\Admin</admin> <admin-section>OCA\News\Settings\Section</admin-section> diff --git a/appinfo/register_command.php b/appinfo/register_command.php deleted file mode 100644 index 1fc006b76..000000000 --- a/appinfo/register_command.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright Bernhard Posselt 2016 - */ - -namespace OCA\News\AppInfo; - -use OCA\News\Command\ShowFeed; -use OCA\News\Command\Updater\UpdateFeed; -use OCA\News\Command\Updater\AllFeeds; -use OCA\News\Command\Updater\BeforeUpdate; -use OCA\News\Command\Updater\AfterUpdate; -use OCA\News\Command\ExploreGenerator; - -$app = new Application(); -$container = $app->getContainer(); -$application->add($container->query(AllFeeds::class)); -$application->add($container->query(UpdateFeed::class)); -$application->add($container->query(BeforeUpdate::class)); -$application->add($container->query(AfterUpdate::class)); -$application->add($container->query(ExploreGenerator::class)); -$application->add($container->query(ShowFeed::class)); diff --git a/bin/tools/generate_explore.php b/bin/tools/generate_explore.php deleted file mode 100755 index 766e82db7..000000000 --- a/bin/tools/generate_explore.php +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env php -<?php -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright Bernhard Posselt 2016 - */ -require_once __DIR__ . '/../../vendor/autoload.php'; -require_once __DIR__ . '/../../../../lib/base.php'; - -use FeedIo\FeedIo; -use Favicon\Favicon; -use OCA\News\AppInfo\Application; - -$generator = new ExploreGenerator(); -$generator->parse_argv($argv); -print(json_encode($generator->read(), JSON_PRETTY_PRINT)); -print("\n"); - -/** - * This is used for generating a JSON config section for a feed by executing: - * php -f generate_authors.php www.feed.com - * @deprecated Use ./occ news:generate-explore instead. - */ -class ExploreGenerator -{ - /** - * Feed and favicon fetcher. - */ - protected $reader; - protected $favicon; - - /** - * Argument data - */ - protected $url; - protected $votes; - - /** - * Set up class. - */ - public function __construct() - { - $app = new Application(); - $container = $app->getContainer(); - - $this->reader = $container->query(FeedIo::class); - $this->favicon = new Favicon(); - } - - /** - * Parse required arguments. - * @param array $argv Arguments to the script. - * @return void - */ - public function parse_argv($argv = []) - { - if (count($argv) < 2 || count($argv) > 3) - { - print('Usage: php -f generate_explore http://path.com/feed [vote_count]'); - print("\n"); - exit(1); - } - - $this->votes = (count($argv) === 3) ? $argv[2] : 100; - $this->url = $argv[1]; - } - - /** - * Read the provided feed and return the important data. - * @return array Object representation of the feed - */ - public function read() - { - try { - $resource = $this->reader->read($this->url); - $feed = $resource->getFeed(); - $result = [ - 'title' => $feed->getTitle(), - 'favicon' => $this->favicon->get($feed->getLink()), - 'url' => $feed->getLink(), - 'feed' => $this->url, - 'description' => $feed->getDescription(), - 'votes' => $this->votes, - ]; - - return $result; - } catch (\Throwable $ex) { - return [ 'error' => $ex->getMessage() ]; - } - } - -} diff --git a/composer.lock b/composer.lock index 9b63aaee6..d417450dd 100644 --- a/composer.lock +++ b/composer.lock @@ -111,21 +111,21 @@ }, { "name": "debril/feed-io", - "version": "v4.7.1", + "version": "v4.7.8", "source": { "type": "git", "url": "https://github.com/alexdebril/feed-io.git", - "reference": "7f032bf0d91d4a0ea670e160070e66efb01f1d71" + "reference": "2fe979f7e288fff334deaa0ddeaa1f229632ab6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alexdebril/feed-io/zipball/7f032bf0d91d4a0ea670e160070e66efb01f1d71", - "reference": "7f032bf0d91d4a0ea670e160070e66efb01f1d71", + "url": "https://api.github.com/repos/alexdebril/feed-io/zipball/2fe979f7e288fff334deaa0ddeaa1f229632ab6e", + "reference": "2fe979f7e288fff334deaa0ddeaa1f229632ab6e", "shasum": "" }, "require": { "ext-dom": "*", - "guzzlehttp/guzzle": "~6.2", + "guzzlehttp/guzzle": "~6.2|~7.0", "php": ">=7.1", "psr/log": "~1.0", "symfony/console": "~3.4|~4.0|~5.0" @@ -174,7 +174,7 @@ "type": "github" } ], - "time": "2020-05-25T13:12:32+00:00" + "time": "2020-08-17T13:46:18+00:00" }, { "name": "ezyang/htmlpurifier", @@ -388,20 +388,20 @@ |