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,283 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @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 OCA\Circles\Model\Probes;
use OCA\Circles\IQueryProbe;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Federated\RemoteInstance;
use OCA\Circles\Model\Member;
/**
* Class BasicProbe
*
* @package OCA\Circles\Model\Probes
*/
class BasicProbe implements IQueryProbe {
public const DETAILS_NONE = 0;
public const DETAILS_POPULATION = 32;
public const DETAILS_ALL = 127;
/** @var int */
private $itemsOffset = 0;
/** @var int */
private $itemsLimit = -1;
/** @var int */
private $details = 0;
/** @var Circle */
private $filterCircle;
/** @var Member */
private $filterMember;
/** @var RemoteInstance */
private $filterRemoteInstance;
/** @var array */
private $options = [];
/**
* @param int $itemsOffset
*
* @return BasicProbe
*/
public function setItemsOffset(int $itemsOffset): self {
$this->itemsOffset = $itemsOffset;
return $this;
}
/**
* @return int
*/
public function getItemsOffset(): int {
return $this->itemsOffset;
}
/**
* @param int $itemsLimit
*
* @return BasicProbe
*/
public function setItemsLimit(int $itemsLimit): self {
$this->itemsLimit = $itemsLimit;
return $this;
}
/**
* @return int
*/
public function getItemsLimit(): int {
return $this->itemsLimit;
}
/**
* @param int $details
*
* @return $this
*/
public function setDetails(int $details): self {
$this->details = $details;
}
/**
* @return int
*/
public function getDetails(): int {
return $this->details;
}
/**
* @param int $detail
*
* @return $this
*/
public function addDetail(int $detail): self {
$this->details |= $detail;
return $this;
}
/**
* @param int $detail
*
* @return bool
*/
public function showDetail(int $detail): bool {
return (($this->getDetails() & $detail) !== 0);
}
/**
* @param Circle $filterCircle
*
* @return CircleProbe
*/
public function setFilterCircle(Circle $filterCircle): self {
$this->filterCircle = $filterCircle;
return $this;
}
/**
* @return Circle
*/
public function getFilterCircle(): Circle {
return $this->filterCircle;
}
/**
* @return bool
*/
public function hasFilterCircle(): bool {
return !is_null($this->filterCircle);
}
/**
* @param Member $filterMember
*
* @return CircleProbe
*/
public function setFilterMember(Member $filterMember): self {
$this->filterMember = $filterMember;
return $this;
}
/**
* @return Member
*/
public function getFilterMember(): Member {
return $this->filterMember;
}
/**
* @return bool
*/
public function hasFilterMember(): bool {
return !is_null($this->filterMember);
}
/**
* @param RemoteInstance $filterRemoteInstance
*
* @return CircleProbe
*/
public function setFilterRemoteInstance(RemoteInstance $filterRemoteInstance): self {
$this->filterRemoteInstance = $filterRemoteInstance;
return $this;
}
/**
* @return RemoteInstance
*/
public function getFilterRemoteInstance(): RemoteInstance {
return $this->filterRemoteInstance;
}
/**
* @return bool
*/
public function hasFilterRemoteInstance(): bool {
return !is_null($this->filterRemoteInstance);
}
/**
* @param string $key
* @param string $value
*
* @return $this
*/
public function addOption(string $key, string $value): self {
$this->options[$key] = $value;
return $this;
}
/**
* @param string $key
* @param int $value
*
* @return $this
*/
public function addOptionInt(string $key, int $value): self {
$this->options[$key] = $value;
return $this;
}
/**
* @param string $key
* @param bool $value
*
* @return $this
*/
public function addOptionBool(string $key, bool $value): self {
$this->options[$key] = $value;
return $this;
}
/**
* @return array
*/
public function getAsOptions(): array {
return array_merge(
$this->options,
[
'offset' => $this->getItemsOffset(),
'limit' => $this->getItemsLimit(),
'details' => $this->getDetails(),
'detailsAll' => ($this->getDetails() === self::DETAILS_ALL)
]
);
}
/**
* @return array
*/
public function JsonSerialize(): array {
return $this->getAsOptions();
}
}
@@ -0,0 +1,399 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @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 OCA\Circles\Model\Probes;
use OCA\Circles\Model\Circle;
/**
* Class CircleProbe
*
* @package OCA\Circles\Model\Probes
*/
class CircleProbe extends MemberProbe {
private int $include = 0;
private int $filter = Circle::CFG_SINGLE;
private bool $includeNonVisible = false;
private bool $visitSingleCircles = false;
private int $limitConfig = 0;
/**
* CircleProbe constructor.
*/
public function __construct() {
}
/**
* Configure whether personal circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includePersonalCircles(bool $include = true): self {
if ($include) {
$this->include |= Circle::CFG_PERSONAL;
} else {
$this->include &= ~Circle::CFG_PERSONAL;
}
return $this;
}
/**
* Configure whether single circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includeSingleCircles(bool $include = true): self {
if ($include) {
$this->include |= Circle::CFG_SINGLE;
} else {
$this->include &= ~Circle::CFG_SINGLE;
}
return $this;
}
/**
* Configure whether system circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includeSystemCircles(bool $include = true): self {
if ($include) {
$this->include |= Circle::CFG_SYSTEM;
} else {
$this->include &= ~Circle::CFG_SYSTEM;
}
return $this;
}
/**
* Configure whether hidden circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includeHiddenCircles(bool $include = true): self {
if ($include) {
$this->include |= Circle::CFG_HIDDEN;
} else {
$this->include &= ~Circle::CFG_HIDDEN;
}
return $this;
}
/**
* Configure whether backend circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includeBackendCircles(bool $include = true): self {
if ($include) {
$this->include |= Circle::CFG_BACKEND;
} else {
$this->include &= ~Circle::CFG_BACKEND;
}
return $this;
}
/**
* Configure whether non-visible circles are included in the probe
*
* @param bool $include
*
* @return $this
*/
public function includeNonVisibleCircles(bool $include = true): self {
$this->includeNonVisible = $include;
return $this;
}
/**
* Return whether non-visible circles are included in the probe
*
* @return bool
*/
public function nonVisibleCirclesIncluded(): bool {
return $this->includeNonVisible;
}
/**
* Configure whether single circles are visited in the probe
*
* @param bool $visit
*
* @return $this
*/
public function visitSingleCircles(bool $visit = true): self {
$this->visitSingleCircles = $visit;
return $this;
}
/**
* Return whether single circles are visited in the probe
*
* @return bool
*/
public function visitingSingleCircles(): bool {
return $this->visitSingleCircles;
}
/**
* Return the include value
*
* @return int
*/
public function included(): int {
return $this->include;
}
/**
* Return whether a config is included in the probe (bitwise comparison)
*
* @param int $config
*
* @return bool
*/
public function isIncluded(int $config): bool {
return (($this->included() & $config) !== 0);
}
/**
* limit to a specific config
*
* @param int $config
*
* @return $this
*/
public function limitConfig(int $config = 0): self {
$this->limitConfig = $config;
return $this;
}
public function hasLimitConfig(): bool {
return ($this->limitConfig > 0);
}
public function getLimitConfig(): int {
return $this->limitConfig;
}
/**
* Configure whether personal circles are filtered in the probe
*
* @param bool $filter
*
* @return $this
*/
public function filterPersonalCircles(bool $filter = true): self {
if ($filter) {
$this->filter |= Circle::CFG_PERSONAL;
} else {
$this->filter &= ~Circle::CFG_PERSONAL;
}
return $this;
}
/**
* Configure whether single circles are filtered in the probe
*
* @param bool $filter
*
* @return $this
*/
public function filterSingleCircles(bool $filter = true): self {
if ($filter) {
$this->filter |= Circle::CFG_SINGLE;
} else {
$this->filter &= ~Circle::CFG_SINGLE;
}
return $this;
}
/**
* Configure whether system circles are filtered in the probe
*
* @param bool $filter
*
* @return $this
*/
public function filterSystemCircles(bool $filter = true): self {
if ($filter) {
$this->filter |= Circle::CFG_SYSTEM;
} else {
$this->filter &= ~Circle::CFG_SYSTEM;
}
return $this;
}
/**
* Configure whether hidden circles are filtered in the probe
*
* @param bool $filter
*
* @return $this
*/
public function filterHiddenCircles(bool $filter = true): self {
if ($filter) {
$this->filter |= Circle::CFG_HIDDEN;
} else {
$this->filter &= ~Circle::CFG_HIDDEN;
}
return $this;
}
/**
* Configure whether backend circles are filtered in the probe
*
* @param bool $filter
*
* @return $this
*/
public function filterBackendCircles(bool $filter = true): self {
if ($filter) {
$this->filter |= Circle::CFG_BACKEND;
} else {
$this->filter &= ~Circle::CFG_BACKEND;
}
return $this;
}
/**
* Add a config to the probe filter
*
* @param int $config
* @param bool $filter
*
* @return $this
*/
public function filterConfig(int $config, bool $filter = true): self {
if ($filter) {
$this->filter |= $config;
} else {
$this->filter &= ~$config;
}
return $this;
}
/**
* Return the filtered value
*
* @return int
*/
public function filtered(): int {
return $this->filter;
}
/**
* Return whether a config is filtered in the probe (bitwise comparison)
*
* @param int $config
*
* @return bool
*/
public function isFiltered(int $config): bool {
return (($this->filtered() & $config) !== 0);
}
/**
* Return an array with includes as options
*
* @return array
*/
public function getAsOptions(): array {
return array_merge(
[
'included' => $this->included(),
'includeHiddenCircles' => $this->isIncluded(Circle::CFG_HIDDEN),
'includeSingleCircles' => $this->isIncluded(Circle::CFG_SINGLE),
'includeBackendCircles' => $this->isIncluded(Circle::CFG_BACKEND),
'includeSystemCircles' => $this->isIncluded(Circle::CFG_SYSTEM),
'includePersonalCircles' => $this->isIncluded(Circle::CFG_PERSONAL),
'includeNonVisibleCircles' => $this->nonVisibleCirclesIncluded(),
'visitingSingleCircles' => $this->visitingSingleCircles(),
'limitConfig' => $this->getLimitConfig(),
'filtered' => $this->included(),
'filterHiddenCircles' => $this->isIncluded(Circle::CFG_HIDDEN),
'filterSingleCircles' => $this->isIncluded(Circle::CFG_SINGLE),
'filterBackendCircles' => $this->isIncluded(Circle::CFG_BACKEND),
'filterSystemCircles' => $this->isIncluded(Circle::CFG_SYSTEM),
'filterPersonalCircles' => $this->isIncluded(Circle::CFG_PERSONAL),
],
parent::getAsOptions()
);
}
/**
* @return string
*/
public function getChecksum(): string {
return md5(json_encode($this->getAsOptions()));
}
/**
* Return a JSON object with includes as options
*
* @return array
*/
public function JsonSerialize(): array {
return $this->getAsOptions();
}
}
@@ -0,0 +1,111 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2022
* @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 OCA\Circles\Model\Probes;
use OCA\Circles\Db\CoreQueryBuilder;
/**
* Class CircleProbe
*
* @package OCA\Circles\Model\Probes
*/
class DataProbe extends BasicProbe {
public const OWNER = CoreQueryBuilder::OWNER;
public const MEMBER = CoreQueryBuilder::MEMBER;
public const BASED_ON = CoreQueryBuilder::BASED_ON;
public const MEMBERSHIPS = CoreQueryBuilder::MEMBERSHIPS;
public const CONFIG = CoreQueryBuilder::CONFIG;
public const INITIATOR = CoreQueryBuilder::INITIATOR;
public const INHERITED_BY = CoreQueryBuilder::INHERITED_BY;
private array $path = [];
public function __construct() {
}
/**
* @param string $key
* @param array $path
*
* @return $this
*/
public function add(string $key, array $path = []): self {
$this->path[$key] = $path;
return $this;
}
/**
* @param string $key
*
* @return bool
*/
public function has(string $key): bool {
return (array_key_exists($key, $this->path));
}
/**
* @return array
*/
public function getPath(): array {
return $this->path;
}
/**
* Return an array with includes as options
*
* @return array
*/
public function getAsOptions(): array {
return array_merge(
[
'path' => $this->getPath()
],
parent::getAsOptions()
);
}
/**
* Return a JSON object with includes as options
*
* @return array
*/
public function JsonSerialize(): array {
return $this->getAsOptions();
}
}
@@ -0,0 +1,173 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @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 OCA\Circles\Model\Probes;
use OCA\Circles\Model\Member;
/**
* Class MemberProbe
*
* @package OCA\Circles\Model\Probes
*/
class MemberProbe extends BasicProbe {
private int $minimumLevel = Member::LEVEL_NONE;
private bool $emulateVisitor = false;
private bool $requestingMembership = false;
private bool $initiatorDirectMember = false;
/**
* allow the initiator as a requesting member
*
* @param bool $can
*
* @return $this
*/
public function canBeRequestingMembership(bool $can = true): self {
$this->requestingMembership = $can;
return $this;
}
/**
* @return bool
*/
public function isRequestingMembership(): bool {
return $this->requestingMembership;
}
/**
* @param bool $include
*
* @return $this
*/
public function initiatorAsDirectMember(bool $include = true): self {
$this->initiatorDirectMember = $include;
return $this;
}
/**
* @return bool
*/
public function directMemberInitiator(): bool {
return $this->initiatorDirectMember;
}
/**
* force the generation an initiator if visitor
*
* @return $this
*/
public function emulateVisitor(): self {
$this->emulateVisitor = true;
return $this;
}
public function isEmulatingVisitor(): bool {
return $this->emulateVisitor;
}
/**
* @return int
*/
public function getMinimumLevel(): int {
return $this->minimumLevel;
}
/**
* @return $this
*/
public function mustBeMember(bool $must = true): self {
if ($must) {
$this->minimumLevel = Member::LEVEL_MEMBER;
} else {
$this->minimumLevel = Member::LEVEL_NONE;
}
return $this;
}
/**
* @return $this
*/
public function mustBeModerator(): self {
$this->minimumLevel = Member::LEVEL_MODERATOR;
return $this;
}
/**
* @return $this
*/
public function mustBeAdmin(): self {
$this->minimumLevel = Member::LEVEL_ADMIN;
return $this;
}
/**
* @return $this
*/
public function mustBeOwner(): self {
$this->minimumLevel = Member::LEVEL_OWNER;
return $this;
}
/**
* @return array
*/
public function getAsOptions(): array {
return array_merge(
[
'minimumLevel' => $this->getMinimumLevel(),
'emulateVisitor' => $this->isEmulatingVisitor(),
'allowRequestingMembership' => $this->isRequestingMembership(),
'initiatorDirectMember' => $this->directMemberInitiator(),
],
parent::getAsOptions()
);
}
/**
* @return array
*/
public function JsonSerialize(): array {
return $this->getAsOptions();
}
}