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

neues_rss rex_api explizit registrieren #69

Merged
merged 4 commits into from
Apr 3, 2024
Merged
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: 3 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use rex_extension;
use rex_extension_point;
use rex_plugin;
use rex_api_function;
use rex_url;
use rex_yform_manager_dataset;
use rex_yform_manager_table;
Expand Down Expand Up @@ -49,6 +50,8 @@
});
}

rex_api_function::register('neues_rss', neues_rss_api::class);

if (rex_plugin::get('yform', 'rest')->isAvailable() && !rex::isSafeMode()) {
/* YForm Rest API */
$rex_neues_entry_route = new rex_yform_rest_route(
Expand Down
11 changes: 5 additions & 6 deletions lib/rex_api_neues_rss.php → lib/neues_rss_api.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?php

namespace FriendsOfRedaxo\neues;
namespace FriendsOfRedaxo\Neues;

use rex;
use rex_api_function;
use rex_clang;
use rex_escape;
use rex_path;
use rex_request;
use rex_response;
use rex_string;
use rex_yform_manager_collection;
use SimpleXMLElement;

/* Achtung, evtl. Namespace entfernen weil anhand Klassennamen gesucht wird */

class rex_api_neues_rss extends rex_api_function
class neues_rss_api
{
protected $published = true; // Erlaubt den Aufruf aus dem Frontend

Expand Down Expand Up @@ -51,7 +50,7 @@ public static function joinUrls($url1, $url2)
return rtrim($url1, '/') . '/' . ltrim($url2, '/');
}

public static function createRssFeed(rex_yform_manager_collection $collection, $domain, $lang, $description, $filename = 'rss.neues.xml')
public static function createRssFeed(\rex_yform_manager_collection $collection, $domain, $lang, $description, $filename = 'rss.neues.xml')
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"></rss>');

Expand Down
7 changes: 5 additions & 2 deletions package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ load: late

requires:
php:
version: '>8.1,<9'
redaxo: ^5.15

version: '>7.3,<9'
redaxo: ^5.17


packages:
yform: '^4'
yform_field: '^2.3.0'
Expand Down
Loading