roelofjan-elsinga/atom-feed-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roelofjan-elsinga/atom-feed-generator

最新稳定版本:0.2.4

Composer 安装命令:

composer require roelofjan-elsinga/atom-feed-generator

包简介

A package to easily generate an Atom feed.

README 文档

README

Build status StyleCI Status Code coverage Total Downloads Latest Stable Version License

This package helps you to very easily generate an Atom Feed for your website.

Installation

You can include this package through Composer using:

composer require roelofjan-elsinga/atom-feed-generator

Usage

use AtomFeedGenerator\AtomFeedGenerator;

/**@var \AtomFeedGenerator\FeedConfiguration $configuration*/

$generator = AtomFeedGenerator::withConfiguration($configuration);

// or

$generator = new AtomFeedGenerator($configuration);

/**@var \AtomFeedGenerator\FeedItem $feed_item*/

$generator->add($feed_item);

$atom_string = $generator->generate();

print $atom_string;

This will result in:

<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Feed title</title>
    <link href="https://example.com"/>
    <updated>2019-01-01T12:00:00+00:00</updated>
    <author>
        <name>Feed Author</name>
    </author>
    <id>https://example.com</id>
    <link rel="self" href='https://example.com/feed'/>
    <entry>
        <title>Article title</title>
        <link href="https://example.com/articles/test-article"/>
        <id>https://example.com/articles/test-article</id>
        <updated>2019-01-02T12:00:00+00:00</updated>
        <published>2019-01-01T12:00:00+00:00</published>
        <content>This is the content of the item</content>
        <summary>This is the summary</summary>
        <media:content xmlns:media="http://search.yahoo.com/mrss/" url="/images/test-image.jpg" medium="image" type="image/jpeg" width="1920" height="1080" />
    </entry>
</feed>

Testing

You can run the included tests by running ./vendor/bin/phpunit in your terminal.

统计信息

  • 总下载量: 3.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-14