@@ -46,103 +46,103 @@ |
||
| 46 | 46 | class DashboardManager implements IDashboardManager { |
| 47 | 47 | |
| 48 | 48 | |
| 49 | - /** @var IWidgetsService */ |
|
| 50 | - private $widgetsService; |
|
| 51 | - |
|
| 52 | - /** @var IEventsService */ |
|
| 53 | - private $eventsService; |
|
| 54 | - |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * @param IEventsService $eventsService |
|
| 58 | - */ |
|
| 59 | - public function registerEventsService(IEventsService $eventsService) { |
|
| 60 | - $this->eventsService = $eventsService; |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * @param IWidgetsService $widgetsService |
|
| 66 | - */ |
|
| 67 | - public function registerWidgetsService(IWidgetsService $widgetsService) { |
|
| 68 | - $this->widgetsService = $widgetsService; |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - |
|
| 72 | - /** |
|
| 73 | - * @param string $widgetId |
|
| 74 | - * @param string $userId |
|
| 75 | - * |
|
| 76 | - * @return IWidgetConfig |
|
| 77 | - * @throws DashboardAppNotAvailableException |
|
| 78 | - */ |
|
| 79 | - public function getWidgetConfig(string $widgetId, string $userId): IWidgetConfig { |
|
| 80 | - return $this->getWidgetsService()->getWidgetConfig($widgetId, $userId); |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * @param string $widgetId |
|
| 86 | - * @param array $users |
|
| 87 | - * @param array $payload |
|
| 88 | - * @param string $uniqueId |
|
| 89 | - * |
|
| 90 | - * @throws DashboardAppNotAvailableException |
|
| 91 | - */ |
|
| 92 | - public function createUsersEvent(string $widgetId, array $users, array $payload, string $uniqueId = '') { |
|
| 93 | - $this->getEventsService()->createUsersEvent($widgetId, $users, $payload, $uniqueId); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - |
|
| 97 | - /** |
|
| 98 | - * @param string $widgetId |
|
| 99 | - * @param array $groups |
|
| 100 | - * @param array $payload |
|
| 101 | - * @param string $uniqueId |
|
| 102 | - * |
|
| 103 | - * @throws DashboardAppNotAvailableException |
|
| 104 | - */ |
|
| 105 | - public function createGroupsEvent(string $widgetId, array $groups, array $payload, string $uniqueId = '') { |
|
| 106 | - $this->getEventsService()->createGroupsEvent($widgetId, $groups, $payload, $uniqueId); |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * @param string $widgetId |
|
| 112 | - * @param array $payload |
|
| 113 | - * @param string $uniqueId |
|
| 114 | - * |
|
| 115 | - * @throws DashboardAppNotAvailableException |
|
| 116 | - */ |
|
| 117 | - public function createGlobalEvent(string $widgetId, array $payload, string $uniqueId = '') { |
|
| 118 | - $this->getEventsService()->createGlobalEvent($widgetId, $payload, $uniqueId); |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * @return IWidgetsService |
|
| 124 | - * @throws DashboardAppNotAvailableException |
|
| 125 | - */ |
|
| 126 | - private function getWidgetsService() { |
|
| 127 | - if ($this->widgetsService === null) { |
|
| 128 | - throw new DashboardAppNotAvailableException('No IWidgetsService registered'); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - return $this->widgetsService; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * @return IEventsService |
|
| 137 | - * @throws DashboardAppNotAvailableException |
|
| 138 | - */ |
|
| 139 | - private function getEventsService() { |
|
| 140 | - if ($this->eventsService === null) { |
|
| 141 | - throw new DashboardAppNotAvailableException('No IEventsService registered'); |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - return $this->eventsService; |
|
| 145 | - } |
|
| 49 | + /** @var IWidgetsService */ |
|
| 50 | + private $widgetsService; |
|
| 51 | + |
|
| 52 | + /** @var IEventsService */ |
|
| 53 | + private $eventsService; |
|
| 54 | + |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * @param IEventsService $eventsService |
|
| 58 | + */ |
|
| 59 | + public function registerEventsService(IEventsService $eventsService) { |
|
| 60 | + $this->eventsService = $eventsService; |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @param IWidgetsService $widgetsService |
|
| 66 | + */ |
|
| 67 | + public function registerWidgetsService(IWidgetsService $widgetsService) { |
|
| 68 | + $this->widgetsService = $widgetsService; |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * @param string $widgetId |
|
| 74 | + * @param string $userId |
|
| 75 | + * |
|
| 76 | + * @return IWidgetConfig |
|
| 77 | + * @throws DashboardAppNotAvailableException |
|
| 78 | + */ |
|
| 79 | + public function getWidgetConfig(string $widgetId, string $userId): IWidgetConfig { |
|
| 80 | + return $this->getWidgetsService()->getWidgetConfig($widgetId, $userId); |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * @param string $widgetId |
|
| 86 | + * @param array $users |
|
| 87 | + * @param array $payload |
|
| 88 | + * @param string $uniqueId |
|
| 89 | + * |
|
| 90 | + * @throws DashboardAppNotAvailableException |
|
| 91 | + */ |
|
| 92 | + public function createUsersEvent(string $widgetId, array $users, array $payload, string $uniqueId = '') { |
|
| 93 | + $this->getEventsService()->createUsersEvent($widgetId, $users, $payload, $uniqueId); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + |
|
| 97 | + /** |
|
| 98 | + * @param string $widgetId |
|
| 99 | + * @param array $groups |
|
| 100 | + * @param array $payload |
|
| 101 | + * @param string $uniqueId |
|
| 102 | + * |
|
| 103 | + * @throws DashboardAppNotAvailableException |
|
| 104 | + */ |
|
| 105 | + public function createGroupsEvent(string $widgetId, array $groups, array $payload, string $uniqueId = '') { |
|
| 106 | + $this->getEventsService()->createGroupsEvent($widgetId, $groups, $payload, $uniqueId); |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * @param string $widgetId |
|
| 112 | + * @param array $payload |
|
| 113 | + * @param string $uniqueId |
|
| 114 | + * |
|
| 115 | + * @throws DashboardAppNotAvailableException |
|
| 116 | + */ |
|
| 117 | + public function createGlobalEvent(string $widgetId, array $payload, string $uniqueId = '') { |
|
| 118 | + $this->getEventsService()->createGlobalEvent($widgetId, $payload, $uniqueId); |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * @return IWidgetsService |
|
| 124 | + * @throws DashboardAppNotAvailableException |
|
| 125 | + */ |
|
| 126 | + private function getWidgetsService() { |
|
| 127 | + if ($this->widgetsService === null) { |
|
| 128 | + throw new DashboardAppNotAvailableException('No IWidgetsService registered'); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + return $this->widgetsService; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * @return IEventsService |
|
| 137 | + * @throws DashboardAppNotAvailableException |
|
| 138 | + */ |
|
| 139 | + private function getEventsService() { |
|
| 140 | + if ($this->eventsService === null) { |
|
| 141 | + throw new DashboardAppNotAvailableException('No IEventsService registered'); |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + return $this->eventsService; |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | 147 | } |
| 148 | 148 | |
@@ -34,71 +34,71 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | interface IAccountProperty extends \JsonSerializable { |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Set the value of a property |
|
| 39 | - * |
|
| 40 | - * @since 15.0.0 |
|
| 41 | - * |
|
| 42 | - * @param string $value |
|
| 43 | - * @return IAccountProperty |
|
| 44 | - */ |
|
| 45 | - public function setValue(string $value): IAccountProperty; |
|
| 37 | + /** |
|
| 38 | + * Set the value of a property |
|
| 39 | + * |
|
| 40 | + * @since 15.0.0 |
|
| 41 | + * |
|
| 42 | + * @param string $value |
|
| 43 | + * @return IAccountProperty |
|
| 44 | + */ |
|
| 45 | + public function setValue(string $value): IAccountProperty; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Set the scope of a property |
|
| 49 | - * |
|
| 50 | - * @since 15.0.0 |
|
| 51 | - * |
|
| 52 | - * @param string $scope |
|
| 53 | - * @return IAccountProperty |
|
| 54 | - */ |
|
| 55 | - public function setScope(string $scope): IAccountProperty; |
|
| 47 | + /** |
|
| 48 | + * Set the scope of a property |
|
| 49 | + * |
|
| 50 | + * @since 15.0.0 |
|
| 51 | + * |
|
| 52 | + * @param string $scope |
|
| 53 | + * @return IAccountProperty |
|
| 54 | + */ |
|
| 55 | + public function setScope(string $scope): IAccountProperty; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Set the verification status of a property |
|
| 59 | - * |
|
| 60 | - * @since 15.0.0 |
|
| 61 | - * |
|
| 62 | - * @param string $verified |
|
| 63 | - * @return IAccountProperty |
|
| 64 | - */ |
|
| 65 | - public function setVerified(string $verified): IAccountProperty; |
|
| 57 | + /** |
|
| 58 | + * Set the verification status of a property |
|
| 59 | + * |
|
| 60 | + * @since 15.0.0 |
|
| 61 | + * |
|
| 62 | + * @param string $verified |
|
| 63 | + * @return IAccountProperty |
|
| 64 | + */ |
|
| 65 | + public function setVerified(string $verified): IAccountProperty; |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Get the name of a property |
|
| 69 | - * |
|
| 70 | - * @since 15.0.0 |
|
| 71 | - * |
|
| 72 | - * @return string |
|
| 73 | - */ |
|
| 74 | - public function getName(): string; |
|
| 67 | + /** |
|
| 68 | + * Get the name of a property |
|
| 69 | + * |
|
| 70 | + * @since 15.0.0 |
|
| 71 | + * |
|
| 72 | + * @return string |
|
| 73 | + */ |
|
| 74 | + public function getName(): string; |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Get the value of a property |
|
| 78 | - * |
|
| 79 | - * @since 15.0.0 |
|
| 80 | - * |
|
| 81 | - * @return string |
|
| 82 | - */ |
|
| 83 | - public function getValue(): string; |
|
| 76 | + /** |
|
| 77 | + * Get the value of a property |
|
| 78 | + * |
|
| 79 | + * @since 15.0.0 |
|
| 80 | + * |
|
| 81 | + * @return string |
|
| 82 | + */ |
|
| 83 | + public function getValue(): string; |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Get the scope of a property |
|
| 87 | - * |
|
| 88 | - * @since 15.0.0 |
|
| 89 | - * |
|
| 90 | - * @return string |
|
| 91 | - */ |
|
| 92 | - public function getScope(): string; |
|
| 85 | + /** |
|
| 86 | + * Get the scope of a property |
|
| 87 | + * |
|
| 88 | + * @since 15.0.0 |
|
| 89 | + * |
|
| 90 | + * @return string |
|
| 91 | + */ |
|
| 92 | + public function getScope(): string; |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * Get the verification status of a property |
|
| 96 | - * |
|
| 97 | - * @since 15.0.0 |
|
| 98 | - * |
|
| 99 | - * @return string |
|
| 100 | - */ |
|
| 101 | - public function getVerified(): string; |
|
| 94 | + /** |
|
| 95 | + * Get the verification status of a property |
|
| 96 | + * |
|
| 97 | + * @since 15.0.0 |
|
| 98 | + * |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 101 | + public function getVerified(): string; |
|
| 102 | 102 | |
| 103 | 103 | } |
| 104 | 104 | |
@@ -30,111 +30,111 @@ |
||
| 30 | 30 | |
| 31 | 31 | class AccountProperty implements IAccountProperty { |
| 32 | 32 | |
| 33 | - /** @var string */ |
|
| 34 | - private $name; |
|
| 35 | - /** @var string */ |
|
| 36 | - private $value; |
|
| 37 | - /** @var string */ |
|
| 38 | - private $scope; |
|
| 39 | - /** @var string */ |
|
| 40 | - private $verified; |
|
| 33 | + /** @var string */ |
|
| 34 | + private $name; |
|
| 35 | + /** @var string */ |
|
| 36 | + private $value; |
|
| 37 | + /** @var string */ |
|
| 38 | + private $scope; |
|
| 39 | + /** @var string */ |
|
| 40 | + private $verified; |
|
| 41 | 41 | |
| 42 | - public function __construct(string $name, string $value, string $scope, string $verified) { |
|
| 43 | - $this->name = $name; |
|
| 44 | - $this->value = $value; |
|
| 45 | - $this->scope = $scope; |
|
| 46 | - $this->verified = $verified; |
|
| 47 | - } |
|
| 42 | + public function __construct(string $name, string $value, string $scope, string $verified) { |
|
| 43 | + $this->name = $name; |
|
| 44 | + $this->value = $value; |
|
| 45 | + $this->scope = $scope; |
|
| 46 | + $this->verified = $verified; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - public function jsonSerialize() { |
|
| 50 | - return [ |
|
| 51 | - 'name' => $this->getName(), |
|
| 52 | - 'value' => $this->getValue(), |
|
| 53 | - 'scope' => $this->getScope(), |
|
| 54 | - 'verified' => $this->getVerified() |
|
| 55 | - ]; |
|
| 56 | - } |
|
| 49 | + public function jsonSerialize() { |
|
| 50 | + return [ |
|
| 51 | + 'name' => $this->getName(), |
|
| 52 | + 'value' => $this->getValue(), |
|
| 53 | + 'scope' => $this->getScope(), |
|
| 54 | + 'verified' => $this->getVerified() |
|
| 55 | + ]; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Set the value of a property |
|
| 60 | - * |
|
| 61 | - * @since 15.0.0 |
|
| 62 | - * |
|
| 63 | - * @param string $value |
|
| 64 | - * @return IAccountProperty |
|
| 65 | - */ |
|
| 66 | - public function setValue(string $value): IAccountProperty { |
|
| 67 | - $this->value = $value; |
|
| 68 | - return $this; |
|
| 69 | - } |
|
| 58 | + /** |
|
| 59 | + * Set the value of a property |
|
| 60 | + * |
|
| 61 | + * @since 15.0.0 |
|
| 62 | + * |
|
| 63 | + * @param string $value |
|
| 64 | + * @return IAccountProperty |
|
| 65 | + */ |
|
| 66 | + public function setValue(string $value): IAccountProperty { |
|
| 67 | + $this->value = $value; |
|
| 68 | + return $this; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Set the scope of a property |
|
| 73 | - * |
|
| 74 | - * @since 15.0.0 |
|
| 75 | - * |
|
| 76 | - * @param string $scope |
|
| 77 | - * @return IAccountProperty |
|
| 78 | - */ |
|
| 79 | - public function setScope(string $scope): IAccountProperty { |
|
| 80 | - $this->scope = $scope; |
|
| 81 | - return $this; |
|
| 82 | - } |
|
| 71 | + /** |
|
| 72 | + * Set the scope of a property |
|
| 73 | + * |
|
| 74 | + * @since 15.0.0 |
|
| 75 | + * |
|
| 76 | + * @param string $scope |
|
| 77 | + * @return IAccountProperty |
|
| 78 | + */ |
|
| 79 | + public function setScope(string $scope): IAccountProperty { |
|
| 80 | + $this->scope = $scope; |
|
| 81 | + return $this; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * Set the verification status of a property |
|
| 86 | - * |
|
| 87 | - * @since 15.0.0 |
|
| 88 | - * |
|
| 89 | - * @param string $verified |
|
| 90 | - * @return IAccountProperty |
|
| 91 | - */ |
|
| 92 | - public function setVerified(string $verified): IAccountProperty { |
|
| 93 | - $this->verified = $verified; |
|
| 94 | - return $this; |
|
| 95 | - } |
|
| 84 | + /** |
|
| 85 | + * Set the verification status of a property |
|
| 86 | + * |
|
| 87 | + * @since 15.0.0 |
|
| 88 | + * |
|
| 89 | + * @param string $verified |
|
| 90 | + * @return IAccountProperty |
|
| 91 | + */ |
|
| 92 | + public function setVerified(string $verified): IAccountProperty { |
|
| 93 | + $this->verified = $verified; |
|
| 94 | + return $this; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - /** |
|
| 98 | - * Get the name of a property |
|
| 99 | - * |
|
| 100 | - * @since 15.0.0 |
|
| 101 | - * |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 104 | - public function getName(): string { |
|
| 105 | - return $this->name; |
|
| 106 | - } |
|
| 97 | + /** |
|
| 98 | + * Get the name of a property |
|
| 99 | + * |
|
| 100 | + * @since 15.0.0 |
|
| 101 | + * |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | + public function getName(): string { |
|
| 105 | + return $this->name; |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Get the value of a property |
|
| 110 | - * |
|
| 111 | - * @since 15.0.0 |
|
| 112 | - * |
|
| 113 | - * @return string |
|
| 114 | - */ |
|
| 115 | - public function getValue(): string { |
|
| 116 | - return $this->value; |
|
| 117 | - } |
|
| 108 | + /** |
|
| 109 | + * Get the value of a property |
|
| 110 | + * |
|
| 111 | + * @since 15.0.0 |
|
| 112 | + * |
|
| 113 | + * @return string |
|
| 114 | + */ |
|
| 115 | + public function getValue(): string { |
|
| 116 | + return $this->value; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * Get the scope of a property |
|
| 121 | - * |
|
| 122 | - * @since 15.0.0 |
|
| 123 | - * |
|
| 124 | - * @return string |
|
| 125 | - */ |
|
| 126 | - public function getScope(): string { |
|
| 127 | - return $this->scope; |
|
| 128 | - } |
|
| 119 | + /** |
|
| 120 | + * Get the scope of a property |
|
| 121 | + * |
|
| 122 | + * @since 15.0.0 |
|
| 123 | + * |
|
| 124 | + * @return string |
|
| 125 | + */ |
|
| 126 | + public function getScope(): string { |
|
| 127 | + return $this->scope; |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - /** |
|
| 131 | - * Get the verification status of a property |
|
| 132 | - * |
|
| 133 | - * @since 15.0.0 |
|
| 134 | - * |
|
| 135 | - * @return string |
|
| 136 | - */ |
|
| 137 | - public function getVerified(): string { |
|
| 138 | - return $this->verified; |
|
| 139 | - } |
|
| 130 | + /** |
|
| 131 | + * Get the verification status of a property |
|
| 132 | + * |
|
| 133 | + * @since 15.0.0 |
|
| 134 | + * |
|
| 135 | + * @return string |
|
| 136 | + */ |
|
| 137 | + public function getVerified(): string { |
|
| 138 | + return $this->verified; |
|
| 139 | + } |
|
| 140 | 140 | } |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | ], |
| 75 | 75 | [ |
| 76 | 76 | 'privilege' => '{DAV:}read', |
| 77 | - 'principal' => $this->getOwner() . '/calendar-proxy-read', |
|
| 77 | + 'principal' => $this->getOwner().'/calendar-proxy-read', |
|
| 78 | 78 | 'protected' => true, |
| 79 | 79 | ], |
| 80 | 80 | [ |
| 81 | 81 | 'privilege' => '{DAV:}read', |
| 82 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 82 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
| 83 | 83 | 'protected' => true, |
| 84 | 84 | ], |
| 85 | 85 | ]; |
@@ -94,23 +94,23 @@ discard block |
||
| 94 | 94 | if ($this->disableFreeBusy) { |
| 95 | 95 | return array_merge($commonAcl, [ |
| 96 | 96 | [ |
| 97 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 97 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send-invite', |
|
| 98 | 98 | 'principal' => $this->getOwner(), |
| 99 | 99 | 'protected' => true, |
| 100 | 100 | ], |
| 101 | 101 | [ |
| 102 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 103 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 102 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send-invite', |
|
| 103 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
| 104 | 104 | 'protected' => true, |
| 105 | 105 | ], |
| 106 | 106 | [ |
| 107 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 107 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send-reply', |
|
| 108 | 108 | 'principal' => $this->getOwner(), |
| 109 | 109 | 'protected' => true, |
| 110 | 110 | ], |
| 111 | 111 | [ |
| 112 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 113 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 112 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send-reply', |
|
| 113 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
| 114 | 114 | 'protected' => true, |
| 115 | 115 | ], |
| 116 | 116 | ]); |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | return array_merge($commonAcl, [ |
| 120 | 120 | [ |
| 121 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 121 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send', |
|
| 122 | 122 | 'principal' => $this->getOwner(), |
| 123 | 123 | 'protected' => true, |
| 124 | 124 | ], |
| 125 | 125 | [ |
| 126 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 127 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 126 | + 'privilege' => '{'.CalDAVPlugin::NS_CALDAV.'}schedule-send', |
|
| 127 | + 'principal' => $this->getOwner().'/calendar-proxy-write', |
|
| 128 | 128 | 'protected' => true, |
| 129 | 129 | ], |
| 130 | 130 | ]); |
@@ -34,102 +34,102 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | class Outbox extends \Sabre\CalDAV\Schedule\Outbox { |
| 36 | 36 | |
| 37 | - /** @var IConfig */ |
|
| 38 | - private $config; |
|
| 37 | + /** @var IConfig */ |
|
| 38 | + private $config; |
|
| 39 | 39 | |
| 40 | - /** @var null|bool */ |
|
| 41 | - private $disableFreeBusy = null; |
|
| 40 | + /** @var null|bool */ |
|
| 41 | + private $disableFreeBusy = null; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Outbox constructor. |
|
| 45 | - * |
|
| 46 | - * @param IConfig $config |
|
| 47 | - * @param string $principalUri |
|
| 48 | - */ |
|
| 49 | - public function __construct(IConfig $config, string $principalUri) { |
|
| 50 | - parent::__construct($principalUri); |
|
| 51 | - $this->config = $config; |
|
| 52 | - } |
|
| 43 | + /** |
|
| 44 | + * Outbox constructor. |
|
| 45 | + * |
|
| 46 | + * @param IConfig $config |
|
| 47 | + * @param string $principalUri |
|
| 48 | + */ |
|
| 49 | + public function __construct(IConfig $config, string $principalUri) { |
|
| 50 | + parent::__construct($principalUri); |
|
| 51 | + $this->config = $config; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Returns a list of ACE's for this node. |
|
| 56 | - * |
|
| 57 | - * Each ACE has the following properties: |
|
| 58 | - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
| 59 | - * currently the only supported privileges |
|
| 60 | - * * 'principal', a url to the principal who owns the node |
|
| 61 | - * * 'protected' (optional), indicating that this ACE is not allowed to |
|
| 62 | - * be updated. |
|
| 63 | - * |
|
| 64 | - * @return array |
|
| 65 | - */ |
|
| 66 | - public function getACL() { |
|
| 67 | - // getACL is called so frequently that we cache the config result |
|
| 68 | - if ($this->disableFreeBusy === null) { |
|
| 69 | - $this->disableFreeBusy = ($this->config->getAppValue('dav', 'disableFreeBusy', 'no') === 'yes'); |
|
| 70 | - } |
|
| 54 | + /** |
|
| 55 | + * Returns a list of ACE's for this node. |
|
| 56 | + * |
|
| 57 | + * Each ACE has the following properties: |
|
| 58 | + * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
| 59 | + * currently the only supported privileges |
|
| 60 | + * * 'principal', a url to the principal who owns the node |
|
| 61 | + * * 'protected' (optional), indicating that this ACE is not allowed to |
|
| 62 | + * be updated. |
|
| 63 | + * |
|
| 64 | + * @return array |
|
| 65 | + */ |
|
| 66 | + public function getACL() { |
|
| 67 | + // getACL is called so frequently that we cache the config result |
|
| 68 | + if ($this->disableFreeBusy === null) { |
|
| 69 | + $this->disableFreeBusy = ($this->config->getAppValue('dav', 'disableFreeBusy', 'no') === 'yes'); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - $commonAcl = [ |
|
| 73 | - [ |
|
| 74 | - 'privilege' => '{DAV:}read', |
|
| 75 | - 'principal' => $this->getOwner(), |
|
| 76 | - 'protected' => true, |
|
| 77 | - ], |
|
| 78 | - [ |
|
| 79 | - 'privilege' => '{DAV:}read', |
|
| 80 | - 'principal' => $this->getOwner() . '/calendar-proxy-read', |
|
| 81 | - 'protected' => true, |
|
| 82 | - ], |
|
| 83 | - [ |
|
| 84 | - 'privilege' => '{DAV:}read', |
|
| 85 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 86 | - 'protected' => true, |
|
| 87 | - ], |
|
| 88 | - ]; |
|
| 72 | + $commonAcl = [ |
|
| 73 | + [ |
|
| 74 | + 'privilege' => '{DAV:}read', |
|
| 75 | + 'principal' => $this->getOwner(), |
|
| 76 | + 'protected' => true, |
|
| 77 | + ], |
|
| 78 | + [ |
|
| 79 | + 'privilege' => '{DAV:}read', |
|
| 80 | + 'principal' => $this->getOwner() . '/calendar-proxy-read', |
|
| 81 | + 'protected' => true, |
|
| 82 | + ], |
|
| 83 | + [ |
|
| 84 | + 'privilege' => '{DAV:}read', |
|
| 85 | + 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 86 | + 'protected' => true, |
|
| 87 | + ], |
|
| 88 | + ]; |
|
| 89 | 89 | |
| 90 | - // schedule-send is an aggregate privilege for: |
|
| 91 | - // - schedule-send-invite |
|
| 92 | - // - schedule-send-reply |
|
| 93 | - // - schedule-send-freebusy |
|
| 94 | - // |
|
| 95 | - // If FreeBusy is disabled, we have to remove the latter privilege |
|
| 90 | + // schedule-send is an aggregate privilege for: |
|
| 91 | + // - schedule-send-invite |
|
| 92 | + // - schedule-send-reply |
|
| 93 | + // - schedule-send-freebusy |
|
| 94 | + // |
|
| 95 | + // If FreeBusy is disabled, we have to remove the latter privilege |
|
| 96 | 96 | |
| 97 | - if ($this->disableFreeBusy) { |
|
| 98 | - return array_merge($commonAcl, [ |
|
| 99 | - [ |
|
| 100 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 101 | - 'principal' => $this->getOwner(), |
|
| 102 | - 'protected' => true, |
|
| 103 | - ], |
|
| 104 | - [ |
|
| 105 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 106 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 107 | - 'protected' => true, |
|
| 108 | - ], |
|
| 109 | - [ |
|
| 110 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 111 | - 'principal' => $this->getOwner(), |
|
| 112 | - 'protected' => true, |
|
| 113 | - ], |
|
| 114 | - [ |
|
| 115 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 116 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 117 | - 'protected' => true, |
|
| 118 | - ], |
|
| 119 | - ]); |
|
| 120 | - } |
|
| 97 | + if ($this->disableFreeBusy) { |
|
| 98 | + return array_merge($commonAcl, [ |
|
| 99 | + [ |
|
| 100 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 101 | + 'principal' => $this->getOwner(), |
|
| 102 | + 'protected' => true, |
|
| 103 | + ], |
|
| 104 | + [ |
|
| 105 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-invite', |
|
| 106 | + 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 107 | + 'protected' => true, |
|
| 108 | + ], |
|
| 109 | + [ |
|
| 110 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 111 | + 'principal' => $this->getOwner(), |
|
| 112 | + 'protected' => true, |
|
| 113 | + ], |
|
| 114 | + [ |
|
| 115 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send-reply', |
|
| 116 | + 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 117 | + 'protected' => true, |
|
| 118 | + ], |
|
| 119 | + ]); |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - return array_merge($commonAcl, [ |
|
| 123 | - [ |
|
| 124 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 125 | - 'principal' => $this->getOwner(), |
|
| 126 | - 'protected' => true, |
|
| 127 | - ], |
|
| 128 | - [ |
|
| 129 | - 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 130 | - 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 131 | - 'protected' => true, |
|
| 132 | - ], |
|
| 133 | - ]); |
|
| 134 | - } |
|
| 122 | + return array_merge($commonAcl, [ |
|
| 123 | + [ |
|
| 124 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 125 | + 'principal' => $this->getOwner(), |
|
| 126 | + 'protected' => true, |
|
| 127 | + ], |
|
| 128 | + [ |
|
| 129 | + 'privilege' => '{' . CalDAVPlugin::NS_CALDAV . '}schedule-send', |
|
| 130 | + 'principal' => $this->getOwner() . '/calendar-proxy-write', |
|
| 131 | + 'protected' => true, |
|
| 132 | + ], |
|
| 133 | + ]); |
|
| 134 | + } |
|
| 135 | 135 | } |
@@ -73,17 +73,17 @@ |
||
| 73 | 73 | |
| 74 | 74 | try { |
| 75 | 75 | $jobStartTime = $this->time->getTime(); |
| 76 | - $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']); |
|
| 76 | + $logger->debug('Run '.get_class($this).' job with ID '.$this->getId(), ['app' => 'cron']); |
|
| 77 | 77 | $this->run($this->argument); |
| 78 | 78 | $timeTaken = $this->time->getTime() - $jobStartTime; |
| 79 | 79 | |
| 80 | - $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']); |
|
| 80 | + $logger->debug('Finished '.get_class($this).' job with ID '.$this->getId().' in '.$timeTaken.' seconds', ['app' => 'cron']); |
|
| 81 | 81 | $jobList->setExecutionTime($this, $timeTaken); |
| 82 | 82 | } catch (\Exception $e) { |
| 83 | 83 | if ($logger) { |
| 84 | 84 | $logger->logException($e, [ |
| 85 | 85 | 'app' => 'core', |
| 86 | - 'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')' |
|
| 86 | + 'message' => 'Error while running background job (class: '.get_class($this).', arguments: '.print_r($this->argument, true).')' |
|
| 87 | 87 | ]); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -40,106 +40,106 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | abstract class Job implements IJob { |
| 42 | 42 | |
| 43 | - /** @var int $id */ |
|
| 44 | - protected $id; |
|
| 45 | - |
|
| 46 | - /** @var int $lastRun */ |
|
| 47 | - protected $lastRun; |
|
| 48 | - |
|
| 49 | - /** @var mixed $argument */ |
|
| 50 | - protected $argument; |
|
| 51 | - |
|
| 52 | - /** @var ITimeFactory */ |
|
| 53 | - protected $time; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @since 15.0.0 |
|
| 57 | - */ |
|
| 58 | - public function __construct(ITimeFactory $time) { |
|
| 59 | - $this->time = $time; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * The function to prepare the execution of the job. |
|
| 64 | - * |
|
| 65 | - * |
|
| 66 | - * @param IJobList $jobList |
|
| 67 | - * @param ILogger|null $logger |
|
| 68 | - * |
|
| 69 | - * @since 15.0.0 |
|
| 70 | - */ |
|
| 71 | - public function execute(IJobList $jobList, ILogger $logger = null) { |
|
| 72 | - $jobList->setLastRun($this); |
|
| 73 | - if ($logger === null) { |
|
| 74 | - $logger = \OC::$server->getLogger(); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - try { |
|
| 78 | - $jobStartTime = $this->time->getTime(); |
|
| 79 | - $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']); |
|
| 80 | - $this->run($this->argument); |
|
| 81 | - $timeTaken = $this->time->getTime() - $jobStartTime; |
|
| 82 | - |
|
| 83 | - $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']); |
|
| 84 | - $jobList->setExecutionTime($this, $timeTaken); |
|
| 85 | - } catch (\Exception $e) { |
|
| 86 | - if ($logger) { |
|
| 87 | - $logger->logException($e, [ |
|
| 88 | - 'app' => 'core', |
|
| 89 | - 'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')' |
|
| 90 | - ]); |
|
| 91 | - } |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * @since 15.0.0 |
|
| 97 | - */ |
|
| 98 | - final public function setId(int $id) { |
|
| 99 | - $this->id = $id; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @since 15.0.0 |
|
| 104 | - */ |
|
| 105 | - final public function setLastRun(int $lastRun) { |
|
| 106 | - $this->lastRun = $lastRun; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * @since 15.0.0 |
|
| 111 | - */ |
|
| 112 | - public function setArgument($argument) { |
|
| 113 | - $this->argument = $argument; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - /** |
|
| 117 | - * @since 15.0.0 |
|
| 118 | - */ |
|
| 119 | - final public function getId(): int { |
|
| 120 | - return $this->id; |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * @since 15.0.0 |
|
| 125 | - */ |
|
| 126 | - final public function getLastRun(): int { |
|
| 127 | - return $this->lastRun; |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * @since 15.0.0 |
|
| 132 | - */ |
|
| 133 | - public function getArgument() { |
|
| 134 | - return $this->argument; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * The actual function that is called to run the job |
|
| 139 | - * |
|
| 140 | - * @param $argument |
|
| 141 | - * |
|
| 142 | - * @since 15.0.0 |
|
| 143 | - */ |
|
| 144 | - abstract protected function run($argument); |
|
| 43 | + /** @var int $id */ |
|
| 44 | + protected $id; |
|
| 45 | + |
|
| 46 | + /** @var int $lastRun */ |
|
| 47 | + protected $lastRun; |
|
| 48 | + |
|
| 49 | + /** @var mixed $argument */ |
|
| 50 | + protected $argument; |
|
| 51 | + |
|
| 52 | + /** @var ITimeFactory */ |
|
| 53 | + protected $time; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @since 15.0.0 |
|
| 57 | + */ |
|
| 58 | + public function __construct(ITimeFactory $time) { |
|
| 59 | + $this->time = $time; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * The function to prepare the execution of the job. |
|
| 64 | + * |
|
| 65 | + * |
|
| 66 | + * @param IJobList $jobList |
|
| 67 | + * @param ILogger|null $logger |
|
| 68 | + * |
|
| 69 | + * @since 15.0.0 |
|
| 70 | + */ |
|
| 71 | + public function execute(IJobList $jobList, ILogger $logger = null) { |
|
| 72 | + $jobList->setLastRun($this); |
|
| 73 | + if ($logger === null) { |
|
| 74 | + $logger = \OC::$server->getLogger(); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + try { |
|
| 78 | + $jobStartTime = $this->time->getTime(); |
|
| 79 | + $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']); |
|
| 80 | + $this->run($this->argument); |
|
| 81 | + $timeTaken = $this->time->getTime() - $jobStartTime; |
|
| 82 | + |
|
| 83 | + $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']); |
|
| 84 | + $jobList->setExecutionTime($this, $timeTaken); |
|
| 85 | + } catch (\Exception $e) { |
|
| 86 | + if ($logger) { |
|
| 87 | + $logger->logException($e, [ |
|
| 88 | + 'app' => 'core', |
|
| 89 | + 'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')' |
|
| 90 | + ]); |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @since 15.0.0 |
|
| 97 | + */ |
|
| 98 | + final public function setId(int $id) { |
|
| 99 | + $this->id = $id; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @since 15.0.0 |
|
| 104 | + */ |
|
| 105 | + final public function setLastRun(int $lastRun) { |
|
| 106 | + $this->lastRun = $lastRun; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * @since 15.0.0 |
|
| 111 | + */ |
|
| 112 | + public function setArgument($argument) { |
|
| 113 | + $this->argument = $argument; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + /** |
|
| 117 | + * @since 15.0.0 |
|
| 118 | + */ |
|
| 119 | + final public function getId(): int { |
|
| 120 | + return $this->id; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * @since 15.0.0 |
|
| 125 | + */ |
|
| 126 | + final public function getLastRun(): int { |
|
| 127 | + return $this->lastRun; |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @since 15.0.0 |
|
| 132 | + */ |
|
| 133 | + public function getArgument() { |
|
| 134 | + return $this->argument; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * The actual function that is called to run the job |
|
| 139 | + * |
|
| 140 | + * @param $argument |
|
| 141 | + * |
|
| 142 | + * @since 15.0.0 |
|
| 143 | + */ |
|
| 144 | + abstract protected function run($argument); |
|
| 145 | 145 | } |
@@ -33,16 +33,16 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | abstract class QueuedJob extends Job { |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * run the job, then remove it from the joblist |
|
| 38 | - * |
|
| 39 | - * @param IJobList $jobList |
|
| 40 | - * @param ILogger|null $logger |
|
| 41 | - * |
|
| 42 | - * @since 15.0.0 |
|
| 43 | - */ |
|
| 44 | - final public function execute($jobList, ILogger $logger = null) { |
|
| 45 | - $jobList->remove($this, $this->argument); |
|
| 46 | - parent::execute($jobList, $logger); |
|
| 47 | - } |
|
| 36 | + /** |
|
| 37 | + * run the job, then remove it from the joblist |
|
| 38 | + * |
|
| 39 | + * @param IJobList $jobList |
|
| 40 | + * @param ILogger|null $logger |
|
| 41 | + * |
|
| 42 | + * @since 15.0.0 |
|
| 43 | + */ |
|
| 44 | + final public function execute($jobList, ILogger $logger = null) { |
|
| 45 | + $jobList->remove($this, $this->argument); |
|
| 46 | + parent::execute($jobList, $logger); |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -34,29 +34,29 @@ |
||
| 34 | 34 | * @since 15.0.0 |
| 35 | 35 | */ |
| 36 | 36 | abstract class TimedJob extends Job { |
| 37 | - /** @var int */ |
|
| 38 | - protected $interval = 0; |
|
| 37 | + /** @var int */ |
|
| 38 | + protected $interval = 0; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * set the interval for the job |
|
| 42 | - * |
|
| 43 | - * @since 15.0.0 |
|
| 44 | - */ |
|
| 45 | - public function setInterval(int $interval) { |
|
| 46 | - $this->interval = $interval; |
|
| 47 | - } |
|
| 40 | + /** |
|
| 41 | + * set the interval for the job |
|
| 42 | + * |
|
| 43 | + * @since 15.0.0 |
|
| 44 | + */ |
|
| 45 | + public function setInterval(int $interval) { |
|
| 46 | + $this->interval = $interval; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * run the job if the last run is is more than the interval ago |
|
| 51 | - * |
|
| 52 | - * @param JobList $jobList |
|
| 53 | - * @param ILogger|null $logger |
|
| 54 | - * |
|
| 55 | - * @since 15.0.0 |
|
| 56 | - */ |
|
| 57 | - final public function execute($jobList, ILogger $logger = null) { |
|
| 58 | - if (($this->time->getTime() - $this->lastRun) > $this->interval) { |
|
| 59 | - parent::execute($jobList, $logger); |
|
| 60 | - } |
|
| 61 | - } |
|
| 49 | + /** |
|
| 50 | + * run the job if the last run is is more than the interval ago |
|
| 51 | + * |
|
| 52 | + * @param JobList $jobList |
|
| 53 | + * @param ILogger|null $logger |
|
| 54 | + * |
|
| 55 | + * @since 15.0.0 |
|
| 56 | + */ |
|
| 57 | + final public function execute($jobList, ILogger $logger = null) { |
|
| 58 | + if (($this->time->getTime() - $this->lastRun) > $this->interval) { |
|
| 59 | + parent::execute($jobList, $logger); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | 62 | } |
@@ -24,33 +24,33 @@ |
||
| 24 | 24 | use OCP\IUser; |
| 25 | 25 | |
| 26 | 26 | interface ITrashManager extends ITrashBackend { |
| 27 | - /** |
|
| 28 | - * Add a backend for the trashbin |
|
| 29 | - * |
|
| 30 | - * @param string $storageType |
|
| 31 | - * @param ITrashBackend $backend |
|
| 32 | - * @since 15.0.0 |
|
| 33 | - */ |
|
| 34 | - public function registerBackend(string $storageType, ITrashBackend $backend); |
|
| 27 | + /** |
|
| 28 | + * Add a backend for the trashbin |
|
| 29 | + * |
|
| 30 | + * @param string $storageType |
|
| 31 | + * @param ITrashBackend $backend |
|
| 32 | + * @since 15.0.0 |
|
| 33 | + */ |
|
| 34 | + public function registerBackend(string $storageType, ITrashBackend $backend); |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * List all trash items in the root of the trashbin |
|
| 38 | - * |
|
| 39 | - * @param IUser $user |
|
| 40 | - * @return ITrashItem[] |
|
| 41 | - * @since 15.0.0 |
|
| 42 | - */ |
|
| 43 | - public function listTrashRoot(IUser $user): array; |
|
| 36 | + /** |
|
| 37 | + * List all trash items in the root of the trashbin |
|
| 38 | + * |
|
| 39 | + * @param IUser $user |
|
| 40 | + * @return ITrashItem[] |
|
| 41 | + * @since 15.0.0 |
|
| 42 | + */ |
|
| 43 | + public function listTrashRoot(IUser $user): array; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Temporally prevent files from being moved to the trash |
|
| 47 | - * |
|
| 48 | - * @since 15.0.0 |
|
| 49 | - */ |
|
| 50 | - public function pauseTrash(); |
|
| 45 | + /** |
|
| 46 | + * Temporally prevent files from being moved to the trash |
|
| 47 | + * |
|
| 48 | + * @since 15.0.0 |
|
| 49 | + */ |
|
| 50 | + public function pauseTrash(); |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @since 15.0.0 |
|
| 54 | - */ |
|
| 55 | - public function resumeTrash(); |
|
| 52 | + /** |
|
| 53 | + * @since 15.0.0 |
|
| 54 | + */ |
|
| 55 | + public function resumeTrash(); |
|
| 56 | 56 | } |
@@ -31,54 +31,54 @@ |
||
| 31 | 31 | * @since 15.0.0 |
| 32 | 32 | */ |
| 33 | 33 | interface ITrashBackend { |
| 34 | - /** |
|
| 35 | - * List all trash items in the root of the trashbin |
|
| 36 | - * |
|
| 37 | - * @param IUser $user |
|
| 38 | - * @return ITrashItem[] |
|
| 39 | - * @since 15.0.0 |
|
| 40 | - */ |
|
| 41 | - public function listTrashRoot(IUser $user): array; |
|
| 34 | + /** |
|
| 35 | + * List all trash items in the root of the trashbin |
|
| 36 | + * |
|
| 37 | + * @param IUser $user |
|
| 38 | + * @return ITrashItem[] |
|
| 39 | + * @since 15.0.0 |
|
| 40 | + */ |
|
| 41 | + public function listTrashRoot(IUser $user): array; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * List all trash items in a subfolder in the trashbin |
|
| 45 | - * |
|
| 46 | - * @param ITrashItem $folder |
|
| 47 | - * @return ITrashItem[] |
|
| 48 | - * @since 15.0.0 |
|
| 49 | - */ |
|
| 50 | - public function listTrashFolder(ITrashItem $folder): array; |
|
| 43 | + /** |
|
| 44 | + * List all trash items in a subfolder in the trashbin |
|
| 45 | + * |
|
| 46 | + * @param ITrashItem $folder |
|
| 47 | + * @return ITrashItem[] |
|
| 48 | + * @since 15.0.0 |
|
| 49 | + */ |
|
| 50 | + public function listTrashFolder(ITrashItem $folder): array; |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Restore a trashbin item |
|
| 54 | - * |
|
| 55 | - * @param ITrashItem $item |
|
| 56 | - * @since 15.0.0 |
|
| 57 | - */ |
|
| 58 | - public function restoreItem(ITrashItem $item); |
|
| 52 | + /** |
|
| 53 | + * Restore a trashbin item |
|
| 54 | + * |
|
| 55 | + * @param ITrashItem $item |
|
| 56 | + * @since 15.0.0 |
|
| 57 | + */ |
|
| 58 | + public function restoreItem(ITrashItem $item); |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Permanently remove an item from trash |
|
| 62 | - * |
|
| 63 | - * @param ITrashItem $item |
|
| 64 | - * @since 15.0.0 |
|
| 65 | - */ |
|
| 66 | - public function removeItem(ITrashItem $item); |
|
| 60 | + /** |
|
| 61 | + * Permanently remove an item from trash |
|
| 62 | + * |
|
| 63 | + * @param ITrashItem $item |
|
| 64 | + * @since 15.0.0 |
|
| 65 | + */ |
|
| 66 | + public function removeItem(ITrashItem $item); |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Move a file or folder to trash |
|
| 70 | - * |
|
| 71 | - * @param IStorage $storage |
|
| 72 | - * @param string $internalPath |
|
| 73 | - * @return boolean whether or not the file was moved to trash, if false then the file should be deleted normally |
|
| 74 | - * @since 15.0.0 |
|
| 75 | - */ |
|
| 76 | - public function moveToTrash(IStorage $storage, string $internalPath): bool; |
|
| 68 | + /** |
|
| 69 | + * Move a file or folder to trash |
|
| 70 | + * |
|
| 71 | + * @param IStorage $storage |
|
| 72 | + * @param string $internalPath |
|
| 73 | + * @return boolean whether or not the file was moved to trash, if false then the file should be deleted normally |
|
| 74 | + * @since 15.0.0 |
|
| 75 | + */ |
|
| 76 | + public function moveToTrash(IStorage $storage, string $internalPath): bool; |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * @param IUser $user |
|
| 80 | - * @param int $fileId |
|
| 81 | - * @return Node|null |
|
| 82 | - */ |
|
| 83 | - public function getTrashNodeById(IUser $user, int $fileId); |
|
| 78 | + /** |
|
| 79 | + * @param IUser $user |
|
| 80 | + * @param int $fileId |
|
| 81 | + * @return Node|null |
|
| 82 | + */ |
|
| 83 | + public function getTrashNodeById(IUser $user, int $fileId); |
|
| 84 | 84 | } |