Path: blob/master/src/applications/calendar/import/PhabricatorCalendarICSImportEngine.php
12256 views
<?php12abstract class PhabricatorCalendarICSImportEngine3extends PhabricatorCalendarImportEngine {45final protected function importICSData(6PhabricatorUser $viewer,7PhabricatorCalendarImport $import,8$data) {910$parser = new PhutilICSParser();1112try {13$document = $parser->parseICSData($data);14} catch (PhutilICSParserException $ex) {15// TODO: In theory, it would be nice to store these in a fully abstract16// form so they can be translated at display time. As-is, we'll store the17// error messages in whatever language we were using when the parser18// failure occurred.1920$import->newLogMessage(21PhabricatorCalendarImportICSLogType::LOGTYPE,22array(23'ics.code' => $ex->getParserFailureCode(),24'ics.message' => $ex->getMessage(),25));2627$document = null;28}2930foreach ($parser->getWarnings() as $warning) {31$import->newLogMessage(32PhabricatorCalendarImportICSWarningLogType::LOGTYPE,33array(34'ics.warning.code' => $warning['code'],35'ics.warning.line' => $warning['line'],36'ics.warning.text' => $warning['text'],37'ics.warning.message' => $warning['message'],38));39}4041return $this->importEventDocument($viewer, $import, $document);42}4344}454647