Download the PHP package vamischenko/xmlfeeds without Composer

On this page you can find all versions of the php package vamischenko/xmlfeeds. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xmlfeeds

xml-feeds

PHP 8.2+ библиотека для генерации XML-фидов (RSS 2.0, Atom 1.0) под новостные агрегаторы и социальные сети: Яндекс, Google News, Рамблер, Mail.ru, Telegram, ВКонтакте, Facebook и др. Без привязки к фреймворку, Fluent API, опциональная валидация (поля + XSD).

Установка

Требования: PHP 8.2+, ext-dom, ext-xmlwriter, ext-libxml.

Быстрый старт

build() возвращает строку с XML (UTF-8, декларация <?xml version="1.0" encoding="UTF-8"?>).

Платформы

Новостные агрегаторы

Класс Назначение Формат Расширения
XmlFeeds\Platforms\RssFeed Чистый RSS 2.0 RSS 2.0 —
XmlFeeds\Platforms\AtomFeed Atom 1.0 Atom 1.0 —
XmlFeeds\Platforms\YandexNews Яндекс.Новости RSS 2.0 yandex:*, content:encoded
XmlFeeds\Platforms\YandexZen Яндекс Дзен RSS 2.0 media:*, content:encoded
XmlFeeds\Platforms\YandexTurbo Яндекс Турбо RSS 2.0 turbo:*, content:encoded
XmlFeeds\Platforms\GoogleNews Google News RSS 2.0 news:*, content:encoded
XmlFeeds\Platforms\RamblerNews Рамблер/Новости RSS 2.0 content:encoded
XmlFeeds\Platforms\MailRuNews Mail.ru Новости RSS 2.0 content:encoded

Социальные сети и мессенджеры

Класс Назначение Особенности
XmlFeeds\Platforms\TelegramChannel Telegram RSS-боты Заголовок ≤ 255 символов (лимит caption)
XmlFeeds\Platforms\VkontakteFeed ВКонтакте / SMM-сервисы Стандартный RSS для автопостинга
XmlFeeds\Platforms\FacebookFeed Facebook Instant Articles content обязателен (требование IA-формата)

Канал задаётся через title, link, description; опционально language (по умолчанию ru), lastBuildDate.

Поля элементов (маппер)

Поле Тип Описание
title string Заголовок, обязательное
link string Полный URL статьи, обязательное
pubDate \DateTimeInterface\|string Дата публикации
description string Краткое описание / лид
content string Полный HTML-текст (CDATA)
author string Автор
category string\|list<string> Рубрика (одна или несколько)
enclosure array{url, type, length} Медиавложение
keywords string\|list<string> Ключевые слова
guid string Уникальный идентификатор
source string Источник (Яндекс.Новости)
genre string Жанр (Яндекс.Новости)
turboContent string HTML Турбо-страницы (Яндекс Турбо)
publication_name string Название издания (Google News)
publication_language string Язык издания (Google News)
media:content array{url, type, medium} Медиа (Яндекс Дзен)
media:thumbnail array{url} Превью (Яндекс Дзен)

Полный список разрешённых полей — requiredFields() + optionalFields() у выбранной платформы.

Валидация

Что проверяется:

Социальные сети — примеры

Telegram

ВКонтакте

Facebook Instant Articles

Дополнительные возможности

Запись в файл (для больших фидов XmlGenerator пишет через XMLWriter::openUri без буферизации):

Свой генератор — реализуйте XmlFeeds\Contracts\GeneratorInterface (и StreamableGeneratorInterface для потоковой записи в файл):

Свой валидатор схемы — реализуйте XmlFeeds\Contracts\SchemaValidatorInterface:

Дополнительный валидатор (запускается после встроенного) — реализуйте XmlFeeds\Contracts\ValidatorInterface:

Строгий список полей — запрещает ключи, не объявленные платформой:

Логирование (PSR-3): при ошибке валидации пишется уровень error (throw=true) или warning (throw=false):

Новая платформа — реализуйте PlatformInterface (или расширьте AbstractRssPlatform):

Разработка

Параметр бенчмарка: php tools/benchmark.php 5000.

Лицензия

MIT


English

PHP 8.2+ library for generating XML feeds (RSS 2.0, Atom 1.0) for news aggregators and social networks: Yandex, Google News, Rambler, Mail.ru, Telegram, VKontakte, Facebook, and others. Framework-agnostic, Fluent API, optional validation (field rules + XSD).

Installation

Requirements: PHP 8.2+, ext-dom, ext-xmlwriter, ext-libxml.

Quick start

Platforms

News aggregators

Class Purpose Format Extensions
XmlFeeds\Platforms\RssFeed Plain RSS 2.0 RSS 2.0 —
XmlFeeds\Platforms\AtomFeed Atom 1.0 Atom 1.0 —
XmlFeeds\Platforms\YandexNews Yandex News RSS 2.0 yandex:*, content:encoded
XmlFeeds\Platforms\YandexZen Yandex Zen RSS 2.0 media:*, content:encoded
XmlFeeds\Platforms\YandexTurbo Yandex Turbo RSS 2.0 turbo:*, content:encoded
XmlFeeds\Platforms\GoogleNews Google News RSS 2.0 news:*, content:encoded
XmlFeeds\Platforms\RamblerNews Rambler RSS 2.0 content:encoded
XmlFeeds\Platforms\MailRuNews Mail.ru RSS 2.0 content:encoded

Social networks & messengers

Class Purpose Notes
XmlFeeds\Platforms\TelegramChannel Telegram RSS bots Title truncated to 255 chars
XmlFeeds\Platforms\VkontakteFeed VKontakte / SMM tools Standard RSS autopublishing
XmlFeeds\Platforms\FacebookFeed Facebook Instant Articles content field is required

Validation

Extending

Development

License

MIT


All versions of xmlfeeds with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-xmlwriter Version *
ext-libxml Version *
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vamischenko/xmlfeeds contains the following files

Loading the files please wait ...