migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\EventDispatcher;
use JsonSerializable;
/**
* @since 18.0.0
*/
abstract class ABroadcastedEvent extends Event implements JsonSerializable {
/**
* @since 18.0.0
*/
private $broadcasted = false;
/**
* Get the name of the event, as received on the client-side
*
* Uses the fully qualified event class name by default
*
* @return string
* @since 18.0.0
*/
public function broadcastAs(): string {
return get_class($this);
}
/**
* @return string[]
* @since 18.0.0
*/
abstract public function getUids(): array;
/**
* @since 18.0.0
*/
public function setBroadcasted(): void {
$this->broadcasted = true;
}
/**
* @since 18.0.0
*/
public function isBroadcasted(): bool {
return $this->broadcasted;
}
}
@@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\EventDispatcher;
use Psr\EventDispatcher\StoppableEventInterface;
/**
* Base event class for the event dispatcher service
*
* Typically this class isn't instantiated directly but sub classed for specific
* event types
*
* This class extended \Symfony\Contracts\EventDispatcher\Event until 21.0, since
* 22.0.0 this class directly implements the PSR StoppableEventInterface and no
* longer relies on Symfony. This transition does not come with any changes in API,
* the class has the same methods and behavior before and after this change.
*
* @since 17.0.0
*/
class Event implements StoppableEventInterface {
/**
* @var bool
*
* @since 22.0.0
*/
private $propagationStopped = false;
/**
* Compatibility constructor
*
* In Nextcloud 17.0.0 this event class used a now deprecated/removed Symfony base
* class that had a constructor (with default arguments). To lower the risk of
* a breaking change (PHP won't allow parent constructor calls if there is none),
* this empty constructor's only purpose is to hopefully not break existing sub-
* classes of this class.
*
* @since 18.0.0
*/
public function __construct() {
}
/**
* Stops the propagation of the event to further event listeners
*
* @return void
*
* @since 22.0.0
*/
public function stopPropagation(): void {
$this->propagationStopped = true;
}
/**
* {@inheritDoc}
*
* @since 22.0.0
* @see \Psr\EventDispatcher\StoppableEventInterface
*/
public function isPropagationStopped(): bool {
return $this->propagationStopped;
}
}
@@ -0,0 +1,189 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\EventDispatcher;
use ArrayAccess;
use ArrayIterator;
use InvalidArgumentException;
use IteratorAggregate;
use Traversable;
use function array_key_exists;
/**
* Class GenericEvent
*
* convenience reimplementation of \Symfony\Component\GenericEvent against
* \OCP\EventDispatcher\Event
*
* @since 18.0.0
* @deprecated 22.0.0 use \OCP\EventDispatcher\Event
*/
class GenericEvent extends Event implements ArrayAccess, IteratorAggregate {
/** @deprecated 22.0.0 */
protected $subject;
/** @deprecated 22.0.0 */
protected $arguments;
/**
* Encapsulate an event with $subject and $args.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function __construct($subject = null, array $arguments = []) {
parent::__construct();
$this->subject = $subject;
$this->arguments = $arguments;
}
/**
* Getter for subject property.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function getSubject() {
return $this->subject;
}
/**
* Get argument by key.
*
* @throws InvalidArgumentException if key is not found
* @since 18.0.0
* @deprecated 22.0.0
*/
public function getArgument(string $key) {
if ($this->hasArgument($key)) {
return $this->arguments[$key];
}
throw new InvalidArgumentException(sprintf('Argument "%s" not found.', $key));
}
/**
* Add argument to event.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function setArgument($key, $value): GenericEvent {
$this->arguments[$key] = $value;
return $this;
}
/**
* Getter for all arguments.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function getArguments(): array {
return $this->arguments;
}
/**
* Set args property.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function setArguments(array $args = []): GenericEvent {
$this->arguments = $args;
return $this;
}
/**
* Has argument.
*
* @since 18.0.0
* @deprecated 22.0.0
*/
public function hasArgument($key): bool {
return array_key_exists($key, $this->arguments);
}
/**
* Retrieve an external iterator
*
* @link https://php.net/manual/en/iteratoraggregate.getiterator.php
* @since 18.0.0
* @deprecated 22.0.0
*/
public function getIterator(): Traversable {
return new ArrayIterator($this->arguments);
}
/**
* Whether a offset exists
*
* @link https://php.net/manual/en/arrayaccess.offsetexists.php
* @since 18.0.0
* @deprecated 22.0.0
*/
public function offsetExists($offset): bool {
return $this->hasArgument($offset);
}
/**
* Offset to retrieve
*
* @link https://php.net/manual/en/arrayaccess.offsetget.php
* @since 18.0.0
* @deprecated 22.0.0
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset) {
return $this->arguments[$offset];
}
/**
* Offset to set
*
* @link https://php.net/manual/en/arrayaccess.offsetset.php
* @since 18.0.0
* @deprecated 22.0.0
*/
public function offsetSet($offset, $value): void {
$this->setArgument($offset, $value);
}
/**
* Offset to unset
*
* @link https://php.net/manual/en/arrayaccess.offsetunset.php
* @since 18.0.0
* @deprecated 22.0.0
*/
public function offsetUnset($offset): void {
if ($this->hasArgument($offset)) {
unset($this->arguments[$offset]);
}
}
}
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\EventDispatcher;
/**
* Event dispatcher service of Nextcloud
*
* @since 17.0.0
*/
interface IEventDispatcher {
/**
* @template T of \OCP\EventDispatcher\Event
* @param string $eventName preferably the fully-qualified class name of the Event sub class
* @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class
* @param callable $listener the object that is invoked when a matching event is dispatched
* @psalm-param callable(T):void $listener
* @param int $priority The higher this value, the earlier an event
* listener will be triggered in the chain (defaults to 0)
*
* @since 17.0.0
*/
public function addListener(string $eventName, callable $listener, int $priority = 0): void;
/**
* @template T of \OCP\EventDispatcher\Event
* @param string $eventName preferably the fully-qualified class name of the Event sub class
* @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class
* @param callable $listener the object that is invoked when a matching event is dispatched
* @psalm-param callable(T):void $listener
*
* @since 19.0.0
*/
public function removeListener(string $eventName, callable $listener): void;
/**
* @template T of \OCP\EventDispatcher\Event
* @param string $eventName preferably the fully-qualified class name of the Event sub class to listen for
* @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class to listen for
* @param string $className fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container
* @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $className fully qualified class name that can be built by the DI container
* @param int $priority The higher this value, the earlier an event
* listener will be triggered in the chain (defaults to 0)
*
* @since 17.0.0
*/
public function addServiceListener(string $eventName, string $className, int $priority = 0): void;
/**
* @template T of \OCP\EventDispatcher\Event
* @param string $eventName
* @psalm-param string|class-string<T> $eventName
* @param Event $event
* @psalm-param T $event
*
* @since 17.0.0
* @deprecated 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
*/
public function dispatch(string $eventName, Event $event): void;
/**
* Dispatch a typed event
*
* Only use this with subclasses of ``\OCP\EventDispatcher\Event``.
* The object's class will determine the event name.
*
* @param Event $event
*
* @since 18.0.0
*/
public function dispatchTyped(Event $event): void;
}
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\EventDispatcher;
/**
* @since 17.0.0
*
* @template T of Event
*/
interface IEventListener {
/**
* @param Event $event
* @psalm-param T $event
*
* @since 17.0.0
*/
public function handle(Event $event): void;
}