Skip to content

Commit

Permalink
Use getChildren() in discovery
Browse files Browse the repository at this point in the history
and remove no longer needed findAddressbooks() from Account.
  • Loading branch information
mstilkerich committed Aug 4, 2020
1 parent 4f12894 commit 7fd23ee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 41 deletions.
2 changes: 1 addition & 1 deletion doc/Classes.drawio
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile host="Electron" modified="2020-08-03T16:45:35.244Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.5.7 Chrome/83.0.4103.122 Electron/9.1.2 Safari/537.36" etag="ymICywsOFp1MQma-mNPo" version="13.5.7" type="device"><diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">7V1Zk6LIFv41Rjg3ogwWQXgsraV7pmu6pqu3mZcbKaTKFJJcwNoe+rffTDaBPCJSglZJd0e0pJhofl+ePFue7MmT5dO1h9zFDTGx3ZME86knX/QkSVRFhf7HWp6jFkUdRQ1zzzLjm9YNd9YLjhuFuHVlmdjP3RgQYgeWm280iONgI8i1Ic8jj/nbZsTOP9VFc8w13BnI5lt/WGawiFo1abRu/4Ct+SJ5sqjq0TtLlNwc/xJ/gUzymGmSL3vyxCMkiF4tnybYZoOXjMuPj88/7E/36vXvf/n/Q9/Gf3z98/tZ1NnVLh9Jf4KHnaB21y/3s6sP34f//nRvr/56FK7Pp7+fnYlq1PcDslfxgMU/NnhORhA75jkDgl5NbWLc9+QxbYqRpjCHl1cWfZh8wa7ScQovAo/cpyMv0haPrBwTm/H72KRoxc/C9pQ8Xq4bxmEDfWNBPOuFOAGijxhXHIx40Hyy8oz4h6xG2Pv4z9PLH38snvShOn/yP0rxoAkB8uY47u/hv+SfiS/eXF8+f3ZunB/u8uzv5D72fTPEiof6GpMlDrxnesPjmmSiGn/IwzYKrIc8I1FM7Hn62bS7W2LR3yYJ8SSUlfgj8RSUR3K+i+hHxp/KUqDQ0bDQkTQqfJdoFLiOK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XisjVRzZHcYVHNStYgwccBVZGwnIXzD7r++F/13aeNnBvDvMoBN6TzjTS4+QIKuWechd3BCT1V2+/D8=</diagram></mxfile>
<mxfile host="Electron" modified="2020-08-04T14:02:59.431Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.5.7 Chrome/83.0.4103.122 Electron/9.1.2 Safari/537.36" etag="p--f10xwnU4nYMwv8Z2Q" version="13.5.7" type="device"><diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">7V1Zc6O4Fv41rvLcqrjYDY+xs3TPdKYznd5mXm7JINtMMOICTuI89G+/EpsBHRPiAE5iuruqjYyFre/T0dl0NJCnq4dLH3nLK2JhZyAJ1sNAPhtIkiIKEv2PtWziFtEQ1Lhl4dtW0rZtuLEfcdIoJK1r28JB4caQECe0vWKjSVwXm2GhDfk+uS/eNidO8akeWmCu4cZEDt/6w7bCZdyqS+Nt+wdsL5bpk0XNiN9ZofTm5JcES2SR+1yTfD6Qpz4hYfxq9TDFDhu9dFx+fNz8cD7dape//xX8D32b/PH1z+8ncWcXz/lI9hN87IZ7d/14O7/48F3596d3ffHXvXB5Ovv95ETU4r7vkLNOBiz5seEmHUHsWqcMCHo1c4h5O5AntClBmsIcXV7Y9GHyGbvKxim6CH1ym428SFt8snYtbCXvY4uilTwLOzNyf75tmEQN9I0l8e1H4oaIPmJSczCSQQvI2jeTH7IeY//jPw+Pf/yxfDAUbfEQfJSSQRNC5C9w0t/df8k/00C8ujzffHav3B/e6uTv9D72fXPESob6EpMVDv0NveF+SzJRSz7kYweF9l2RkSgh9iL7bNbdNbHpb5OEZBbKavKRZA7KY7nYRfwjk0/lKVDqSCl1JI1L3yUeBa4jCj/a5G7z2A3B7i+sy0LhOZokVH4vXSrdrzxxv1i6X1Ty99MX8TdOr3IAbZui6QFPFZAoCjdTvgW4arIQD7vFuULHa2KhYBmxn82FZbhykpf70xqc2ACtq+h/CFpLY3kkyMb2j1Ykp6bvx3KpxA55LNR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3JrpFrxcPmgwRPE28vdXGqk1fLsshlSZzpgD+AeenaG79KS0fmV6EytTuaoIWBMAKgWZHerxLqqYwBzvy/Y9Lbrk2oyrKAsAEayBpQlOWd8Vho1tqo90OJAbH+EaJ2qgtMhJfBwUBd/Dicn1hMh768vXE5X9GiIEdDA3KHFaW8t2KSs+nlO8l7nj/o7rUN+GAIZO5W4LYHhfUkXmRVLCKEV2V0WjHtwd4EIHcncLLnTCU7Z5uN8Tvieu4EncbQELL9S70udiYNl20R7cPcGFdvx3C+6uNZeCO0EBZlW3enT3RBfa+N+tTObrL2XoZttDhv2+370Rhvb4d4pwqtPxDj5y7zoEWalRlMtrPpaYclOGMrSfv9tpzCen/ooncVK84yiqdrQHMLR9v9tZDCUNyDHEvNXbz99nOro6VLJAeHkZnQu7TInjYBM+Hql31b9CV70hPu2ql+DqH3vtQX+lrno4rwOQY8frqa8UBi+KIbdU9Q/WPirs/z9rm4d95tOe8EMh5m6rSVW4CM5wiGynvEmup0CzFAAc991SQNslApIjcIKrtRPalzjscyBbpAHg4u+YBhWSYPoVLWp7knoK7EkBKBrQMQcqYnjM/1DXz9RTYF8KQInQ3VJg117peHNSiQX9Zuk2SACEFjomwa5wb5y+E5HgLldbpRcGrfAAOt23Wx7sCjGtPQtthUGctRURYluAp1cX2nYdAKGLjukBHQQhxw22BQmKfr1ogwhAiKM1IlTV5+Xy1Hv39xtzf2ulPVSqUnMPRLb76V24v+FsGkDYHa/7u1IOvMYtVOAXhkIaqb3LxIu/zaAppaFX1gp7R0tUMzh3uZUK/MYVjo2jzpVqBl7Ih90pvLucFqkLm2G8VUbqOLJ7jGs4qDvFGDjoKLY2UpC/YPbf0I/+O3fwqoe5ISd0QzjTS5+QMK+W+chbXhGL1V0+/z8=</diagram></mxfile>
2 changes: 1 addition & 1 deletion doc/Classes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions src/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,34 +210,6 @@ public function findAddressbookHome(string $principalUri): ?string

return $addressbookHomeUri;
}

/**
* Finds the addressbooks in an addressbook-home location.
*
* @param string $addressbookHomeUri The/An addressbook home URI of the principal.
* @return string[] An array of URIs of the found addressbooks.
*/
public function findAddressbooks(string $addressbookHomeUri): array
{
try {
$client = $this->getClient();
$abooks = $client->findProperties($addressbookHomeUri, [ XmlEN::RESTYPE ], "1");

$abooksResult = [];
foreach ($abooks as $abook) {
// RFC6352: An address book collection MUST report the DAV:collection and CARDDAV:addressbook XML
// elements in the value of the DAV:resourcetype property.
if (in_array(XmlEN::RESTYPE_ABOOK, $abook["props"][XmlEN::RESTYPE])) {
$abooksResult[] = $abook["uri"];
}
}
} catch (\Exception $e) {
Config::$logger->info("Exception while querying addressbooks: " . $e->getMessage());
$abooksResult = [];
}

return $abooksResult;
}
}

// vim: ts=4:sw=4:expandtab:fenc=utf8:ff=unix:tw=120
30 changes: 19 additions & 11 deletions src/Services/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace MStilkerich\CardDavClient\Services;

use MStilkerich\CardDavClient\{Account, AddressbookCollection, CardDavClient, Config};
use MStilkerich\CardDavClient\{Account, AddressbookCollection, CardDavClient, Config, WebDavCollection};

/**
* Class Discovery - Provides a service to discovery the addressbooks for a CardDAV account.
Expand Down Expand Up @@ -92,7 +92,7 @@ public function discoverAddressbooks(Account $account): array
// as a fallback, we will last try what the user provided
$servers[] = [ "host" => $host, "port" => $port, "scheme" => $protocol, "userinput" => true ];

$addressbooks = array();
$addressbooks = [];

// (2) Discover the "initial context path" for each servers (until first success)
foreach ($servers as $server) {
Expand All @@ -114,13 +114,21 @@ public function discoverAddressbooks(Account $account): array
// (4) Attempt a PROPFIND asking for the addressbook home of the user on the principal URI
$addressbookHomeUri = $account->findAddressbookHome($principalUri);
if (isset($addressbookHomeUri)) {
// (5) Attempt PROPFIND (Depth 1) to discover all addressbooks of the user
foreach ($account->findAddressbooks($addressbookHomeUri) as $davAbookUri) {
$addressbooks[] = new AddressbookCollection($davAbookUri, $account);
}

if (count($addressbooks) > 0) {
break 2;
try {
// (5) Attempt PROPFIND (Depth 1) to discover all addressbooks of the user
$addressbookHome = new WebDavCollection($addressbookHomeUri, $account);

foreach ($addressbookHome->getChildren() as $abookCandidate) {
if ($abookCandidate instanceof AddressbookCollection) {
$addressbooks[] = $abookCandidate;
}
}

if (count($addressbooks) > 0) {
break 2;
}
} catch (\Exception $e) {
Config::$logger->info("Exception while querying addressbooks: " . $e->getMessage());
}
}
}
Expand All @@ -144,7 +152,7 @@ public function discoverAddressbooks(Account $account): array
*/
private function discoverServers(string $host, bool $force_ssl): array
{
$servers = array();
$servers = [];

$rrnamesAndSchemes = [ ["_carddavs._tcp.$host", 'https'] ];
if ($force_ssl === false) {
Expand Down Expand Up @@ -206,7 +214,7 @@ private function discoverServers(string $host, bool $force_ssl): array
*/
private function discoverContextPath(array $server): array
{
$contextpaths = array();
$contextpaths = [];

if (key_exists("dnsrr", $server)) {
$dnsresults = dns_get_record($server["dnsrr"], DNS_TXT);
Expand Down

0 comments on commit 7fd23ee

Please sign in to comment.