diff --git a/ChangeLog b/ChangeLog index 781faa6bd..4ad650241 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +3.0.0-alpha4 (2013-05-??) + * Added: It's now possible to send parser options to the splitter classes. + 3.0.0-alpha3 (2013-05-13) * Changed: propertyMap, valueMap and componentMap are now static properties. diff --git a/lib/Sabre/VObject/Parser/MimeDir.php b/lib/Sabre/VObject/Parser/MimeDir.php index b966d0dc7..fd054b205 100644 --- a/lib/Sabre/VObject/Parser/MimeDir.php +++ b/lib/Sabre/VObject/Parser/MimeDir.php @@ -64,13 +64,15 @@ class MimeDir { * Optionally, it's possible to parse the input stream here. * * @param resource|null|string $input + * @param int $options Any parser options (OPTION constants). * @return void */ - public function __construct($input = null) { + public function __construct($input = null, $options = 0) { if (!is_null($input)) { $this->setInput($input); } + $this->options = $options; } @@ -81,10 +83,10 @@ public function __construct($input = null) { * used. * * @param string|resource|null $input - * @param int $options + * @param int|null $options * @return array */ - public function parse($input = null, $options = 0) { + public function parse($input = null, $options = null) { $this->root = null; if (!is_null($input)) { @@ -93,7 +95,7 @@ public function parse($input = null, $options = 0) { } - $this->options = $options; + if (!is_null($options)) $this->options = $options; $this->parseDocument(); diff --git a/lib/Sabre/VObject/Splitter/ICalendar.php b/lib/Sabre/VObject/Splitter/ICalendar.php index 936164d85..62e50489a 100644 --- a/lib/Sabre/VObject/Splitter/ICalendar.php +++ b/lib/Sabre/VObject/Splitter/ICalendar.php @@ -42,10 +42,11 @@ class ICalendar implements SplitterInterface { * The splitter should receive an readable file stream as it's input. * * @param resource $input + * @param int $options Parser options, see the OPTIONS constants. */ - public function __construct($input) { + public function __construct($input, $options = 0) { - $data = VObject\Reader::read($input); + $data = VObject\Reader::read($input, $options); $vtimezones = array(); $components = array(); diff --git a/lib/Sabre/VObject/Splitter/VCard.php b/lib/Sabre/VObject/Splitter/VCard.php index d00f6b762..8d41ae3f5 100644 --- a/lib/Sabre/VObject/Splitter/VCard.php +++ b/lib/Sabre/VObject/Splitter/VCard.php @@ -42,11 +42,12 @@ class VCard implements SplitterInterface { * The splitter should receive an readable file stream as it's input. * * @param resource $input + * @param int $options Parser options, see the OPTIONS constants. */ - public function __construct($input) { + public function __construct($input, $options = 0) { $this->input = $input; - $this->parser = new MimeDir($input); + $this->parser = new MimeDir($input, $options); } diff --git a/lib/Sabre/VObject/Version.php b/lib/Sabre/VObject/Version.php index 1b3422287..01c827a41 100644 --- a/lib/Sabre/VObject/Version.php +++ b/lib/Sabre/VObject/Version.php @@ -14,6 +14,6 @@ class Version { /** * Full version number */ - const VERSION = '3.0.0-alpha3'; + const VERSION = '3.0.0-alpha4'; }