Documentation

Core_Rss_Read
in package

Parse RSS 2.0

Tags
subpackage

Core\Rss

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

Properties

$_chanel  : array<string|int, mixed>
Массив с данными о канале
$_data  : string
File content
$_defaultChanel  : array<string|int, mixed>
Пустой массив с полями канала
$_defaultRow  : array<string|int, mixed>
Пустой массив с полями записи
$_encoding  : string
Внутренняя кодировка, используемая при работе с RSS
$_itemCount  : int
Items count
$_items  : mixed
Массив элементов
$_rss  : string
RSS
$_tag  : string
XML tag
$_xml_parser  : mixed
XML parser

Methods

__construct()  : mixed
Constructor
characterData()  : self
Callback function for xml parser
clear()  : self
Clear object
fetchClose()  : self
Callback function for xml parser
fetchOpen()  : self
Callback function for xml parser
loadFile()  : self
Load file
loadUrl()  : self
Load URL
parse()  : array<string|int, mixed>
Чтение данных из RSS

Properties

$_chanel

Массив с данными о канале

protected array<string|int, mixed> $_chanel = \NULL

$_data

File content

protected string $_data = \NULL

$_defaultChanel

Пустой массив с полями канала

protected static array<string|int, mixed> $_defaultChanel = array('title' => '', 'link' => '', 'description' => '', 'image' => array('title' => '', 'link' => '', 'url' => ''))

$_defaultRow

Пустой массив с полями записи

protected static array<string|int, mixed> $_defaultRow = array('title' => '', 'link' => '', 'description' => '', 'category' => array(), 'pubdate' => '', 'yandex:full-text' => '')

$_encoding

Внутренняя кодировка, используемая при работе с RSS

protected string $_encoding = ''

$_itemCount

Items count

protected int $_itemCount = 0

$_items

Массив элементов

protected mixed $_items = \NULL

$_rss

RSS

protected string $_rss = \NULL

$_tag

XML tag

protected string $_tag = \NULL

$_xml_parser

XML parser

protected mixed $_xml_parser = \NULL

Methods

__construct()

Constructor

public __construct() : mixed

characterData()

Callback function for xml parser

public characterData(string $parser, string $data) : self
Parameters
$parser : string

reference to the XML parser to set up character data handler function

$data : string

contains the character data as a string

Return values
self

clear()

Clear object

public clear() : self
Return values
self

fetchClose()

Callback function for xml parser

public fetchClose(string $parser, string $name) : self
Parameters
$parser : string

reference to the XML parser to set up character data handler function

$name : string

contains the name of the element for which this handler is called

Return values
self

fetchOpen()

Callback function for xml parser

public fetchOpen(string $parser, string $name, array<string|int, mixed> $attrs) : self
Parameters
$parser : string

reference to the XML parser to set up character data handler function

$name : string

contains the name of the element for which this handler is called

$attrs : array<string|int, mixed>

contains an associative array with the element's attributes

Return values
self

loadFile()

Load file

public loadFile(string $path) : self
Parameters
$path : string

file path

Return values
self

loadUrl()

Load URL

public loadUrl(string $url) : self
Parameters
$url : string

URL

Return values
self

parse()

Чтение данных из RSS

public parse([array<string|int, mixed> $encoding = NULL ]) : array<string|int, mixed>
Parameters
$encoding : array<string|int, mixed> = NULL

кодировка документа

Return values
array<string|int, mixed>

ассоциативнй массив
[chanel] => Array

  • (
    [title] =>
    [link] =>
    [description] =>
    [image] => Array
    (
    [title] =>
    [link] =>
    [url] =>
    )
    )
    [items] => Array
    (
    [] => Array
    (
    [title] =>
    [link] =>
    [desc] =>
    [category] =>
    [pubdate] =>
    [yandex:full-text] =>
    )
    )

        
On this page

Search results