ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
parse ($input=null, $options=0) | |
Parses an iCalendar or vCard file. More... | |
setCharset ($charset) | |
By default all input will be assumed to be UTF-8. More... | |
setInput ($input) | |
Sets the input buffer. More... | |
Public Member Functions inherited from Sabre\VObject\Parser\Parser | |
__construct ($input=null, $options=0) | |
Creates the parser. More... | |
parse ($input=null, $options=0) | |
This method starts the parsing process. More... | |
setInput ($input) | |
Sets the input data. More... | |
Static Public Member Functions | |
static | unescapeValue ($input, $delimiter=';') |
Unescapes a property value. More... | |
Protected Member Functions | |
parseDocument () | |
Parses an entire document. More... | |
parseLine ($line) | |
Parses a line, and if it hits a component, it will also attempt to parse the entire component. More... | |
readLine () | |
Reads a single line from the buffer. More... | |
readProperty ($line) | |
Reads a property or component from a line. More... | |
Protected Attributes | |
$input | |
$root | |
$charset = 'UTF-8' | |
$lineBuffer | |
$lineIndex = 0 | |
The real current line number. More... | |
$startLine = 0 | |
$rawLine | |
Protected Attributes inherited from Sabre\VObject\Parser\Parser | |
$options | |
Static Protected Attributes | |
static | $SUPPORTED_CHARSETS |
The list of character sets we support when decoding. More... | |
Private Member Functions | |
unescapeParam ($input) | |
Unescapes a parameter value. More... | |
extractQuotedPrintableValue () | |
Gets the full quoted printable value. More... | |
Additional Inherited Members | |
Data Fields inherited from Sabre\VObject\Parser\Parser | |
const | OPTION_FORGIVING = 1 |
Turning on this option makes the parser more forgiving. More... | |
const | OPTION_IGNORE_INVALID_LINES = 2 |
If this option is turned on, any lines we cannot parse will be ignored by the reader. More... | |
MimeDir parser.
This class parses iCalendar 2.0 and vCard 2.1, 3.0 and 4.0 files. This parser will return one of the following two objects from the parse method:
Definition at line 25 of file MimeDir.php.
|
private |
Gets the full quoted printable value.
We need a special method for this, because newlines have both a meaning in vCards, and in QuotedPrintable.
This method does not do any decoding.
Definition at line 661 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$rawLine, and Sabre\VObject\Parser\MimeDir\readLine().
Referenced by Sabre\VObject\Parser\MimeDir\readProperty().
Sabre\VObject\Parser\MimeDir::parse | ( | $input = null , |
|
$options = 0 |
|||
) |
Parses an iCalendar or vCard file.
Pass a stream or a string. If null is parsed, the existing buffer is used.
string | resource | null | $input | |
int | $options |
Definition at line 77 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$input, Sabre\VObject\Parser\Parser\$options, Sabre\VObject\Parser\MimeDir\$root, Sabre\VObject\Parser\MimeDir\parseDocument(), and Sabre\VObject\Parser\MimeDir\setInput().
|
protected |
Parses an entire document.
Definition at line 148 of file MimeDir.php.
References Sabre\VObject\Component\VCalendar\$componentMap, Sabre\VObject\Component\VCard\$componentMap, $name, $result, Sabre\VObject\Parser\MimeDir\parseLine(), and Sabre\VObject\Parser\MimeDir\readLine().
Referenced by Sabre\VObject\Parser\MimeDir\parse().
|
protected |
Parses a line, and if it hits a component, it will also attempt to parse the entire component.
string | $line | Unfolded line |
Definition at line 203 of file MimeDir.php.
References $name, $result, Sabre\VObject\Parser\MimeDir\readLine(), and Sabre\VObject\Parser\MimeDir\readProperty().
Referenced by Sabre\VObject\Parser\MimeDir\parseDocument().
|
protected |
Reads a single line from the buffer.
This method strips any newlines and also takes care of unfolding.
Definition at line 284 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$lineBuffer, Sabre\VObject\Parser\MimeDir\$lineIndex, Sabre\VObject\Parser\MimeDir\$rawLine, and input.
Referenced by Sabre\VObject\Parser\MimeDir\extractQuotedPrintableValue(), Sabre\VObject\Parser\MimeDir\parseDocument(), and Sabre\VObject\Parser\MimeDir\parseLine().
|
protected |
Reads a property or component from a line.
Looping through all the tokens.
Note that we are looping through them in reverse order, because if a sub-pattern matched, the subsequent named patterns will not show up in the result.
Definition at line 337 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$charset, $name, Sabre\VObject\Parser\MimeDir\extractQuotedPrintableValue(), Sabre\VObject\Parser\MimeDir\unescapeParam(), and Sabre\VObject\Document\VCARD21.
Referenced by Sabre\VObject\Parser\MimeDir\parseLine().
Sabre\VObject\Parser\MimeDir::setCharset | ( | $charset | ) |
By default all input will be assumed to be UTF-8.
However, both iCalendar and vCard might be encoded using different character sets. The character set is usually set in the mime-type.
If this is the case, use setEncoding to specify that a different encoding will be used. If this is set, the parser will automatically convert all incoming data to UTF-8.
string | $charset |
Definition at line 107 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$charset.
Sabre\VObject\Parser\MimeDir::setInput | ( | $input | ) |
Sets the input buffer.
Must be a string or stream.
resource | string | $input |
Definition at line 123 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$input, GuzzleHttp\Psr7\$stream, and input.
Referenced by Sabre\VObject\Parser\MimeDir\parse().
|
private |
Unescapes a parameter value.
vCard 2.1:
vCard 3.0 (rfc2425, rfc2426):
vCard 4.0 (rfc6350)
iCalendar 2.0 (rfc5545)
Parameter escaping mechanism (rfc6868) :
string | $input |
Definition at line 629 of file MimeDir.php.
References Sabre\VObject\Parser\MimeDir\$input.
Referenced by Sabre\VObject\Parser\MimeDir\readProperty().
|
static |
Unescapes a property value.
vCard 2.1 says:
vCard 3.0 says:
vCard 4.0 (rfc6350) says:
Even though the spec says that commas must always be escaped, the example for GEO in Section 6.5.2 seems to violate this.
iCalendar 2.0 (rfc5545) says:
Now for the parameters
If delimiter is not set (null) this method will just return a string. If it's a comma or a semi-colon the string will be split on those characters, and always return an array.
string | $input | |
string | $delimiter |
Definition at line 549 of file MimeDir.php.
References $delimiter, Sabre\VObject\Parser\MimeDir\$input, and $result.
Referenced by Sabre\VObject\Property\Text\setRawMimeDirValue().
|
protected |
Definition at line 53 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\readProperty(), and Sabre\VObject\Parser\MimeDir\setCharset().
|
protected |
Definition at line 32 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\parse(), Sabre\VObject\Parser\MimeDir\setInput(), Sabre\VObject\Parser\MimeDir\unescapeParam(), and Sabre\VObject\Parser\MimeDir\unescapeValue().
|
protected |
Definition at line 253 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\readLine().
|
protected |
The real current line number.
Definition at line 258 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\readLine().
|
protected |
Definition at line 273 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\extractQuotedPrintableValue(), and Sabre\VObject\Parser\MimeDir\readLine().
|
protected |
Definition at line 39 of file MimeDir.php.
Referenced by Sabre\VObject\Parser\MimeDir\parse().
|
protected |
Definition at line 266 of file MimeDir.php.
|
staticprotected |
The list of character sets we support when decoding.
This would be a const expression but for now we need to support PHP 5.5
Definition at line 60 of file MimeDir.php.