Skip to content

Commit

Permalink
Merge pull request #69 from FriendsOfREDAXO/namespace
Browse files Browse the repository at this point in the history
neues_rss rex_api explizit registrieren
  • Loading branch information
alxndr-w authored Apr 3, 2024
2 parents 9f8b6a6 + 16a24b3 commit baa86a6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
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

0 comments on commit baa86a6

Please sign in to comment.