diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..548cacd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# craft-plain-ics Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). + +## 2.0.0 - 2018-06-03 +### Added +- Initial craft 3 release + diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..ab8e288 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2018 Plain Language + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/PlainIcsPlugin.php b/PlainIcsPlugin.php deleted file mode 100755 index 743fb01..0000000 --- a/PlainIcsPlugin.php +++ /dev/null @@ -1,95 +0,0 @@ -=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-mbstring": "Massive performance enhancement of line folding" - }, - "type": "library", - "autoload": { - "psr-4": { - "Eluceo\\iCal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Markus Poerschke", - "email": "markus@eluceo.de", - "role": "Developer" - } - ], - "description": "The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.", - "homepage": "https://github.com/markuspoerschke/iCal", - "keywords": [ - "calendar", - "iCalendar", - "ical", - "ics", - "php calendar" - ], - "time": "2017-10-26T11:24:45+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/models/PlainIcs_EventModel.php b/models/PlainIcs_EventModel.php deleted file mode 100755 index 458f8d5..0000000 --- a/models/PlainIcs_EventModel.php +++ /dev/null @@ -1,89 +0,0 @@ -title; - } - - /** - * Define the model attributes. - * - * @return array - */ - protected function defineAttributes() - { - // Note that our datetimes can't be AttributeType:DateTime, - // otherwise they'll lose the time component. - return [ - 'title' => AttributeType::String, - 'startDateTime' => AttributeType::String, - 'endDateTime' => AttributeType::String, - 'description' => AttributeType::String, - 'url' => AttributeType::String, - 'location' => AttributeType::String, - 'locationTitle' => AttributeType::String, - 'locationGeo' => AttributeType::String, - 'filename' => AttributeType::String, - 'alarmTrigger' => AttributeType::String, - 'alarmAction' => AttributeType::String, - 'alarmDescription' => AttributeType::String, - ]; - } - - /** - * Force-download the .ics file according to my opinion. - * - * @return iCal - */ - public function ical() - { - $timezone = new \DateTimeZone(craft()->timeZone); - - $vCalendar = new iCal(craft()->config->get('environmentVariables')['siteUrl']); - $vEvent = new iCalEvent(); - $vAlarm = new iCalAlarm(); - $startDate = new DateTime($this->startDateTime, $timezone); - $endDate = new DateTime($this->endDateTime, $timezone); - - if ($this->alarmAction) { - $vAlarm - ->setTrigger($this->alarmTrigger) - ->setAction($this->alarmAction) - ->setDescription($this->alarmDescription); - } - - $vEvent - ->setDtStart($startDate) - ->setDtEnd($endDate) - ->setSummary($this->title) - ->setDescription($this->description) - ->setUrl($this->url) - ->setLocation($this->location, $this->locationTitle, $this->locationGeo) - ->setUseTimezone(true) - ->setTimeTransparency('TRANSPARENT'); - - if ($this->alarmAction) { - $vEvent->addComponent($vAlarm); - } - - $vCalendar->addEvent($vEvent); - - return $vCalendar; - } - -} diff --git a/resources/img/plugin-logo.png b/resources/img/plugin-logo.png new file mode 100755 index 0000000..1418323 Binary files /dev/null and b/resources/img/plugin-logo.png differ diff --git a/src/PlainIcs.php b/src/PlainIcs.php new file mode 100644 index 0000000..07802dc --- /dev/null +++ b/src/PlainIcs.php @@ -0,0 +1,81 @@ +name = $this->getName(); + + // Register our variables + Event::on( + CraftVariable::class, + CraftVariable::EVENT_INIT, + function (Event $event) { + /** @var CraftVariable $variable */ + $variable = $event->sender; + $variable->set('plainIcs', PlainIcsVariable::class); + } + ); + + Craft::info( + Craft::t( + 'plain-ics', + '{name} plugin loaded', + ['name' => $this->name] + ), + __METHOD__ + ); + } + + /** + * Returns the user-facing name of the plugin, which can override the name + * in composer.json + * + * @return string + */ + public function getName() + { + return Craft::t('plain-ics', 'Plain ICS'); + } +} diff --git a/src/models/PlainIcs_EventModel.php b/src/models/PlainIcs_EventModel.php new file mode 100644 index 0000000..cb6e65a --- /dev/null +++ b/src/models/PlainIcs_EventModel.php @@ -0,0 +1,145 @@ +getTimeZone()); + + $vCalendar = new iCal(Craft::$app->config->general->siteUrl || 'site'); + $vEvent = new iCalEvent(); + $vAlarm = new iCalAlarm(); + $startDate = new \DateTime($this->startDateTime, $timezone); + $endDate = new \DateTime($this->endDateTime, $timezone); + + if ($this->alarmAction) { + $vAlarm + ->setTrigger($this->alarmTrigger) + ->setAction($this->alarmAction) + ->setDescription($this->alarmDescription); + } + + $vEvent + ->setDtStart($startDate) + ->setDtEnd($endDate) + ->setSummary($this->title) + ->setDescription($this->description) + ->setUrl($this->url) + ->setLocation($this->location, $this->locationTitle, $this->locationGeo) + ->setUseTimezone(true) + ->setUseTimezone($this->useTimezone) + ->setUseUtc($this->useUtc) + ->setTimeTransparency('TRANSPARENT'); + + if ($this->alarmAction) { + $vEvent->addComponent($vAlarm); + } + + $vCalendar->addEvent($vEvent); + + return $vCalendar; + } +} diff --git a/src/translations/en/plainics.php b/src/translations/en/plainics.php new file mode 100644 index 0000000..faaff09 --- /dev/null +++ b/src/translations/en/plainics.php @@ -0,0 +1,17 @@ + 'Plain ICS plugin loaded', +]; diff --git a/variables/PlainIcsVariable.php b/src/variables/PlainIcsVariable.php old mode 100755 new mode 100644 similarity index 72% rename from variables/PlainIcsVariable.php rename to src/variables/PlainIcsVariable.php index 791e6cf..1753db8 --- a/variables/PlainIcsVariable.php +++ b/src/variables/PlainIcsVariable.php @@ -1,9 +1,28 @@ $parameter) { - if (isset($event->$key)) { - $event->$key = $parameter; - } + $event->$key = $parameter; } // Set the filename for the .ics file. @@ -50,5 +67,4 @@ public function render($parameters = null, $return = false) // Die exit; } - } diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 5a95476..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index 1a28124..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2016 Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/eluceo/ical/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index faf0008..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,52 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInitfe3c94d85dadd02ad23aa7ceff58556b::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - return $loader; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index c905a3a..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,31 +0,0 @@ - - array ( - 'Eluceo\\iCal\\' => 12, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Eluceo\\iCal\\' => - array ( - 0 => __DIR__ . '/..' . '/eluceo/ical/src', - ), - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitfe3c94d85dadd02ad23aa7ceff58556b::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitfe3c94d85dadd02ad23aa7ceff58556b::$prefixDirsPsr4; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index cc7a05e..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,55 +0,0 @@ -[ - { - "name": "eluceo/ical", - "version": "0.13.0", - "version_normalized": "0.13.0.0", - "source": { - "type": "git", - "url": "https://github.com/markuspoerschke/iCal.git", - "reference": "913b89e67b9f7865e1399b2dbc22d21857e7e236" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/markuspoerschke/iCal/zipball/913b89e67b9f7865e1399b2dbc22d21857e7e236", - "reference": "913b89e67b9f7865e1399b2dbc22d21857e7e236", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-mbstring": "Massive performance enhancement of line folding" - }, - "time": "2017-10-26T11:24:45+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-4": { - "Eluceo\\iCal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Markus Poerschke", - "email": "markus@eluceo.de", - "role": "Developer" - } - ], - "description": "The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.", - "homepage": "https://github.com/markuspoerschke/iCal", - "keywords": [ - "calendar", - "iCalendar", - "ical", - "ics", - "php calendar" - ] - } -] diff --git a/vendor/eluceo/ical/.gitattributes b/vendor/eluceo/ical/.gitattributes deleted file mode 100644 index 4886f50..0000000 --- a/vendor/eluceo/ical/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -/.gitattributes export-ignore -/.gitignore export-ignore -/.php_cs export-ignore -/.scrutinizer.yml export-ignore -/.travis.yml export-ignore -/CHANGELOG.md export-ignore -/CONTRIBUTING.md export-ignore -/UPGRADE.md export-ignore -/examples export-ignore -/phpunit.xml.dist export-ignore -/README.md export-ignore -/tests export-ignore diff --git a/vendor/eluceo/ical/.gitignore b/vendor/eluceo/ical/.gitignore deleted file mode 100644 index da09e59..0000000 --- a/vendor/eluceo/ical/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.php_cs.cache -/composer.lock -/vendor diff --git a/vendor/eluceo/ical/.php_cs b/vendor/eluceo/ical/.php_cs deleted file mode 100644 index cc8c1c5..0000000 --- a/vendor/eluceo/ical/.php_cs +++ /dev/null @@ -1,24 +0,0 @@ - - -This source file is subject to the MIT license that is bundled -with this source code in the file LICENSE. -EOF; - -$finder = PhpCsFixer\Finder::create()->in(__DIR__ . '/src'); - -return PhpCsFixer\Config::create() - ->setRules([ - '@Symfony' => true, - 'ordered_imports' => true, - 'concat_space' => ['spacing' => 'one'], - 'array_syntax' => ['syntax' => 'short'], - 'header_comment' => ['header' => $headerComment], - 'yoda_style' => false, - ]) - ->setFinder($finder) -; diff --git a/vendor/eluceo/ical/.scrutinizer.yml b/vendor/eluceo/ical/.scrutinizer.yml deleted file mode 100644 index 8e7b43e..0000000 --- a/vendor/eluceo/ical/.scrutinizer.yml +++ /dev/null @@ -1,20 +0,0 @@ -filter: - excluded_paths: - - tests/* - -tools: - php_cs_fixer: true - php_code_sniffer: - config: - standard: PSR2 - php_mess_detector: true - php_analyzer: true - sensiolabs_security_checker: true - external_code_coverage: - timeout: 300 - runs: 1 - -checks: - php: - code_rating: true - duplication: true diff --git a/vendor/eluceo/ical/.travis.yml b/vendor/eluceo/ical/.travis.yml deleted file mode 100644 index a110052..0000000 --- a/vendor/eluceo/ical/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-dist - - travis_retry wget http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.clover - - php php-cs-fixer-v2.phar fix --dry-run --diff - -after_script: - - travis_retry wget https://scrutinizer-ci.com/ocular.phar - - travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/vendor/eluceo/ical/CHANGELOG.md b/vendor/eluceo/ical/CHANGELOG.md deleted file mode 100644 index cc09e89..0000000 --- a/vendor/eluceo/ical/CHANGELOG.md +++ /dev/null @@ -1,84 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. - -## [0.13.0] - 2017-10-26 -### Changed -- Improve performance for long lines. By using mbstring the folding of lines is much faster and consumes less CPU and memory. [#103](https://github.com/markuspoerschke/iCal/pull/103) -- In UTC mode the time will be converted to UTC timezone. [#106](https://github.com/markuspoerschke/iCal/pull/106) - -## [0.12.1] - 2017-06-07 -### Fixed -- `\DateTimeImmutable` is now supported by events. When using `\DateTime` there will be no side effect anymore that will change the original date time object. [#98](https://github.com/markuspoerschke/iCal/pull/98), [#99](https://github.com/markuspoerschke/iCal/pull/99), [#100](https://github.com/markuspoerschke/iCal/pull/100) - -## [0.12.0] - 2017-05-10 -### Fixed -- Do not escape value of the GEO property [#79](https://github.com/markuspoerschke/iCal/pull/79) - -### Added -- Add support for `\DateTimerInterface`. This allows to use `\DateTimeImmutable`. [#86](https://github.com/markuspoerschke/iCal/issues/86) -- Add support for arbitrary time zone strings. [#87](https://github.com/markuspoerschke/iCal/issues/86),[#89](https://github.com/markuspoerschke/iCal/issues/86) -- Add new Geo property class [#79](https://github.com/markuspoerschke/iCal/pull/79) - -### Changed -- Drop support for old PHP versions: 5.3, 5.4, 5.6 -- Remove default value for `X-PUBLISHED-TTL`. This value controls the update interval if the ics file is synced. -The former default value was set to one week. If you want the behavior from version `< 0.12` you have to set the value: -`$vCalendar->setPublishedTTL('P1W')`. [#81](https://github.com/markuspoerschke/iCal/pull/81) - -### Removed -- Remove class `\Eluceo\iCal\Property\Event\Description` [#61](https://github.com/markuspoerschke/iCal/pull/61) -- Remove class `\Eluceo\iCal\Util\PropertyValueUtil` [#61](https://github.com/markuspoerschke/iCal/pull/61) - -## [0.11.2] - 2017-04-21 -### Fixed -- Do not escape value of the GEO property [#79](https://github.com/markuspoerschke/iCal/pull/79) - -## [0.11.1] - 2017-04-04 -### Fixed -- All days events (no time) ends on the next day. [#83](https://github.com/markuspoerschke/iCal/pull/83) -- Timezone will not applied on all days events [#83](https://github.com/markuspoerschke/iCal/pull/83) - -### Added -- Add `Event::getDtStart` method [#83](https://github.com/markuspoerschke/iCal/pull/83) - -## [0.11.0] - 2016-09-16 -### Added -- Allow multiple recurrence rules in an event [#77](https://github.com/markuspoerschke/iCal/pull/77) -- RecurrenceRule now also allows hourly, minutely and secondly frequencies [#78](https://github.com/markuspoerschke/iCal/pull/78) - -### Deprecated -- Adding a single recurrence rule to an event using `Event::setRecurrenceRule()` is deprecated and will be removed in 1.0. Use `Event::addRecurrenceRule()` instead. [#77](https://github.com/markuspoerschke/iCal/pull/77) - -## [0.10.1] - 2016-05-09 -### Fixed -- Problem with GEO property when importing into Google Calendar [#74](https://github.com/markuspoerschke/iCal/pull/74) - -## [0.10.0] - 2016-04-26 -### Changed -- Use 'escapeValue' to escape the new line character. [#60](https://github.com/markuspoerschke/iCal/pull/60) -- Order components by type when building ical file. [#65](https://github.com/markuspoerschke/iCal/pull/65) - -### Added -- X-ALT-DESC for HTML types with new descriptionHTML field. [#55](https://github.com/markuspoerschke/iCal/pull/55) -- Added a property and setter for calendar color. [#68](https://github.com/markuspoerschke/iCal/pull/68) -- Write also GEO property if geo location is given. [#66](https://github.com/markuspoerschke/iCal/pull/66) - -## [0.9.0] - 2015-11-13 -### Added -- CHANGELOG.md based on [’Keep a CHANGELOG’](https://github.com/olivierlacan/keep-a-changelog) -- Support event properties EXDATE and RECURRENCE-ID [#50](https://github.com/markuspoerschke/iCal/pull/53) - -### Changed -- Allow new lines in event descriptions [#53](https://github.com/markuspoerschke/iCal/pull/53) -- **Breaking Change:** Changed signature of the ```Event::setOrganizer``` method. Now there is is only one parameter that must be an instance of ```Property\Organizer```. -- Updated install section in README.md [#54](https://github.com/markuspoerschke/iCal/pull/53) - -[0.13.0]: https://github.com/markuspoerschke/iCal/compare/0.12.1...0.13.0 -[0.12.1]: https://github.com/markuspoerschke/iCal/compare/0.12.0...0.12.1 -[0.12.0]: https://github.com/markuspoerschke/iCal/compare/0.11.0...0.12.0 -[0.11.2]: https://github.com/markuspoerschke/iCal/compare/0.11.1...0.11.2 -[0.11.1]: https://github.com/markuspoerschke/iCal/compare/0.11.0...0.11.1 -[0.11.0]: https://github.com/markuspoerschke/iCal/compare/0.10.1...0.11.0 -[0.10.1]: https://github.com/markuspoerschke/iCal/compare/0.10.0...0.10.1 -[0.10.0]: https://github.com/markuspoerschke/iCal/compare/0.9.0...0.10.0 -[0.9.0]: https://github.com/markuspoerschke/iCal/compare/0.8.0...0.9.0 diff --git a/vendor/eluceo/ical/CONTRIBUTING.md b/vendor/eluceo/ical/CONTRIBUTING.md deleted file mode 100644 index 595e51e..0000000 --- a/vendor/eluceo/ical/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -# Contribution guide - -You found a bug? There is a missing feature? - -Please feel free to contribute to this project. New issues and merge requests are welcome! - -## Development - -### Unit Testing - -This project uses unit tests to keep the quality of this package high. If you can add some tests to your merge requests. - -Before you can execute your unit tests you have to install the required PHPUnit version by running `composer update`. -Run `composer test` on your command line to execute the unit tests. - -### Code Style - -This project uses the [PHP Coding Standards Fixer](http://cs.sensiolabs.org/). To fix or to check the code stlye -download the tool and execute it on your command line: - -``` -php ./php-cs-fixer-v2.phar fix -``` diff --git a/vendor/eluceo/ical/LICENSE b/vendor/eluceo/ical/LICENSE deleted file mode 100644 index 7e19fcc..0000000 --- a/vendor/eluceo/ical/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2017 Markus Poerschke - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/eluceo/ical/README.md b/vendor/eluceo/ical/README.md deleted file mode 100644 index baf0286..0000000 --- a/vendor/eluceo/ical/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# eluceo — iCal - -[![License](https://poser.pugx.org/eluceo/ical/license)](https://packagist.org/packages/eluceo/ical) -[![Latest Stable Version](https://poser.pugx.org/eluceo/ical/v/stable)](https://packagist.org/packages/eluceo/ical) -[![Monthly Downloads](https://poser.pugx.org/eluceo/ical/d/monthly)](https://packagist.org/packages/eluceo/ical) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/markuspoerschke/iCal/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/markuspoerschke/iCal/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/markuspoerschke/iCal/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/markuspoerschke/iCal/?branch=master) -[![Build Status](https://travis-ci.org/markuspoerschke/iCal.svg?branch=master)](https://travis-ci.org/markuspoerschke/iCal) - -This package offers a abstraction layer for creating iCalendars. The output will -follow [RFC 5545](http://www.ietf.org/rfc/rfc5545.txt) as best as possible. - -The following components are supported at this time: - -* VCALENDAR -* VEVENT -* VALARM -* VTIMEZONE - -## Installation - -You can install this package by using [Composer](http://getcomposer.org), running this command: - -```sh -composer require eluceo/ical -``` -Link to Packagist: https://packagist.org/packages/eluceo/ical - -## Usage - -### Basic Usage - -#### 1. Create a Calendar object - -```PHP -$vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); -``` - -#### 2. Create an Event object - -```PHP -$vEvent = new \Eluceo\iCal\Component\Event(); -``` - -#### 3. Add your information to the Event - -```PHP -$vEvent - ->setDtStart(new \DateTime('2012-12-24')) - ->setDtEnd(new \DateTime('2012-12-24')) - ->setNoTime(true) - ->setSummary('Christmas') -; -``` - -#### 4. Add Event to Calendar - -```PHP -$vCalendar->addComponent($vEvent); -``` - -#### 5. Set HTTP-headers - -```PHP -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); -``` - -#### 6. Send output - -```PHP -echo $vCalendar->render(); -``` - -### Timezone support - -This package supports three different types of handling timezones: - -#### 1. UTC (default) - -In the default setting, UTC/GMT will be used as Timezone. The time will be formated as following: - -``` -DTSTART:20121224T180000Z -``` - -#### 2. Use explicit timezone - -You can use an explicit timezone by calling `$vEvent->setUseTimezone(true);`. The timezone of your -`\DateTime` object will be used. In this case the non-standard field "X-WR-TIMEZONE" will be used. -Be awre that this is a simple solution which is not supported by all calendar clients. -The output will be as following: - -``` -DTSTART;TZID=Europe/Berlin:20121224T180000 -``` - -#### 3. Use explicit timezone with definition - -You can use an explicit timezone and define it using `Timezone()` and `TimezoneRule()` (see example5.php). -The timezone of your `\DateTime` object will be used. The output will be as following: - -``` -BEGIN:VTIMEZONE -TZID:Europe/Berlin -X-LIC-LOCATION:Europe/Berlin -BEGIN:DAYLIGHT -TZOFFSETFROM:+0100 -TZOFFSETTO:+0200 -DTSTART:19810329T030000 -RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=3;BYDAY=-1SU -END:DAYLIGHT -BEGIN:STANDARD -TZOFFSETFROM:+0200 -TZOFFSETTO:+0100 -DTSTART:19961027T030000 -RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYDAY=-1SU -END:STANDARD -END:VTIMEZONE -... -DTSTART;TZID=Europe/Berlin:20121224T180000 -``` - -#### 4. Use locale time - -You can use local time by calling `$vEvent->setUseUtc(false);`. The output will be: - -``` -DTSTART:20121224T180000 -``` - -## License - -This package is released under the __MIT license__. - -Copyright (c) 2012-2017 Markus Poerschke - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/eluceo/ical/UPGRADE.md b/vendor/eluceo/ical/UPGRADE.md deleted file mode 100644 index 951209d..0000000 --- a/vendor/eluceo/ical/UPGRADE.md +++ /dev/null @@ -1,9 +0,0 @@ -# v0.8.0 -> v0.9.0 - -- The signature of the ```Event::setOrganizer``` method was changed: -Now there is is only one parameter that must be an instance of ```Property\Organizer```. - -# v0.7.0 -> v0.8.0 - -- The signature of the ```Event::setOrganizer``` method was changed: Now there are -two parameters name and email instead of an already formatted string. diff --git a/vendor/eluceo/ical/composer.json b/vendor/eluceo/ical/composer.json deleted file mode 100644 index 6c62d44..0000000 --- a/vendor/eluceo/ical/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "eluceo/ical", - "description": "The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.", - "license": "MIT", - "homepage": "https://github.com/markuspoerschke/iCal", - "authors": [ - { - "name": "Markus Poerschke", - "email": "markus@eluceo.de", - "role": "Developer" - } - ], - "keywords": [ - "ical", - "php calendar", - "icalendar", - "ics", - "calendar" - ], - "support": { - "issues": "https://github.com/markuspoerschke/iCal/issues", - "source": "https://github.com/markuspoerschke/iCal" - }, - "autoload": { - "psr-4": { - "Eluceo\\iCal\\": "src/" - } - }, - "require": { - "php": ">=7.0" - }, - "suggest": { - "ext-mbstring" : "Massive performance enhancement of line folding" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "scripts": { - "test": "phpunit" - } -} diff --git a/vendor/eluceo/ical/examples/example1.php b/vendor/eluceo/ical/examples/example1.php deleted file mode 100644 index 4d1d32c..0000000 --- a/vendor/eluceo/ical/examples/example1.php +++ /dev/null @@ -1,30 +0,0 @@ -setDtStart(new \DateTime('2012-12-24')); -$vEvent->setDtEnd(new \DateTime('2012-12-24')); -$vEvent->setNoTime(true); -$vEvent->setSummary('Christmas'); - -// Adding Timezone (optional) -$vEvent->setUseTimezone(true); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example2.php b/vendor/eluceo/ical/examples/example2.php deleted file mode 100644 index bafcf03..0000000 --- a/vendor/eluceo/ical/examples/example2.php +++ /dev/null @@ -1,31 +0,0 @@ -setDtStart(new \DateTime('2012-12-24')); -$vEvent->setDtEnd(new \DateTime('2012-12-24')); -$vEvent->setNoTime(true); -$vEvent->setSummary('Summary with some german "umlauten" and a backslash \\: Kinder mögen Äpfel pflücken.'); -$vEvent->setCategories(['holidays']); - -// Adding Timezone (optional) -$vEvent->setUseTimezone(true); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example3.php b/vendor/eluceo/ical/examples/example3.php deleted file mode 100644 index 290ff2d..0000000 --- a/vendor/eluceo/ical/examples/example3.php +++ /dev/null @@ -1,36 +0,0 @@ -setDtStart(new \DateTime('2012-12-31')); -$vEvent->setDtEnd(new \DateTime('2012-12-31')); -$vEvent->setNoTime(true); -$vEvent->setSummary('New Year’s Eve'); - -// Set recurrence rule -$recurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); -$recurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_YEARLY); -$recurrenceRule->setInterval(1); -$vEvent->setRecurrenceRule($recurrenceRule); - -// Adding Timezone (optional) -$vEvent->setUseTimezone(true); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example4.php b/vendor/eluceo/ical/examples/example4.php deleted file mode 100644 index 7b87144..0000000 --- a/vendor/eluceo/ical/examples/example4.php +++ /dev/null @@ -1,35 +0,0 @@ -setDtStart(new \DateTime('2012-11-11 13:00:00')); -$vEvent->setDtEnd(new \DateTime('2012-11-11 14:30:00')); -$vEvent->setSummary('Weekly lunch with Markus'); - -// Set recurrence rule -$recurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); -$recurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_WEEKLY); -$recurrenceRule->setInterval(1); -$vEvent->setRecurrenceRule($recurrenceRule); - -// Adding Timezone (optional) -$vEvent->setUseTimezone(true); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example4b.php b/vendor/eluceo/ical/examples/example4b.php deleted file mode 100644 index 6bd5c31..0000000 --- a/vendor/eluceo/ical/examples/example4b.php +++ /dev/null @@ -1,36 +0,0 @@ -setDtStart(new \DateTime('2012-11-11 13:00:00')); -$vEvent->setDtEnd(new \DateTime('2012-11-11 14:30:00')); -$vEvent->setSummary('Weekly lunch with Markus'); - -// Set recurrence rule -$recurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); -$recurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_WEEKLY); -$recurrenceRule->setInterval(1); -$vEvent->setRecurrenceRule($recurrenceRule); - -// Adding Timezone (optional) -$vEvent->setUseTimezone(true); -$vEvent->setTimezoneString('/example.com/1.0.0-0/Europe/Berlin'); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example5.php b/vendor/eluceo/ical/examples/example5.php deleted file mode 100644 index a7da6e2..0000000 --- a/vendor/eluceo/ical/examples/example5.php +++ /dev/null @@ -1,66 +0,0 @@ -setTzName('CEST'); -$vTimezoneRuleDst->setDtStart(new \DateTime('1981-03-29 02:00:00', $dtz)); -$vTimezoneRuleDst->setTzOffsetFrom('+0100'); -$vTimezoneRuleDst->setTzOffsetTo('+0200'); -$dstRecurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); -$dstRecurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_YEARLY); -$dstRecurrenceRule->setByMonth(3); -$dstRecurrenceRule->setByDay('-1SU'); -$vTimezoneRuleDst->setRecurrenceRule($dstRecurrenceRule); - -// 3. Create timezone rule object for Standard Time -$vTimezoneRuleStd = new \Eluceo\iCal\Component\TimezoneRule(\Eluceo\iCal\Component\TimezoneRule::TYPE_STANDARD); -$vTimezoneRuleStd->setTzName('CET'); -$vTimezoneRuleStd->setDtStart(new \DateTime('1996-10-27 03:00:00', $dtz)); -$vTimezoneRuleStd->setTzOffsetFrom('+0200'); -$vTimezoneRuleStd->setTzOffsetTo('+0100'); -$stdRecurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); -$stdRecurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_YEARLY); -$stdRecurrenceRule->setByMonth(10); -$stdRecurrenceRule->setByDay('-1SU'); -$vTimezoneRuleStd->setRecurrenceRule($stdRecurrenceRule); - -// 4. Create timezone definition and add rules -$vTimezone = new \Eluceo\iCal\Component\Timezone($tz); -$vTimezone->addComponent($vTimezoneRuleDst); -$vTimezone->addComponent($vTimezoneRuleStd); -$vCalendar->setTimezone($vTimezone); - -// 5. Create an event -$vEvent = new \Eluceo\iCal\Component\Event(); -$vEvent->setDtStart(new \DateTime('2012-12-24', $dtz)); -$vEvent->setDtEnd(new \DateTime('2012-12-24', $dtz)); -$vEvent->setSummary('Summary with some german "umlauten" and a backslash \\: Kinder mögen Äpfel pflücken.'); - -// 6. Adding Timezone -$vEvent->setUseTimezone(true); - -// 7. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 8. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 9. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example6.php b/vendor/eluceo/ical/examples/example6.php deleted file mode 100644 index 1040099..0000000 --- a/vendor/eluceo/ical/examples/example6.php +++ /dev/null @@ -1,30 +0,0 @@ -setDtStart(new \DateTime('2012-12-24')); -$vEvent->setDtEnd(new \DateTime('2012-12-24')); -$vEvent->setNoTime(true); -$vEvent->setSummary('Christmas'); - -// add some location information for apple devices -$vEvent->setLocation("Infinite Loop\nCupertino CA 95014", 'Infinite Loop', '37.332095,-122.030743'); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/examples/example7.php b/vendor/eluceo/ical/examples/example7.php deleted file mode 100644 index 1f8013e..0000000 --- a/vendor/eluceo/ical/examples/example7.php +++ /dev/null @@ -1,33 +0,0 @@ -setDtStart(new \DateTime('2012-12-24')); -$vEvent->setDtEnd(new \DateTime('2012-12-24')); -$vEvent->setNoTime(true); -$vEvent->setSummary('Christmas'); -$vEvent->setDescription('Happy Christmas!'); -$vEvent->setDescriptionHTML('Happy Christmas!'); - - -// add some location information for apple devices -$vEvent->setLocation("Infinite Loop\nCupertino CA 95014", 'Infinite Loop', '37.332095,-122.030743'); - -// 3. Add event to calendar -$vCalendar->addComponent($vEvent); - -// 4. Set headers -header('Content-Type: text/calendar; charset=utf-8'); -header('Content-Disposition: attachment; filename="cal.ics"'); - -// 5. Output -echo $vCalendar->render(); diff --git a/vendor/eluceo/ical/phpunit.xml.dist b/vendor/eluceo/ical/phpunit.xml.dist deleted file mode 100644 index 1f9e389..0000000 --- a/vendor/eluceo/ical/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - ./tests/Eluceo/iCal/ - - - diff --git a/vendor/eluceo/ical/src/Component.php b/vendor/eluceo/ical/src/Component.php deleted file mode 100644 index a5c395c..0000000 --- a/vendor/eluceo/ical/src/Component.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal; - -use Eluceo\iCal\Util\ComponentUtil; - -/** - * Abstract Calender Component. - */ -abstract class Component -{ - /** - * Array of Components. - * - * @var Component[] - */ - protected $components = []; - - /** - * The order in which the components will be rendered during build. - * - * Not defined components will be appended at the end. - * - * @var array - */ - private $componentsBuildOrder = ['VTIMEZONE', 'DAYLIGHT', 'STANDARD']; - - /** - * The type of the concrete Component. - * - * @abstract - * - * @return string - */ - abstract public function getType(); - - /** - * Building the PropertyBag. - * - * @abstract - * - * @return PropertyBag - */ - abstract public function buildPropertyBag(); - - /** - * Adds a Component. - * - * If $key is given, the component at $key will be replaced else the component will be append. - * - * @param Component $component The Component that will be added - * @param null $key The key of the Component - */ - public function addComponent(Component $component, $key = null) - { - if (null == $key) { - $this->components[] = $component; - } else { - $this->components[$key] = $component; - } - } - - /** - * Renders an array containing the lines of the iCal file. - * - * @return array - */ - public function build() - { - $lines = []; - - $lines[] = sprintf('BEGIN:%s', $this->getType()); - - /** @var $property Property */ - foreach ($this->buildPropertyBag() as $property) { - foreach ($property->toLines() as $l) { - $lines[] = $l; - } - } - - $this->buildComponents($lines); - - $lines[] = sprintf('END:%s', $this->getType()); - - $ret = []; - - foreach ($lines as $line) { - foreach (ComponentUtil::fold($line) as $l) { - $ret[] = $l; - } - } - - return $ret; - } - - /** - * Renders the output. - * - * @return string - */ - public function render() - { - return implode("\r\n", $this->build()); - } - - /** - * Renders the output when treating the class as a string. - * - * @return string - */ - public function __toString() - { - return $this->render(); - } - - /** - * @param $lines - * - * @return array - */ - private function buildComponents(array &$lines) - { - $componentsByType = []; - - /** @var $component Component */ - foreach ($this->components as $component) { - $type = $component->getType(); - if (!isset($componentsByType[$type])) { - $componentsByType[$type] = []; - } - $componentsByType[$type][] = $component; - } - - // render ordered components - foreach ($this->componentsBuildOrder as $type) { - if (!isset($componentsByType[$type])) { - continue; - } - foreach ($componentsByType[$type] as $component) { - $this->addComponentLines($lines, $component); - } - unset($componentsByType[$type]); - } - - // render all other - foreach ($componentsByType as $components) { - foreach ($components as $component) { - $this->addComponentLines($lines, $component); - } - } - } - - /** - * @param array $lines - * @param Component $component - */ - private function addComponentLines(array &$lines, Component $component) - { - foreach ($component->build() as $l) { - $lines[] = $l; - } - } -} diff --git a/vendor/eluceo/ical/src/Component/Alarm.php b/vendor/eluceo/ical/src/Component/Alarm.php deleted file mode 100644 index e0041b5..0000000 --- a/vendor/eluceo/ical/src/Component/Alarm.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Component; - -use Eluceo\iCal\Component; -use Eluceo\iCal\Property; -use Eluceo\iCal\PropertyBag; - -/** - * Implementation of the VALARM component. - */ -class Alarm extends Component -{ - /** - * Alarm ACTION property. - * - * According to RFC 5545: 3.8.6.1. Action - * - * @see http://tools.ietf.org/html/rfc5545#section-3.8.6.1 - */ - const ACTION_AUDIO = 'AUDIO'; - const ACTION_DISPLAY = 'DISPLAY'; - const ACTION_EMAIL = 'EMAIL'; - - protected $action; - protected $repeat; - protected $duration; - protected $description; - protected $attendee; - protected $trigger; - - public function getType() - { - return 'VALARM'; - } - - public function getAction() - { - return $this->action; - } - - public function getRepeat() - { - return $this->repeat; - } - - public function getDuration() - { - return $this->duration; - } - - public function getDescription() - { - return $this->description; - } - - public function getAttendee() - { - return $this->attendee; - } - - public function getTrigger() - { - return $this->trigger; - } - - public function setAction($action) - { - $this->action = $action; - - return $this; - } - - public function setRepeat($repeat) - { - $this->repeat = $repeat; - - return $this; - } - - public function setDuration($duration) - { - $this->duration = $duration; - - return $this; - } - - public function setDescription($description) - { - $this->description = $description; - - return $this; - } - - public function setAttendee($attendee) - { - $this->attendee = $attendee; - - return $this; - } - - public function setTrigger($trigger) - { - $this->trigger = $trigger; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function buildPropertyBag() - { - $propertyBag = new PropertyBag(); - - if (null != $this->trigger) { - $propertyBag->set('TRIGGER', $this->trigger); - } - - if (null != $this->action) { - $propertyBag->set('ACTION', $this->action); - } - - if (null != $this->repeat) { - $propertyBag->set('REPEAT', $this->repeat); - } - - if (null != $this->duration) { - $propertyBag->set('DURATION', $this->duration); - } - - if (null != $this->description) { - $propertyBag->set('DESCRIPTION', $this->description); - } - - if (null != $this->attendee) { - $propertyBag->set('ATTENDEE', $this->attendee); - } - - return $propertyBag; - } -} diff --git a/vendor/eluceo/ical/src/Component/Calendar.php b/vendor/eluceo/ical/src/Component/Calendar.php deleted file mode 100644 index 4ee561f..0000000 --- a/vendor/eluceo/ical/src/Component/Calendar.php +++ /dev/null @@ -1,326 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Component; - -use Eluceo\iCal\Component; -use Eluceo\iCal\PropertyBag; - -class Calendar extends Component -{ - /** - * Methods for calendar components. - * - * According to RFC 5545: 3.7.2. Method - * - * @see http://tools.ietf.org/html/rfc5545#section-3.7.2 - * - * And then according to RFC 2446: 3 APPLICATION PROTOCOL ELEMENTS - * @see https://tools.ietf.org/html/rfc2446#section-3.2 - */ - const METHOD_PUBLISH = 'PUBLISH'; - const METHOD_REQUEST = 'REQUEST'; - const METHOD_REPLY = 'REPLY'; - const METHOD_ADD = 'ADD'; - const METHOD_CANCEL = 'CANCEL'; - const METHOD_REFRESH = 'REFRESH'; - const METHOD_COUNTER = 'COUNTER'; - const METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; - - /** - * This property defines the calendar scale used for the calendar information specified in the iCalendar object. - * - * According to RFC 5545: 3.7.1. Calendar Scale - * - * @see http://tools.ietf.org/html/rfc5545#section-3.7 - */ - const CALSCALE_GREGORIAN = 'GREGORIAN'; - - /** - * The Product Identifier. - * - * According to RFC 5545: 3.7.3 Product Identifier - * - * This property specifies the identifier for the product that created the Calendar object. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.7.3 - * - * @var string - */ - protected $prodId = null; - protected $method = null; - protected $name = null; - protected $description = null; - protected $timezone = null; - - /** - * This property defines the calendar scale used for the - * calendar information specified in the iCalendar object. - * - * Also identifies the calendar type of a non-Gregorian recurring appointment. - * - * @var string - * - * @see http://tools.ietf.org/html/rfc5545#section-3.7 - * @see http://msdn.microsoft.com/en-us/library/ee237520(v=exchg.80).aspx - */ - protected $calendarScale = null; - - /** - * Specifies whether or not the iCalendar file only contains one appointment. - * - * @var bool - * - * @see http://msdn.microsoft.com/en-us/library/ee203486(v=exchg.80).aspx - */ - protected $forceInspectOrOpen = false; - - /** - * Specifies a globally unique identifier for the calendar. - * - * @var string - * - * @see http://msdn.microsoft.com/en-us/library/ee179588(v=exchg.80).aspx - */ - protected $calId = null; - - /** - * Specifies a suggested iCalendar file download frequency for clients and - * servers with sync capabilities. - * - * For example you can set the value to 'P1W' if the calendar should be - * synced once a week. Use 'P3H' to sync the file every 3 hours. - * - * @var string - * - * @see http://msdn.microsoft.com/en-us/library/ee178699(v=exchg.80).aspx - */ - protected $publishedTTL = null; - - /** - * Specifies a color for the calendar in calendar for Apple/Outlook. - * - * @var string - * - * @see http://msdn.microsoft.com/en-us/library/ee179588(v=exchg.80).aspx - */ - protected $calendarColor = null; - - public function __construct($prodId) - { - if (empty($prodId)) { - throw new \UnexpectedValueException('PRODID cannot be empty'); - } - - $this->prodId = $prodId; - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return 'VCALENDAR'; - } - - /** - * @param $method - * - * @return $this - */ - public function setMethod($method) - { - $this->method = $method; - - return $this; - } - - /** - * @param $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * @param $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - - return $this; - } - - /** - * @param $timezone - * - * @return $this - */ - public function setTimezone($timezone) - { - $this->timezone = $timezone; - - return $this; - } - - /** - * @param $calendarColor - * - * @return $this - */ - public function setCalendarColor($calendarColor) - { - $this->calendarColor = $calendarColor; - - return $this; - } - - /** - * @param $calendarScale - * - * @return $this - */ - public function setCalendarScale($calendarScale) - { - $this->calendarScale = $calendarScale; - - return $this; - } - - /** - * @param bool $forceInspectOrOpen - * - * @return $this - */ - public function setForceInspectOrOpen($forceInspectOrOpen) - { - $this->forceInspectOrOpen = $forceInspectOrOpen; - - return $this; - } - - /** - * @param string $calId - * - * @return $this - */ - public function setCalId($calId) - { - $this->calId = $calId; - - return $this; - } - - /** - * @param string $ttl - * - * @return $this - */ - public function setPublishedTTL($ttl) - { - $this->publishedTTL = $ttl; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function buildPropertyBag() - { - $propertyBag = new PropertyBag(); - $propertyBag->set('VERSION', '2.0'); - $propertyBag->set('PRODID', $this->prodId); - - if ($this->method) { - $propertyBag->set('METHOD', $this->method); - } - - if ($this->calendarColor) { - $propertyBag->set('X-APPLE-CALENDAR-COLOR', $this->calendarColor); - $propertyBag->set('X-OUTLOOK-COLOR', $this->calendarColor); - $propertyBag->set('X-FUNAMBOL-COLOR', $this->calendarColor); - } - - if ($this->calendarScale) { - $propertyBag->set('CALSCALE', $this->calendarScale); - $propertyBag->set('X-MICROSOFT-CALSCALE', $this->calendarScale); - } - - if ($this->name) { - $propertyBag->set('X-WR-CALNAME', $this->name); - } - - if ($this->description) { - $propertyBag->set('X-WR-CALDESC', $this->description); - } - - if ($this->timezone) { - if ($this->timezone instanceof Timezone) { - $propertyBag->set('X-WR-TIMEZONE', $this->timezone->getZoneIdentifier()); - $this->addComponent($this->timezone); - } else { - $propertyBag->set('X-WR-TIMEZONE', $this->timezone); - $this->addComponent(new Timezone($this->timezone)); - } - } - - if ($this->forceInspectOrOpen) { - $propertyBag->set('X-MS-OLK-FORCEINSPECTOROPEN', $this->forceInspectOrOpen); - } - - if ($this->calId) { - $propertyBag->set('X-WR-RELCALID', $this->calId); - } - - if ($this->publishedTTL) { - $propertyBag->set('X-PUBLISHED-TTL', $this->publishedTTL); - } - - return $propertyBag; - } - - /** - * Adds an Event to the Calendar. - * - * Wrapper for addComponent() - * - * @see Eluceo\iCal::addComponent - * @deprecated Please, use public method addComponent() from abstract Component class - * - * @param Event $event - */ - public function addEvent(Event $event) - { - $this->addComponent($event); - } - - /** - * @return null|string - */ - public function getProdId() - { - return $this->prodId; - } - - public function getMethod() - { - return $this->method; - } -} diff --git a/vendor/eluceo/ical/src/Component/Event.php b/vendor/eluceo/ical/src/Component/Event.php deleted file mode 100644 index 6b60337..0000000 --- a/vendor/eluceo/ical/src/Component/Event.php +++ /dev/null @@ -1,880 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Component; - -use Eluceo\iCal\Component; -use Eluceo\iCal\Property; -use Eluceo\iCal\Property\DateTimeProperty; -use Eluceo\iCal\Property\DateTimesProperty; -use Eluceo\iCal\Property\Event\Attendees; -use Eluceo\iCal\Property\Event\Geo; -use Eluceo\iCal\Property\Event\Organizer; -use Eluceo\iCal\Property\Event\RecurrenceId; -use Eluceo\iCal\Property\Event\RecurrenceRule; -use Eluceo\iCal\Property\RawStringValue; -use Eluceo\iCal\PropertyBag; - -/** - * Implementation of the EVENT component. - */ -class Event extends Component -{ - const TIME_TRANSPARENCY_OPAQUE = 'OPAQUE'; - const TIME_TRANSPARENCY_TRANSPARENT = 'TRANSPARENT'; - - const STATUS_TENTATIVE = 'TENTATIVE'; - const STATUS_CONFIRMED = 'CONFIRMED'; - const STATUS_CANCELLED = 'CANCELLED'; - - /** - * @var string - */ - protected $uniqueId; - - /** - * The property indicates the date/time that the instance of - * the iCalendar object was created. - * - * The value MUST be specified in the UTC time format. - * - * @var \DateTime - */ - protected $dtStamp; - - /** - * @var \DateTime - */ - protected $dtStart; - - /** - * Preferentially chosen over the duration if both are set. - * - * @var \DateTime - */ - protected $dtEnd; - - /** - * @var \DateInterval - */ - protected $duration; - - /** - * @var bool - */ - protected $noTime = false; - - /** - * @var string - */ - protected $url; - - /** - * @var string - */ - protected $location; - - /** - * @var string - */ - protected $locationTitle; - - /** - * @var Geo - */ - protected $locationGeo; - - /** - * @var string - */ - protected $summary; - - /** - * @var Organizer - */ - protected $organizer; - - /** - * @see https://tools.ietf.org/html/rfc5545#section-3.8.2.7 - * - * @var string - */ - protected $transparency = self::TIME_TRANSPARENCY_OPAQUE; - - /** - * If set to true the timezone will be added to the event. - * - * @var bool - */ - protected $useTimezone = false; - - /** - * If set will we used as the timezone identifier. - * - * @var string - */ - protected $timezoneString = ''; - - /** - * @var int - */ - protected $sequence = 0; - - /** - * @var Attendees - */ - protected $attendees; - - /** - * @var string - */ - protected $description; - - /** - * @var string - */ - protected $descriptionHTML; - - /** - * @var string - */ - protected $status; - - /** - * @var RecurrenceRule - */ - protected $recurrenceRule; - - /** - * @var array - */ - protected $recurrenceRules = []; - - /** - * This property specifies the date and time that the calendar - * information was created. - * - * The value MUST be specified in the UTC time format. - * - * @var \DateTime - */ - protected $created; - - /** - * The property specifies the date and time that the information - * associated with the calendar component was last revised. - * - * The value MUST be specified in the UTC time format. - * - * @var \DateTime - */ - protected $modified; - - /** - * Indicates if the UTC time should be used or not. - * - * @var bool - */ - protected $useUtc = true; - - /** - * @var bool - */ - protected $cancelled; - - /** - * This property is used to specify categories or subtypes - * of the calendar component. The categories are useful in searching - * for a calendar component of a particular type and category. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.8.1.2 - * - * @var array - */ - protected $categories; - - /** - * https://tools.ietf.org/html/rfc5545#section-3.8.1.3. - * - * @var bool - */ - protected $isPrivate = false; - - /** - * Dates to be excluded from a series of events. - * - * @var \DateTimeInterface[] - */ - protected $exDates = []; - - /** - * @var RecurrenceId - */ - protected $recurrenceId; - - public function __construct(string $uniqueId = null) - { - if (null == $uniqueId) { - $uniqueId = uniqid(); - } - - $this->uniqueId = $uniqueId; - $this->attendees = new Attendees(); - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return 'VEVENT'; - } - - /** - * {@inheritdoc} - */ - public function buildPropertyBag() - { - $propertyBag = new PropertyBag(); - - // mandatory information - $propertyBag->set('UID', $this->uniqueId); - - $propertyBag->add(new DateTimeProperty('DTSTART', $this->dtStart, $this->noTime, $this->useTimezone, $this->useUtc, $this->timezoneString)); - $propertyBag->set('SEQUENCE', $this->sequence); - $propertyBag->set('TRANSP', $this->transparency); - - if ($this->status) { - $propertyBag->set('STATUS', $this->status); - } - - // An event can have a 'dtend' or 'duration', but not both. - if ($this->dtEnd !== null) { - $dtEnd = clone $this->dtEnd; - if ($this->noTime === true) { - $dtEnd = $dtEnd->add(new \DateInterval('P1D')); - } - $propertyBag->add(new DateTimeProperty('DTEND', $dtEnd, $this->noTime, $this->useTimezone, $this->useUtc, $this->timezoneString)); - } elseif ($this->duration !== null) { - $propertyBag->set('DURATION', $this->duration->format('P%dDT%hH%iM%sS')); - } - - // optional information - if (null != $this->url) { - $propertyBag->set('URL', $this->url); - } - - if (null != $this->location) { - $propertyBag->set('LOCATION', $this->location); - - if (null != $this->locationGeo) { - $propertyBag->add( - new Property( - 'X-APPLE-STRUCTURED-LOCATION', - new RawStringValue('geo:' . $this->locationGeo->getGeoLocationAsString(',')), - [ - 'VALUE' => 'URI', - 'X-ADDRESS' => $this->location, - 'X-APPLE-RADIUS' => 49, - 'X-TITLE' => $this->locationTitle, - ] - ) - ); - } - } - - if (null != $this->locationGeo) { - $propertyBag->add($this->locationGeo); - } - - if (null != $this->summary) { - $propertyBag->set('SUMMARY', $this->summary); - } - - if (null != $this->attendees) { - $propertyBag->add($this->attendees); - } - - $propertyBag->set('CLASS', $this->isPrivate ? 'PRIVATE' : 'PUBLIC'); - - if (null != $this->description) { - $propertyBag->set('DESCRIPTION', $this->description); - } - - if (null != $this->descriptionHTML) { - $propertyBag->add( - new Property( - 'X-ALT-DESC', - $this->descriptionHTML, - [ - 'FMTTYPE' => 'text/html', - ] - ) - ); - } - - if (null != $this->recurrenceRule) { - $propertyBag->set('RRULE', $this->recurrenceRule); - } - - foreach ($this->recurrenceRules as $recurrenceRule) { - $propertyBag->set('RRULE', $recurrenceRule); - } - - if (null != $this->recurrenceId) { - $this->recurrenceId->applyTimeSettings($this->noTime, $this->useTimezone, $this->useUtc, $this->timezoneString); - $propertyBag->add($this->recurrenceId); - } - - if (!empty($this->exDates)) { - $propertyBag->add(new DateTimesProperty('EXDATE', $this->exDates, $this->noTime, $this->useTimezone, $this->useUtc, $this->timezoneString)); - } - - if ($this->cancelled) { - $propertyBag->set('STATUS', 'CANCELLED'); - } - - if (null != $this->organizer) { - $propertyBag->add($this->organizer); - } - - if ($this->noTime) { - $propertyBag->set('X-MICROSOFT-CDO-ALLDAYEVENT', 'TRUE'); - } - - if (null != $this->categories) { - $propertyBag->set('CATEGORIES', $this->categories); - } - - $propertyBag->add( - new DateTimeProperty('DTSTAMP', $this->dtStamp ?: new \DateTimeImmutable(), false, false, true) - ); - - if ($this->created) { - $propertyBag->add(new DateTimeProperty('CREATED', $this->created, false, false, true)); - } - - if ($this->modified) { - $propertyBag->add(new DateTimeProperty('LAST-MODIFIED', $this->modified, false, false, true)); - } - - return $propertyBag; - } - - /** - * @param $dtEnd - * - * @return $this - */ - public function setDtEnd($dtEnd) - { - $this->dtEnd = $dtEnd; - - return $this; - } - - public function getDtEnd() - { - return $this->dtEnd; - } - - public function setDtStart($dtStart) - { - $this->dtStart = $dtStart; - - return $this; - } - - public function getDtStart() - { - return $this->dtStart; - } - - /** - * @param $dtStamp - * - * @return $this - */ - public function setDtStamp($dtStamp) - { - $this->dtStamp = $dtStamp; - - return $this; - } - - /** - * @param $duration - * - * @return $this - */ - public function setDuration($duration) - { - $this->duration = $duration; - - return $this; - } - - /** - * @param string $location - * @param string $title - * @param Geo|string $geo - * - * @return $this - */ - public function setLocation($location, $title = '', $geo = null) - { - if (is_scalar($geo)) { - $geo = Geo::fromString($geo); - } elseif (!is_null($geo) && !$geo instanceof Geo) { - $className = get_class($geo); - throw new \InvalidArgumentException( - "The parameter 'geo' must be a string or an instance of " . Geo::class - . " but an instance of {$className} was given." - ); - } - - $this->location = $location; - $this->locationTitle = $title; - $this->locationGeo = $geo; - - return $this; - } - - /** - * @param Geo $geoProperty - * - * @return $this - */ - public function setGeoLocation(Geo $geoProperty) - { - $this->locationGeo = $geoProperty; - - return $this; - } - - /** - * @param $noTime - * - * @return $this - */ - public function setNoTime($noTime) - { - $this->noTime = $noTime; - - return $this; - } - - /** - * @param int $sequence - * - * @return $this - */ - public function setSequence($sequence) - { - $this->sequence = $sequence; - - return $this; - } - - /** - * @return int - */ - public function getSequence() - { - return $this->sequence; - } - - /** - * @param Organizer $organizer - * - * @return $this - */ - public function setOrganizer(Organizer $organizer) - { - $this->organizer = $organizer; - - return $this; - } - - /** - * @param $summary - * - * @return $this - */ - public function setSummary($summary) - { - $this->summary = $summary; - - return $this; - } - - /** - * @param $uniqueId - * - * @return $this - */ - public function setUniqueId($uniqueId) - { - $this->uniqueId = $uniqueId; - - return $this; - } - - /** - * @return string - */ - public function getUniqueId() - { - return $this->uniqueId; - } - - /** - * @param $url - * - * @return $this - */ - public function setUrl($url) - { - $this->url = $url; - - return $this; - } - - /** - * @param $useTimezone - * - * @return $this - */ - public function setUseTimezone($useTimezone) - { - $this->useTimezone = $useTimezone; - - return $this; - } - - /** - * @return bool - */ - public function getUseTimezone() - { - return $this->useTimezone; - } - - /** - * @param $timezoneString - * - * @return $this - */ - public function setTimezoneString($timezoneString) - { - $this->timezoneString = $timezoneString; - - return $this; - } - - /** - * @return bool - */ - public function getTimezoneString() - { - return $this->timezoneString; - } - - /** - * @param Attendees $attendees - * - * @return $this - */ - public function setAttendees(Attendees $attendees) - { - $this->attendees = $attendees; - - return $this; - } - - /** - * @param string $attendee - * @param array $params - * - * @return $this - */ - public function addAttendee($attendee, $params = []) - { - $this->attendees->add($attendee, $params); - - return $this; - } - - /** - * @return Attendees - */ - public function getAttendees(): Attendees - { - return $this->attendees; - } - - /** - * @param $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - - return $this; - } - - /** - * @param $descriptionHTML - * - * @return $this - */ - public function setDescriptionHTML($descriptionHTML) - { - $this->descriptionHTML = $descriptionHTML; - - return $this; - } - - /** - * @param bool $useUtc - * - * @return $this - */ - public function setUseUtc($useUtc = true) - { - $this->useUtc = $useUtc; - - return $this; - } - - /** - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * @return string - */ - public function getDescriptionHTML() - { - return $this->descriptionHTML; - } - - /** - * @param $status - * - * @return $this - */ - public function setCancelled($status) - { - $this->cancelled = (bool) $status; - - return $this; - } - - /** - * @param $transparency - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setTimeTransparency($transparency) - { - $transparency = strtoupper($transparency); - if ($transparency === self::TIME_TRANSPARENCY_OPAQUE - || $transparency === self::TIME_TRANSPARENCY_TRANSPARENT - ) { - $this->transparency = $transparency; - } else { - throw new \InvalidArgumentException('Invalid value for transparancy'); - } - - return $this; - } - - /** - * @param $status - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setStatus($status) - { - $status = strtoupper($status); - if ($status == self::STATUS_CANCELLED - || $status == self::STATUS_CONFIRMED - || $status == self::STATUS_TENTATIVE - ) { - $this->status = $status; - } else { - throw new \InvalidArgumentException('Invalid value for status'); - } - - return $this; - } - - /** - * @deprecated Deprecated since version 0.11.0, to be removed in 1.0. Use addRecurrenceRule instead. - * - * @param RecurrenceRule $recurrenceRule - * - * @return $this - */ - public function setRecurrenceRule(RecurrenceRule $recurrenceRule) - { - @trigger_error('setRecurrenceRule() is deprecated since version 0.11.0 and will be removed in 1.0. Use addRecurrenceRule instead.', E_USER_DEPRECATED); - - $this->recurrenceRule = $recurrenceRule; - - return $this; - } - - /** - * @deprecated Deprecated since version 0.11.0, to be removed in 1.0. Use getRecurrenceRules instead. - * - * @return RecurrenceRule - */ - public function getRecurrenceRule() - { - @trigger_error('getRecurrenceRule() is deprecated since version 0.11.0 and will be removed in 1.0. Use getRecurrenceRules instead.', E_USER_DEPRECATED); - - return $this->recurrenceRule; - } - - /** - * @param RecurrenceRule $recurrenceRule - * - * @return $this - */ - public function addRecurrenceRule(RecurrenceRule $recurrenceRule) - { - $this->recurrenceRules[] = $recurrenceRule; - - return $this; - } - - /** - * @return array - */ - public function getRecurrenceRules() - { - return $this->recurrenceRules; - } - - /** - * @param $dtStamp - * - * @return $this - */ - public function setCreated($dtStamp) - { - $this->created = $dtStamp; - - return $this; - } - - /** - * @param $dtStamp - * - * @return $this - */ - public function setModified($dtStamp) - { - $this->modified = $dtStamp; - - return $this; - } - - /** - * @param $categories - * - * @return $this - */ - public function setCategories($categories) - { - $this->categories = $categories; - - return $this; - } - - /** - * Sets the event privacy. - * - * @param bool $flag - * - * @return $this - */ - public function setIsPrivate($flag) - { - $this->isPrivate = (bool) $flag; - - return $this; - } - - /** - * @param \DateTimeInterface $dateTime - * - * @return \Eluceo\iCal\Component\Event - */ - public function addExDate(\DateTimeInterface $dateTime) - { - $this->exDates[] = $dateTime; - - return $this; - } - - /** - * @return \DateTimeInterface[] - */ - public function getExDates() - { - return $this->exDates; - } - - /** - * @param \DateTimeInterface[] - * - * @return \Eluceo\iCal\Component\Event - */ - public function setExDates(array $exDates) - { - $this->exDates = $exDates; - - return $this; - } - - /** - * @return \Eluceo\iCal\Property\Event\RecurrenceId - */ - public function getRecurrenceId() - { - return $this->recurrenceId; - } - - /** - * @param RecurrenceId $recurrenceId - * - * @return \Eluceo\iCal\Component\Event - */ - public function setRecurrenceId(RecurrenceId $recurrenceId) - { - $this->recurrenceId = $recurrenceId; - - return $this; - } -} diff --git a/vendor/eluceo/ical/src/Component/Timezone.php b/vendor/eluceo/ical/src/Component/Timezone.php deleted file mode 100644 index c820d75..0000000 --- a/vendor/eluceo/ical/src/Component/Timezone.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Component; - -use Eluceo\iCal\Component; -use Eluceo\iCal\PropertyBag; - -/** - * Implementation of the TIMEZONE component. - */ -class Timezone extends Component -{ - /** - * @var string - */ - protected $timezone; - - public function __construct($timezone) - { - $this->timezone = $timezone; - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return 'VTIMEZONE'; - } - - /** - * {@inheritdoc} - */ - public function buildPropertyBag() - { - $propertyBag = new PropertyBag(); - - $propertyBag->set('TZID', $this->timezone); - $propertyBag->set('X-LIC-LOCATION', $this->timezone); - - return $propertyBag; - } - - public function getZoneIdentifier() - { - return $this->timezone; - } -} diff --git a/vendor/eluceo/ical/src/Component/TimezoneRule.php b/vendor/eluceo/ical/src/Component/TimezoneRule.php deleted file mode 100644 index bf83e55..0000000 --- a/vendor/eluceo/ical/src/Component/TimezoneRule.php +++ /dev/null @@ -1,215 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Component; - -use Eluceo\iCal\Component; -use Eluceo\iCal\Property\Event\RecurrenceRule; -use Eluceo\iCal\PropertyBag; - -/** - * Implementation of Standard Time and Daylight Saving Time observances (or rules) - * which define the TIMEZONE component. - */ -class TimezoneRule extends Component -{ - const TYPE_DAYLIGHT = 'DAYLIGHT'; - const TYPE_STANDARD = 'STANDARD'; - - /** - * @var string - */ - protected $type; - - /** - * @var string - */ - protected $tzOffsetFrom; - - /** - * @var string - */ - protected $tzOffsetTo; - - /** - * @var string - */ - protected $tzName; - - /** - * @var \DateTimeInterface - */ - protected $dtStart; - - /** - * @var RecurrenceRule - */ - protected $recurrenceRule; - - /** - * create new Timezone Rule object by giving a rule type identifier. - * - * @param string $ruleType one of DAYLIGHT or STANDARD - * - * @throws \InvalidArgumentException - */ - public function __construct($ruleType) - { - $ruleType = strtoupper($ruleType); - if ($ruleType === self::TYPE_DAYLIGHT || $ruleType === self::TYPE_STANDARD) { - $this->type = $ruleType; - } else { - throw new \InvalidArgumentException('Invalid value for timezone rule type'); - } - } - - /** - * {@inheritdoc} - */ - public function buildPropertyBag() - { - $propertyBag = new PropertyBag(); - - if ($this->getTzName()) { - $propertyBag->set('TZNAME', $this->getTzName()); - } - - if ($this->getTzOffsetFrom()) { - $propertyBag->set('TZOFFSETFROM', $this->getTzOffsetFrom()); - } - - if ($this->getTzOffsetTo()) { - $propertyBag->set('TZOFFSETTO', $this->getTzOffsetTo()); - } - - if ($this->getDtStart()) { - $propertyBag->set('DTSTART', $this->getDtStart()); - } - - if ($this->recurrenceRule) { - $propertyBag->set('RRULE', $this->recurrenceRule); - } - - return $propertyBag; - } - - /** - * @param $offset - * - * @return $this - */ - public function setTzOffsetFrom($offset) - { - $this->tzOffsetFrom = $offset; - - return $this; - } - - /** - * @param $offset - * - * @return $this - */ - public function setTzOffsetTo($offset) - { - $this->tzOffsetTo = $offset; - - return $this; - } - - /** - * @param $name - * - * @return $this - */ - public function setTzName($name) - { - $this->tzName = $name; - - return $this; - } - - /** - * @param \DateTimeInterface $dtStart - * - * @return $this - */ - public function setDtStart(\DateTimeInterface $dtStart) - { - $this->dtStart = $dtStart; - - return $this; - } - - /** - * @param RecurrenceRule $recurrenceRule - * - * @return $this - */ - public function setRecurrenceRule(RecurrenceRule $recurrenceRule) - { - $this->recurrenceRule = $recurrenceRule; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getType() - { - return $this->type; - } - - /** - * @return string - */ - public function getTzOffsetFrom() - { - return $this->tzOffsetFrom; - } - - /** - * @return string - */ - public function getTzOffsetTo() - { - return $this->tzOffsetTo; - } - - /** - * @return string - */ - public function getTzName() - { - return $this->tzName; - } - - /** - * @return RecurrenceRule - */ - public function getRecurrenceRule() - { - return $this->recurrenceRule; - } - - /** - * @return mixed return string representation of start date or NULL if no date was given - */ - public function getDtStart() - { - if ($this->dtStart) { - return $this->dtStart->format('Ymd\THis'); - } - - return; - } -} diff --git a/vendor/eluceo/ical/src/ParameterBag.php b/vendor/eluceo/ical/src/ParameterBag.php deleted file mode 100644 index 9f55b7f..0000000 --- a/vendor/eluceo/ical/src/ParameterBag.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal; - -class ParameterBag -{ - /** - * The params. - * - * @var array - */ - protected $params; - - public function __construct($params = []) - { - $this->params = $params; - } - - /** - * @param string $name - * @param mixed $value - */ - public function setParam($name, $value) - { - $this->params[$name] = $value; - } - - /** - * @param $name - * - * @return array|mixed - */ - public function getParam($name) - { - if (isset($this->params[$name])) { - return $this->params[$name]; - } - - return null; - } - - /** - * Checks if there are any params. - * - * @return bool - */ - public function hasParams(): bool - { - return count($this->params) > 0; - } - - /** - * @return string - */ - public function toString(): string - { - $line = ''; - foreach ($this->params as $param => $paramValues) { - if (!is_array($paramValues)) { - $paramValues = [$paramValues]; - } - foreach ($paramValues as $k => $v) { - $paramValues[$k] = $this->escapeParamValue($v); - } - - if ('' != $line) { - $line .= ';'; - } - - $line .= $param . '=' . implode(',', $paramValues); - } - - return $line; - } - - /** - * Returns an escaped string for a param value. - * - * @param string $value - * - * @return string - */ - private function escapeParamValue($value) - { - $count = 0; - $value = str_replace('\\', '\\\\', $value); - $value = str_replace('"', '\"', $value, $count); - $value = str_replace("\n", '\\n', $value); - if (false !== strpos($value, ';') || false !== strpos($value, ',') || false !== strpos($value, ':') || $count) { - $value = '"' . $value . '"'; - } - - return $value; - } - - /** - * @return string - */ - public function __toString() - { - return $this->toString(); - } -} diff --git a/vendor/eluceo/ical/src/Property.php b/vendor/eluceo/ical/src/Property.php deleted file mode 100644 index 5ab4259..0000000 --- a/vendor/eluceo/ical/src/Property.php +++ /dev/null @@ -1,150 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal; - -use Eluceo\iCal\Property\ArrayValue; -use Eluceo\iCal\Property\StringValue; -use Eluceo\iCal\Property\ValueInterface; - -/** - * The Property Class represents a property as defined in RFC 5545. - * - * The content of a line (unfolded) will be rendered in this class. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.5 - */ -class Property -{ - /** - * The value of the Property. - * - * @var ValueInterface - */ - protected $value; - - /** - * The params of the Property. - * - * @var ParameterBag - */ - protected $parameterBag; - - /** - * @var string - */ - protected $name; - - /** - * @param $name - * @param $value - * @param array $params - */ - public function __construct($name, $value, $params = []) - { - $this->name = $name; - $this->setValue($value); - $this->parameterBag = new ParameterBag($params); - } - - /** - * Renders an unfolded line. - * - * @return string - */ - public function toLine() - { - // Property-name - $line = $this->getName(); - - // Adding params - //@todo added check for $this->parameterBag because doctrine/orm proxies won't execute constructor - ok? - if ($this->parameterBag && $this->parameterBag->hasParams()) { - $line .= ';' . $this->parameterBag->toString(); - } - - // Property value - $line .= ':' . $this->value->getEscapedValue(); - - return $line; - } - - /** - * Get all unfolded lines. - * - * @return array - */ - public function toLines() - { - return [$this->toLine()]; - } - - /** - * @param string $name - * @param mixed $value - * - * @return $this - */ - public function setParam($name, $value) - { - $this->parameterBag->setParam($name, $value); - - return $this; - } - - /** - * @param $name - */ - public function getParam($name) - { - return $this->parameterBag->getParam($name); - } - - /** - * @param mixed $value - * - * @return $this - * - * @throws \Exception - */ - public function setValue($value) - { - if (is_scalar($value)) { - $this->value = new StringValue($value); - } elseif (is_array($value)) { - $this->value = new ArrayValue($value); - } else { - if (!$value instanceof ValueInterface) { - throw new \Exception('The value must implement the ValueInterface.'); - } else { - $this->value = $value; - } - } - - return $this; - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * @return string - */ - public function getName(): string - { - return $this->name; - } -} diff --git a/vendor/eluceo/ical/src/Property/ArrayValue.php b/vendor/eluceo/ical/src/Property/ArrayValue.php deleted file mode 100644 index cb3f5a8..0000000 --- a/vendor/eluceo/ical/src/Property/ArrayValue.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -class ArrayValue implements ValueInterface -{ - /** - * The value. - * - * @var array - */ - protected $values; - - public function __construct(array $values) - { - $this->values = $values; - } - - public function setValues(array $values) - { - $this->values = $values; - - return $this; - } - - public function getEscapedValue(): string - { - return implode(',', array_map(function (string $value): string { - return (new StringValue($value))->getEscapedValue(); - }, $this->values)); - } -} diff --git a/vendor/eluceo/ical/src/Property/DateTimeProperty.php b/vendor/eluceo/ical/src/Property/DateTimeProperty.php deleted file mode 100644 index 01431c7..0000000 --- a/vendor/eluceo/ical/src/Property/DateTimeProperty.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -use Eluceo\iCal\Property; -use Eluceo\iCal\Util\DateUtil; - -class DateTimeProperty extends Property -{ - /** - * @param string $name - * @param \DateTimeInterface $dateTime - * @param bool $noTime - * @param bool $useTimezone - * @param bool $useUtc - * @param string $timezoneString - */ - public function __construct( - $name, - \DateTimeInterface $dateTime = null, - $noTime = false, - $useTimezone = false, - $useUtc = false, - $timezoneString = '' - ) { - $dateString = DateUtil::getDateString($dateTime, $noTime, $useTimezone, $useUtc); - $params = DateUtil::getDefaultParams($dateTime, $noTime, $useTimezone, $timezoneString); - - parent::__construct($name, $dateString, $params); - } -} diff --git a/vendor/eluceo/ical/src/Property/DateTimesProperty.php b/vendor/eluceo/ical/src/Property/DateTimesProperty.php deleted file mode 100644 index 9a81f3d..0000000 --- a/vendor/eluceo/ical/src/Property/DateTimesProperty.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -use Eluceo\iCal\Property; -use Eluceo\iCal\Util\DateUtil; - -class DateTimesProperty extends Property -{ - /** - * @param string $name - * @param \DateTimeInterface[] $dateTimes - * @param bool $noTime - * @param bool $useTimezone - * @param bool $useUtc - * @param string $timezoneString - */ - public function __construct( - $name, - $dateTimes = [], - $noTime = false, - $useTimezone = false, - $useUtc = false, - $timezoneString = '' - ) { - $dates = []; - $dateTime = new \DateTimeImmutable(); - foreach ($dateTimes as $dateTime) { - $dates[] = DateUtil::getDateString($dateTime, $noTime, $useTimezone, $useUtc); - } - - //@todo stop this triggering an E_NOTICE when $dateTimes is empty - $params = DateUtil::getDefaultParams($dateTime, $noTime, $useTimezone, $timezoneString); - - parent::__construct($name, $dates, $params); - } -} diff --git a/vendor/eluceo/ical/src/Property/Event/Attendees.php b/vendor/eluceo/ical/src/Property/Event/Attendees.php deleted file mode 100644 index a014a95..0000000 --- a/vendor/eluceo/ical/src/Property/Event/Attendees.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property\Event; - -use Eluceo\iCal\Property; - -class Attendees extends Property -{ - /** - * @var Property[] - */ - protected $attendees = []; - - public function __construct() - { - $this->name = 'ATTENDEES'; - // prevent super constructor to be called - } - - /** - * @param $value - * @param array $params - * - * @return $this - */ - public function add($value, $params = []) - { - $this->attendees[] = new Property('ATTENDEE', $value, $params); - - return $this; - } - - /** - * @param Property[] $value - * - * @return $this - */ - public function setValue($value) - { - $this->attendees = $value; - - return $this; - } - - /** - * @return Property[] - */ - public function getValue() - { - return $this->attendees; - } - - /** - * {@inheritdoc} - */ - public function toLines() - { - $lines = []; - foreach ($this->attendees as $attendee) { - $lines[] = $attendee->toLine(); - } - - return $lines; - } - - /** - * @param string $name - * @param mixed $value - * - * @throws \BadMethodCallException - */ - public function setParam($name, $value) - { - throw new \BadMethodCallException('Cannot call setParam on Attendees Property'); - } - - /** - * @param $name - * - * @throws \BadMethodCallException - */ - public function getParam($name) - { - throw new \BadMethodCallException('Cannot call getParam on Attendees Property'); - } -} diff --git a/vendor/eluceo/ical/src/Property/Event/Geo.php b/vendor/eluceo/ical/src/Property/Event/Geo.php deleted file mode 100644 index acd9c3c..0000000 --- a/vendor/eluceo/ical/src/Property/Event/Geo.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property\Event; - -use Eluceo\iCal\Property; - -/** - * GEO property. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.8.1.6 - */ -class Geo extends Property -{ - /** - * @var float - */ - private $latitude; - - /** - * @var float - */ - private $longitude; - - public function __construct(float $latitude, float $longitude) - { - $this->latitude = $latitude; - $this->longitude = $longitude; - - if ($this->latitude < -90 || $this->latitude > 90) { - throw new \InvalidArgumentException( - "The geographical latitude must be a value between -90 and 90 degrees. '{$this->latitude}' was given." - ); - } - - if ($this->longitude < -180 || $this->longitude > 180) { - throw new \InvalidArgumentException( - "The geographical longitude must be a value between -180 and 180 degrees. '{$this->longitude}' was given." - ); - } - - parent::__construct('GEO', new Property\RawStringValue($this->getGeoLocationAsString())); - } - - /** - * @deprecated This method is used to allow backwards compatibility for Event::setLocation - * - * @param string $geoLocationString - * - * @return Geo - */ - public static function fromString(string $geoLocationString): self - { - $geoLocationString = str_replace(',', ';', $geoLocationString); - $parts = explode(';', $geoLocationString); - - return new static((float) $parts[0], (float) $parts[1]); - } - - /** - * Returns the coordinates as a string. - * - * @example 37.386013;-122.082932 - * - * @param string $separator - * - * @return string - */ - public function getGeoLocationAsString(string $separator = ';'): string - { - return number_format($this->latitude, 6) . $separator . number_format($this->longitude, 6); - } - - /** - * @return float - */ - public function getLatitude(): float - { - return $this->latitude; - } - - /** - * @return float - */ - public function getLongitude(): float - { - return $this->longitude; - } -} diff --git a/vendor/eluceo/ical/src/Property/Event/Organizer.php b/vendor/eluceo/ical/src/Property/Event/Organizer.php deleted file mode 100644 index 46d497c..0000000 --- a/vendor/eluceo/ical/src/Property/Event/Organizer.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property\Event; - -use Eluceo\iCal\Property; - -/** - * Class Organizer. - */ -class Organizer extends Property -{ - /** - * @param string $value - * @param array $params - */ - public function __construct($value, $params = []) - { - parent::__construct('ORGANIZER', $value, $params); - } -} diff --git a/vendor/eluceo/ical/src/Property/Event/RecurrenceId.php b/vendor/eluceo/ical/src/Property/Event/RecurrenceId.php deleted file mode 100644 index 89c7e9a..0000000 --- a/vendor/eluceo/ical/src/Property/Event/RecurrenceId.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property\Event; - -use Eluceo\iCal\ParameterBag; -use Eluceo\iCal\Property; -use Eluceo\iCal\Property\ValueInterface; -use Eluceo\iCal\Util\DateUtil; - -/** - * Implementation of Recurrence Id. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.8.4.4 - */ -class RecurrenceId extends Property -{ - /** - * The effective range of recurrence instances from the instance - * specified by the recurrence identifier specified by the property. - */ - const RANGE_THISANDPRIOR = 'THISANDPRIOR'; - const RANGE_THISANDFUTURE = 'THISANDFUTURE'; - - /** - * The dateTime to identify a particular instance of a recurring event which is getting modified. - * - * @var \DateTimeInterface - */ - protected $dateTime; - - /** - * Specify the effective range of recurrence instances from the instance. - * - * @var string - */ - protected $range; - - public function __construct(\DateTimeInterface $dateTime = null) - { - $this->name = 'RECURRENCE-ID'; - $this->parameterBag = new ParameterBag(); - if (isset($dateTime)) { - $this->dateTime = $dateTime; - } - } - - public function applyTimeSettings($noTime = false, $useTimezone = false, $useUtc = false, $timezoneString = '') - { - $params = DateUtil::getDefaultParams($this->dateTime, $noTime, $useTimezone, $timezoneString); - foreach ($params as $name => $value) { - $this->parameterBag->setParam($name, $value); - } - - if ($this->range) { - $this->parameterBag->setParam('RANGE', $this->range); - } - - $this->setValue(DateUtil::getDateString($this->dateTime, $noTime, $useTimezone, $useUtc)); - } - - /** - * @return \DateTimeInterface - */ - public function getDatetime() - { - return $this->dateTime; - } - - /** - * @param \DateTimeInterface $dateTime - * - * @return \Eluceo\iCal\Property\Event\RecurrenceId - */ - public function setDatetime(\DateTimeInterface $dateTime) - { - $this->dateTime = $dateTime; - - return $this; - } - - /** - * @return string - */ - public function getRange() - { - return $this->range; - } - - /** - * @param string $range - * - * @return \Eluceo\iCal\Property\Event\RecurrenceId - */ - public function setRange($range) - { - $this->range = $range; - - return $this; - } - - /** - * Get all unfolded lines. - * - * @return array - */ - public function toLines() - { - if (!$this->value instanceof ValueInterface) { - throw new \Exception('The value must implement the ValueInterface. Call RecurrenceId::applyTimeSettings() before adding RecurrenceId.'); - } else { - return parent::toLines(); - } - } -} diff --git a/vendor/eluceo/ical/src/Property/Event/RecurrenceRule.php b/vendor/eluceo/ical/src/Property/Event/RecurrenceRule.php deleted file mode 100644 index fc66791..0000000 --- a/vendor/eluceo/ical/src/Property/Event/RecurrenceRule.php +++ /dev/null @@ -1,437 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property\Event; - -use Eluceo\iCal\ParameterBag; -use Eluceo\iCal\Property\ValueInterface; -use InvalidArgumentException; - -/** - * Implementation of Recurrence Rule. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.8.5.3 - */ -class RecurrenceRule implements ValueInterface -{ - const FREQ_YEARLY = 'YEARLY'; - const FREQ_MONTHLY = 'MONTHLY'; - const FREQ_WEEKLY = 'WEEKLY'; - const FREQ_DAILY = 'DAILY'; - const FREQ_HOURLY = 'HOURLY'; - const FREQ_MINUTELY = 'MINUTELY'; - const FREQ_SECONDLY = 'SECONDLY'; - - const WEEKDAY_SUNDAY = 'SU'; - const WEEKDAY_MONDAY = 'MO'; - const WEEKDAY_TUESDAY = 'TU'; - const WEEKDAY_WEDNESDAY = 'WE'; - const WEEKDAY_THURSDAY = 'TH'; - const WEEKDAY_FRIDAY = 'FR'; - const WEEKDAY_SATURDAY = 'SA'; - - /** - * The frequency of an Event. - * - * @var string - */ - protected $freq = self::FREQ_YEARLY; - - /** - * @var null|int - */ - protected $interval = 1; - - /** - * @var null|int - */ - protected $count = null; - - /** - * @var null|\DateTimeInterface - */ - protected $until = null; - - /** - * @var null|string - */ - protected $wkst; - - /** - * @var null|string - */ - protected $byMonth; - - /** - * @var null|string - */ - protected $byWeekNo; - - /** - * @var null|string - */ - protected $byYearDay; - - /** - * @var null|string - */ - protected $byMonthDay; - - /** - * @var null|string - */ - protected $byDay; - - /** - * @var null|string - */ - protected $byHour; - - /** - * @var null|string - */ - protected $byMinute; - - /** - * @var null|string - */ - protected $bySecond; - - public function getEscapedValue(): string - { - return $this->buildParameterBag()->toString(); - } - - /** - * @return ParameterBag - */ - protected function buildParameterBag() - { - $parameterBag = new ParameterBag(); - - $parameterBag->setParam('FREQ', $this->freq); - - if (null !== $this->interval) { - $parameterBag->setParam('INTERVAL', $this->interval); - } - - if (null !== $this->count) { - $parameterBag->setParam('COUNT', $this->count); - } - - if (null != $this->until) { - $parameterBag->setParam('UNTIL', $this->until->format('Ymd\THis\Z')); - } - - if (null !== $this->wkst) { - $parameterBag->setParam('WKST', $this->wkst); - } - - if (null !== $this->byMonth) { - $parameterBag->setParam('BYMONTH', $this->byMonth); - } - - if (null !== $this->byWeekNo) { - $parameterBag->setParam('BYWEEKNO', $this->byWeekNo); - } - - if (null !== $this->byYearDay) { - $parameterBag->setParam('BYYEARDAY', $this->byYearDay); - } - - if (null !== $this->byMonthDay) { - $parameterBag->setParam('BYMONTHDAY', $this->byMonthDay); - } - - if (null !== $this->byDay) { - $parameterBag->setParam('BYDAY', $this->byDay); - } - - if (null !== $this->byHour) { - $parameterBag->setParam('BYHOUR', $this->byHour); - } - - if (null !== $this->byMinute) { - $parameterBag->setParam('BYMINUTE', $this->byMinute); - } - - if (null !== $this->bySecond) { - $parameterBag->setParam('BYSECOND', $this->bySecond); - } - - return $parameterBag; - } - - /** - * @param int|null $count - * - * @return $this - */ - public function setCount($count) - { - $this->count = $count; - - return $this; - } - - /** - * @return int|null - */ - public function getCount() - { - return $this->count; - } - - /** - * @param \DateTimeInterface|null $until - * - * @return $this - */ - public function setUntil(\DateTimeInterface $until = null) - { - $this->until = $until; - - return $this; - } - - /** - * @return \DateTimeInterface|null - */ - public function getUntil() - { - return $this->until; - } - - /** - * The FREQ rule part identifies the type of recurrence rule. This - * rule part MUST be specified in the recurrence rule. Valid values - * include. - * - * SECONDLY, to specify repeating events based on an interval of a second or more; - * MINUTELY, to specify repeating events based on an interval of a minute or more; - * HOURLY, to specify repeating events based on an interval of an hour or more; - * DAILY, to specify repeating events based on an interval of a day or more; - * WEEKLY, to specify repeating events based on an interval of a week or more; - * MONTHLY, to specify repeating events based on an interval of a month or more; - * YEARLY, to specify repeating events based on an interval of a year or more. - * - * @param string $freq - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setFreq($freq) - { - if (@constant('static::FREQ_' . $freq) !== null) { - $this->freq = $freq; - } else { - throw new \InvalidArgumentException("The Frequency {$freq} is not supported."); - } - - return $this; - } - - /** - * @return string - */ - public function getFreq() - { - return $this->freq; - } - - /** - * The INTERVAL rule part contains a positive integer representing at - * which intervals the recurrence rule repeats. - * - * @param int|null $interval - * - * @return $this - */ - public function setInterval($interval) - { - $this->interval = $interval; - - return $this; - } - - /** - * @return int|null - */ - public function getInterval() - { - return $this->interval; - } - - /** - * The WKST rule part specifies the day on which the workweek starts. - * Valid values are MO, TU, WE, TH, FR, SA, and SU. - * - * @param string $value - * - * @return $this - */ - public function setWkst($value) - { - $this->wkst = $value; - - return $this; - } - - /** - * The BYMONTH rule part specifies a COMMA-separated list of months of the year. - * Valid values are 1 to 12. - * - * @param int $month - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function setByMonth($month) - { - if (!is_integer($month) || $month < 0 || $month > 12) { - throw new InvalidArgumentException('Invalid value for BYMONTH'); - } - - $this->byMonth = $month; - - return $this; - } - - /** - * The BYWEEKNO rule part specifies a COMMA-separated list of ordinals specifying weeks of the year. - * Valid values are 1 to 53 or -53 to -1. - * - * @param int $value - * - * @return $this - */ - public function setByWeekNo($value) - { - $this->byWeekNo = $value; - - return $this; - } - - /** - * The BYYEARDAY rule part specifies a COMMA-separated list of days of the year. - * Valid values are 1 to 366 or -366 to -1. - * - * @param int $day - * - * @return $this - */ - public function setByYearDay($day) - { - $this->byYearDay = $day; - - return $this; - } - - /** - * The BYMONTHDAY rule part specifies a COMMA-separated list of days of the month. - * Valid values are 1 to 31 or -31 to -1. - * - * @param int $day - * - * @return $this - */ - public function setByMonthDay($day) - { - $this->byMonthDay = $day; - - return $this; - } - - /** - * The BYDAY rule part specifies a COMMA-separated list of days of the week;. - * - * SU indicates Sunday; MO indicates Monday; TU indicates Tuesday; - * WE indicates Wednesday; TH indicates Thursday; FR indicates Friday; and SA indicates Saturday. - * - * Each BYDAY value can also be preceded by a positive (+n) or negative (-n) integer. - * If present, this indicates the nth occurrence of a specific day within the MONTHLY or YEARLY "RRULE". - * - * @param string $day - * - * @return $this - */ - public function setByDay($day) - { - $this->byDay = $day; - - return $this; - } - - /** - * The BYHOUR rule part specifies a COMMA-separated list of hours of the day. - * Valid values are 0 to 23. - * - * @param int $value - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setByHour($value) - { - if (!is_integer($value) || $value < 0 || $value > 23) { - throw new \InvalidArgumentException('Invalid value for BYHOUR'); - } - - $this->byHour = $value; - - return $this; - } - - /** - * The BYMINUTE rule part specifies a COMMA-separated list of minutes within an hour. - * Valid values are 0 to 59. - * - * @param int $value - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setByMinute($value) - { - if (!is_integer($value) || $value < 0 || $value > 59) { - throw new \InvalidArgumentException('Invalid value for BYMINUTE'); - } - - $this->byMinute = $value; - - return $this; - } - - /** - * The BYSECOND rule part specifies a COMMA-separated list of seconds within a minute. - * Valid values are 0 to 60. - * - * @param int $value - * - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setBySecond($value) - { - if (!is_integer($value) || $value < 0 || $value > 60) { - throw new \InvalidArgumentException('Invalid value for BYSECOND'); - } - - $this->bySecond = $value; - - return $this; - } -} diff --git a/vendor/eluceo/ical/src/Property/RawStringValue.php b/vendor/eluceo/ical/src/Property/RawStringValue.php deleted file mode 100644 index a0e16d0..0000000 --- a/vendor/eluceo/ical/src/Property/RawStringValue.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -class RawStringValue extends StringValue -{ - public function getEscapedValue(): string - { - return $this->getValue(); - } -} diff --git a/vendor/eluceo/ical/src/Property/StringValue.php b/vendor/eluceo/ical/src/Property/StringValue.php deleted file mode 100644 index 7b8f315..0000000 --- a/vendor/eluceo/ical/src/Property/StringValue.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -class StringValue implements ValueInterface -{ - /** - * The value. - * - * @var string - */ - protected $value; - - public function __construct($value) - { - $this->value = $value; - } - - public function getEscapedValue(): string - { - $value = $this->value; - - $value = str_replace('\\', '\\\\', $value); - $value = str_replace('"', '\\"', $value); - $value = str_replace(',', '\\,', $value); - $value = str_replace(';', '\\;', $value); - $value = str_replace("\n", '\\n', $value); - $value = str_replace([ - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", - "\x08", "\x09", /* \n*/ "\x0B", "\x0C", "\x0D", "\x0E", "\x0F", - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", - "\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F", - "\x7F", - ], '', $value); - - return $value; - } - - /** - * @param string $value - * - * @return $this - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/eluceo/ical/src/Property/ValueInterface.php b/vendor/eluceo/ical/src/Property/ValueInterface.php deleted file mode 100644 index 9573de8..0000000 --- a/vendor/eluceo/ical/src/Property/ValueInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Property; - -interface ValueInterface -{ - /** - * Return the value of the Property as an escaped string. - * - * Escape values as per RFC 5545. - * - * @see https://tools.ietf.org/html/rfc5545#section-3.3.11 - * - * @return string - */ - public function getEscapedValue(): string; -} diff --git a/vendor/eluceo/ical/src/PropertyBag.php b/vendor/eluceo/ical/src/PropertyBag.php deleted file mode 100644 index ffbeafd..0000000 --- a/vendor/eluceo/ical/src/PropertyBag.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal; - -class PropertyBag implements \IteratorAggregate -{ - /** - * @var array - */ - protected $elements = []; - - /** - * Creates a new Property with $name, $value and $params. - * - * @param $name - * @param $value - * @param array $params - * - * @return $this - */ - public function set($name, $value, $params = []) - { - $this->add(new Property($name, $value, $params)); - - return $this; - } - - /** - * @param string $name - * - * @return null|Property - */ - public function get(string $name) - { - if (isset($this->elements[$name])) { - return $this->elements[$name]; - } - - return null; - } - - /** - * Adds a Property. If Property already exists an Exception will be thrown. - * - * @param Property $property - * - * @return $this - * - * @throws \Exception - */ - public function add(Property $property) - { - $name = $property->getName(); - - if (isset($this->elements[$name])) { - throw new \Exception("Property with name '{$name}' already exists"); - } - - $this->elements[$name] = $property; - - return $this; - } - - public function getIterator() - { - return new \ArrayObject($this->elements); - } -} diff --git a/vendor/eluceo/ical/src/Util/ComponentUtil.php b/vendor/eluceo/ical/src/Util/ComponentUtil.php deleted file mode 100644 index d6b3d25..0000000 --- a/vendor/eluceo/ical/src/Util/ComponentUtil.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Util; - -class ComponentUtil -{ - /** - * Folds a single line. - * - * According to RFC 5545, all lines longer than 75 characters should be folded - * - * @see https://tools.ietf.org/html/rfc5545#section-5 - * @see https://tools.ietf.org/html/rfc5545#section-3.1 - * - * @param string $string - * - * @return array - */ - public static function fold($string) - { - $lines = []; - - if (function_exists('mb_strcut')) { - while (strlen($string) > 0) { - if (strlen($string) > 75) { - $lines[] = mb_strcut($string, 0, 75, 'utf-8'); - $string = ' ' . mb_strcut($string, 75, strlen($string), 'utf-8'); - } else { - $lines[] = $string; - $string = ''; - break; - } - } - } else { - $array = preg_split('/(? 75) { - $line = ' ' . $char; - ++$lineNo; - } else { - $line .= $char; - } - $lines[$lineNo] = $line; - } - } - - return $lines; - } -} diff --git a/vendor/eluceo/ical/src/Util/DateUtil.php b/vendor/eluceo/ical/src/Util/DateUtil.php deleted file mode 100644 index c20487d..0000000 --- a/vendor/eluceo/ical/src/Util/DateUtil.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Eluceo\iCal\Util; - -class DateUtil -{ - public static function getDefaultParams(\DateTimeInterface $dateTime = null, $noTime = false, $useTimezone = false, $timezoneString = '') - { - $params = []; - - if ($useTimezone && $noTime === false) { - $timeZone = $timezoneString === '' ? $dateTime->getTimezone()->getName() : $timezoneString; - $params['TZID'] = $timeZone; - } - - if ($noTime) { - $params['VALUE'] = 'DATE'; - } - - return $params; - } - - /** - * Returns a formatted date string. - * - * @param \DateTimeInterface|null $dateTime The DateTime object - * @param bool $noTime Indicates if the time will be added - * @param bool $useTimezone - * @param bool $useUtc - * - * @return mixed - */ - public static function getDateString(\DateTimeInterface $dateTime = null, $noTime = false, $useTimezone = false, $useUtc = false) - { - if (empty($dateTime)) { - $dateTime = new \DateTimeImmutable(); - } - - // Only convert the DateTime to UTC if there is a time present. For date-only the - // timezone is meaningless and converting it might shift it to the wrong date. - if (!$noTime && $useUtc) { - $dateTime = clone $dateTime; - $dateTime->setTimezone(new \DateTimeZone('UTC')); - } - - return $dateTime->format(self::getDateFormat($noTime, $useTimezone, $useUtc)); - } - - /** - * Returns the date format that can be passed to DateTime::format(). - * - * @param bool $noTime Indicates if the time will be added - * @param bool $useTimezone - * @param bool $useUtc - * - * @return string - */ - public static function getDateFormat($noTime = false, $useTimezone = false, $useUtc = false) - { - // Do not use UTC time (Z) if timezone support is enabled. - if ($useTimezone || !$useUtc) { - return $noTime ? 'Ymd' : 'Ymd\THis'; - } - - return $noTime ? 'Ymd' : 'Ymd\THis\Z'; - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Component/CalendarIntegrationTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Component/CalendarIntegrationTest.php deleted file mode 100644 index f13bb03..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Component/CalendarIntegrationTest.php +++ /dev/null @@ -1,144 +0,0 @@ -setPublishedTTL('P1W'); - - // 2. Create an event - $vEvent = new \Eluceo\iCal\Component\Event('123456'); - $vEvent->setDtStart(new \DateTime('2012-12-31', $timeZone)); - $vEvent->setDtEnd(new \DateTime('2012-12-31', $timeZone)); - $vEvent->setNoTime(true); - $vEvent->setIsPrivate(true); - $vEvent->setSummary('New Year’s Eve'); - - // Set recurrence rule - $recurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); - $recurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_YEARLY); - $recurrenceRule->setInterval(1); - $vEvent->addRecurrenceRule($recurrenceRule); - - // Adding Timezone (optional) - $vEvent->setUseTimezone(true); - - // 3. Add event to calendar - $vCalendar->addComponent($vEvent); - - $lines = array( - '/BEGIN:VCALENDAR/', - '/VERSION:2\.0/', - '/PRODID:www\.example\.com/', - '/X-PUBLISHED-TTL:P1W/', - '/BEGIN:VEVENT/', - '/UID:123456/', - '/DTSTART;VALUE=DATE:20121231/', - '/SEQUENCE:0/', - '/TRANSP:OPAQUE/', - '/DTEND;VALUE=DATE:20130101/', - '/SUMMARY:New Year’s Eve/', - '/CLASS:PRIVATE/', - '/RRULE:FREQ=YEARLY;INTERVAL=1/', - '/X-MICROSOFT-CDO-ALLDAYEVENT:TRUE/', - '/DTSTAMP:20\d{6}T\d{6}Z/', - '/END:VEVENT/', - '/END:VCALENDAR/', - ); - - foreach (explode("\n", $vCalendar->render()) as $key => $line) - { - $this->assertTrue(isset($lines[$key]), 'Too many lines... ' . $line); - - $this->assertRegExp($lines[$key], $line); - } - } - - /** - * @coversNothing - */ - public function testExample4b() - { - $timeZoneString = '/example.com/1.0.0-0/Europe/Berlin'; - - // 1. Create new calendar - $vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); - - // 2. Create an event - $vEvent = new \Eluceo\iCal\Component\Event('123456'); - $vEvent->setDtStart(new \DateTime('2012-11-11 13:00:00')); - $vEvent->setDtEnd(new \DateTime('2012-11-11 14:30:00')); - $vEvent->setSummary('Weekly lunch with Markus'); - - // Set recurrence rule - $recurrenceRule = new \Eluceo\iCal\Property\Event\RecurrenceRule(); - $recurrenceRule->setFreq(\Eluceo\iCal\Property\Event\RecurrenceRule::FREQ_WEEKLY); - $recurrenceRule->setInterval(1); - $vEvent->setRecurrenceRule($recurrenceRule); - - // Adding Timezone (optional) - $vEvent->setUseTimezone(true); - $vEvent->setTimezoneString($timeZoneString); - - // 3. Add event to calendar - $vCalendar->addComponent($vEvent); - - $lines = array( - '/BEGIN:VCALENDAR/', - '/VERSION:2\.0/', - '/PRODID:www\.example\.com/', - '/BEGIN:VEVENT/', - '/UID:123456/', - '/DTSTART;TZID=\/example.com\/1.0.0-0\/Europe\/Berlin:20121111T130000/', - '/SEQUENCE:0/', - '/TRANSP:OPAQUE/', - '/DTEND;TZID=\/example.com\/1.0.0-0\/Europe\/Berlin:20121111T143000/', - '/SUMMARY:Weekly lunch with Markus/', - '/CLASS:PUBLIC/', - '/RRULE:FREQ=WEEKLY;INTERVAL=1/', - '/DTSTAMP:20\d{6}T\d{6}Z/', - '/END:VEVENT/', - '/END:VCALENDAR/', - ); - - foreach (explode("\n", $vCalendar->render()) as $key => $line) - { - $this->assertTrue(isset($lines[$key]), 'Too many lines... ' . $line); - - $this->assertRegExp($lines[$key], $line); - } - } - - /** - * This test was introduced because of a regression bug. - * - * @see https://github.com/markuspoerschke/iCal/issues/98 - * - * @coversNothing - */ - public function testRenderIsIdempotent() - { - $vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); - - $vEvent = new \Eluceo\iCal\Component\Event('123456'); - $vEvent->setDtStart(new \DateTime('2012-12-24')); - $vEvent->setDtEnd(new \DateTime('2012-01-04')); - $vEvent->setNoTime(true); - $vEvent->setSummary('Vacations'); - - $vCalendar->addComponent($vEvent); - - $this->assertEquals($vCalendar->render(), $vCalendar->render()); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/ComponentTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/ComponentTest.php deleted file mode 100644 index 0acb1c6..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/ComponentTest.php +++ /dev/null @@ -1,47 +0,0 @@ -setDtStart(new \DateTime('2014-12-24')); - $vEvent->setDtEnd(new \DateTime('2014-12-24')); - $vEvent->setDescription($input); - - $vAlarm = new \Eluceo\iCal\Component\Alarm; - $vAlarm->setAction(\Eluceo\iCal\Component\Alarm::ACTION_DISPLAY); - $vAlarm->setDescription($input); - $vAlarm->setTrigger('PT0S', true); - $vEvent->addComponent($vAlarm); - - $vCalendar->addComponent($vEvent); - - $output = $vCalendar->render(); - $output = preg_replace('/\r\n /u', '', $output); - $this->assertContains($input, $output); - } - - public function testDescriptionWithNewLines() - { - $input = "new string \n new line \n new line \n new string"; - - $vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); - $vEvent = new \Eluceo\iCal\Component\Event(); - $vEvent->setDtStart(new \DateTime('2014-12-24')); - $vEvent->setDtEnd(new \DateTime('2014-12-24')); - $vEvent->setDescription($input); - - $vCalendar->addComponent($vEvent); - - $output = $vCalendar->render(); - $this->assertContains(str_replace("\n", "\\n", $input), $output); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/ParameterBagTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/ParameterBagTest.php deleted file mode 100644 index 1195e2e..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/ParameterBagTest.php +++ /dev/null @@ -1,32 +0,0 @@ -setParam('TEST', $value); - - $this->assertEquals( - $expected, - $propertyObject->toString() - ); - } - - public function escapedParamsDataProvider() - { - return [ - 'No escaping necessary' => ['test string', 'TEST=test string'], - 'Text contains double quotes' => ['Containing "double-quotes"', 'TEST="Containing \\"double-quotes\\""'], - 'Text with semicolon' => ['Containing forbidden chars like a ;', 'TEST="Containing forbidden chars like a ;"'], - 'Text with colon' => ['Containing forbidden chars like a :', 'TEST="Containing forbidden chars like a :"'], - ]; - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/ArrayValueTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Property/ArrayValueTest.php deleted file mode 100644 index f274b33..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/ArrayValueTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertEquals($expectedOutput, $arrayValue->getEscapedValue()); - } - - public function arrayValuesProvider() - { - return array( - array(array(), ''), - array(array('Lorem'), 'Lorem'), - array(array('Lorem', 'Ipsum'), 'Lorem,Ipsum'), - array(array('Lorem', '"doublequotes"'), 'Lorem,\"doublequotes\"'), - ); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/OrganizerTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/OrganizerTest.php deleted file mode 100644 index a69343c..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/OrganizerTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ - -namespace Eluceo\iCal\Property\Event; - -use PHPUnit\Framework\TestCase; - -/** - * OrganizerTest - */ -class OrganizerTest extends TestCase -{ - public function testOrganizerValueOnly() - { - $value = "MAILTO:name.lastname@example.com"; - $expected = "ORGANIZER:$value"; - - $vCalendar = $this->createCalendarWithOrganizer( - new \Eluceo\iCal\Property\Event\Organizer($value) - ); - - foreach (explode("\n", $vCalendar->render()) as $line) - { - if (preg_match('/^ORGANIZER[:;](.*)$/', $line)) { - $this->assertEquals($expected, trim($line)); - } - } - } - - public function testOrganizerValueAndParameter() - { - $value = "MAILTO:name.lastname@example.com"; - $param = "Name LastName"; - $expected = "ORGANIZER;CN=$param:$value"; - - $vCalendar = $this->createCalendarWithOrganizer( - new \Eluceo\iCal\Property\Event\Organizer($value, array('CN' => $param)) - ); - - foreach (explode("\n", $vCalendar->render()) as $line) - { - if (preg_match('/^ORGANIZER[:;](.*)$/', $line)) { - $this->assertEquals($expected, trim($line)); - } - } - - } - - /** - * @param Organizer $vOrganizer - * @return \Eluceo\iCal\Component\Calendar - */ - private function createCalendarWithOrganizer(\Eluceo\iCal\Property\Event\Organizer $vOrganizer) - { - $vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); - $vEvent = new \Eluceo\iCal\Component\Event('123456'); - $vEvent->setOrganizer($vOrganizer); - $vCalendar->addComponent($vEvent); - return $vCalendar; - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/RecurrenceRuleTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/RecurrenceRuleTest.php deleted file mode 100644 index ae9a748..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/Event/RecurrenceRuleTest.php +++ /dev/null @@ -1,23 +0,0 @@ -setFreq(RecurrenceRule::FREQ_DAILY); - $rule->setInterval(null); - $rule->setUntil(new \DateTime('1997-12-24')); - $this->assertEquals( - 'FREQ=DAILY;UNTIL=19971224T000000Z', - $rule->getEscapedValue() - ); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/StringValueTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Property/StringValueTest.php deleted file mode 100644 index ebc6984..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Property/StringValueTest.php +++ /dev/null @@ -1,63 +0,0 @@ -assertEquals( - 'LOREM', - $stringValue->getEscapedValue(), - 'No escaping necessary' - ); - } - - public function testValueContainsBackslash() - { - $stringValue = new StringValue('text contains backslash: \\'); - - $this->assertEquals( - 'text contains backslash: \\\\', - $stringValue->getEscapedValue(), - 'Text contains backslash' - ); - } - - public function testEscapingDoubleQuotes() - { - $stringValue = new StringValue('text with "doublequotes" will be escaped'); - - $this->assertEquals( - 'text with \\"doublequotes\\" will be escaped', - $stringValue->getEscapedValue(), - 'Escaping double quotes' - ); - } - - public function testEscapingSemicolonAndComma() - { - $stringValue = new StringValue('text with , and ; will also be escaped'); - - $this->assertEquals( - 'text with \\, and \\; will also be escaped', - $stringValue->getEscapedValue(), - 'Escaping ; and ,' - ); - } - - public function testNewLineEscaping() - { - $stringValue = new StringValue("Text with new\n line"); - - $this->assertEquals( - 'Text with new\\n line', - $stringValue->getEscapedValue(), - 'Escape new line to text' - ); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyBagTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyBagTest.php deleted file mode 100644 index 18fb506..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyBagTest.php +++ /dev/null @@ -1,19 +0,0 @@ -add(new Property('propName', '')); - $propertyBag->add(new Property('propName', '')); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyTest.php deleted file mode 100644 index c44baeb..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/PropertyTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals( - 'DTSTAMP:20131020T153112', - $property->toLine() - ); - } - - public function testPropertyWithValueAndParams() - { - $property = new Property('DTSTAMP', '20131020T153112', array('TZID' => 'Europe/Berlin')); - $this->assertEquals( - 'DTSTAMP;TZID=Europe/Berlin:20131020T153112', - $property->toLine() - ); - } - - public function testPropertyWithEscapedSingleValue() - { - $property = new Property('SOMEPROP', 'Escape me!"'); - $this->assertEquals( - 'SOMEPROP:Escape me!\\"', - $property->toLine() - ); - } - - public function testPropertyWithEscapedValues() - { - $property = new Property('SOMEPROP', 'Escape me!"', array('TEST' => 'Lorem "test" ipsum')); - $this->assertEquals( - 'SOMEPROP;TEST="Lorem \\"test\\" ipsum":Escape me!\\"', - $property->toLine() - ); - } -} diff --git a/vendor/eluceo/ical/tests/Eluceo/iCal/Util/DateUtilTest.php b/vendor/eluceo/ical/tests/Eluceo/iCal/Util/DateUtilTest.php deleted file mode 100644 index 791d7d0..0000000 --- a/vendor/eluceo/ical/tests/Eluceo/iCal/Util/DateUtilTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals('19991231T140000Z', $dateString); - } - - public function testNoTimezoneConversionForDateOnly() - { - $dateTime = new \DateTime('2000-01-01T00:00:00+1000'); - $dateString = DateUtil::getDateString($dateTime, true, false, true); - - $this->assertEquals('20000101', $dateString); - } - - public function testNoTimezoneConversionWhenNotUsingUTC() - { - $dateTime = new \DateTime('2000-01-01T00:00:00+1000'); - $dateString = DateUtil::getDateString($dateTime, false, false, false); - - $this->assertEquals('20000101T000000', $dateString); - } -}