3 abstract class PhabricatorCalendarICSImportEngine
4 extends PhabricatorCalendarImportEngine
{
6 final protected function importICSData(
7 PhabricatorUser
$viewer,
8 PhabricatorCalendarImport
$import,
11 $parser = new PhutilICSParser();
14 $document = $parser->parseICSData($data);
15 } catch (PhutilICSParserException
$ex) {
16 // TODO: In theory, it would be nice to store these in a fully abstract
17 // form so they can be translated at display time. As-is, we'll store the
18 // error messages in whatever language we were using when the parser
21 $import->newLogMessage(
22 PhabricatorCalendarImportICSLogType
::LOGTYPE
,
24 'ics.code' => $ex->getParserFailureCode(),
25 'ics.message' => $ex->getMessage(),
31 foreach ($parser->getWarnings() as $warning) {
32 $import->newLogMessage(
33 PhabricatorCalendarImportICSWarningLogType
::LOGTYPE
,
35 'ics.warning.code' => $warning['code'],
36 'ics.warning.line' => $warning['line'],
37 'ics.warning.text' => $warning['text'],
38 'ics.warning.message' => $warning['message'],
42 return $this->importEventDocument($viewer, $import, $document);