public function propFindEarly(DAV\PropFind $propFind, DAV\INode $node)
    {
        $ns = '{'.self::NS_CARDDAV.'}';

        if ($node instanceof IAddressBook) {
            $propFind->handle($ns.'max-resource-size', $this->maxResourceSize);
            $propFind->handle($ns.'supported-address-data', function () {
                return new Xml\Property\SupportedAddressData();
            });
            $propFind->handle($ns.'supported-collation-set', function () {
                return new Xml\Property\SupportedCollationSet();
            });
        }
        if ($node instanceof DAVACL\IPrincipal) {
            $path = $propFind->getPath();

            $propFind->handle('{'.self::NS_CARDDAV.'}addressbook-home-set', function () use ($path) {
                return new LocalHref($this->getAddressBookHomeForPrincipal($path).'/');
            });

            if ($this->directories) {
                $propFind->handle('{'.self::NS_CARDDAV.'}directory-gateway', function () {
                    return new LocalHref($this->directories);
                });
            }
        }

        if ($node instanceof ICard) {
            // The address-data property is not supposed to be a 'real'
            // property, but in large chunks of the spec it does act as such.
            // Therefore we simply expose it as a property.
            $propFind->handle('{'.self::NS_CARDDAV.'}address-data', function () use ($node) {
                $val = $node->get();
                if (is_resource($val)) {
                    $val = stream_get_contents($val);
                }

                return $val;
            });
        }
    }
public function propFindEarly(DAV\PropFind $propFind, DAV\INode $node)
    {
        $ns = '{'.self::NS_CARDDAV.'}';

        if ($node instanceof IAddressBook) {
            $propFind->handle($ns.'max-resource-size', $this->maxResourceSize);
            $propFind->handle($ns.'supported-address-data', function () {
                return new Xml\Property\SupportedAddressData();
            });
            $propFind->handle($ns.'supported-collation-set', function () {
                return new Xml\Property\SupportedCollationSet();
            });
        }
        if ($node instanceof DAVACL\IPrincipal) {
            $path = $propFind->getPath();

            $propFind->handle('{'.self::NS_CARDDAV.'}addressbook-home-set', function () use ($path) {
                return new LocalHref($this->getAddressBookHomeForPrincipal($path).'/');
            });

            if ($this->directories) {
                $propFind->handle('{'.self::NS_CARDDAV.'}directory-gateway', function () {
                    return new LocalHref($this->directories);
                });
            }
        }

        if ($node instanceof ICard) {
            // The address-data property is not supposed to be a 'real'
            // property, but in large chunks of the spec it does act as such.
            // Therefore we simply expose it as a property.
            $propFind->handle('{'.self::NS_CARDDAV.'}address-data', function () use ($node) {
                $val = $node->get();
                if (is_resource($val)) {
                    $val = stream_get_contents($val);
                }

                return $val;
            });
        }
    }
public function propFindEarly ( DAV \ PropFind $ propFind , DAV \ INode $ node ) { $ ns = '{' . self :: NS_CARDDAV . '}' ; if ( $ node instanceof IAddressBook ) { $ propFind -> handle ( $ ns . 'max-resource-size' , $ this -> maxResourceSize ) ; $ propFind -> handle ( $ ns . 'supported-address-data' , function ( ) { return new Xml \ Property \ SupportedAddressData ( ) ; } ) ; $ propFind -> handle ( $ ns . 'supported-collation-set' , function ( ) { return new Xml \ Property \ SupportedCollationSet ( ) ; } ) ; } if ( $ node instanceof DAVACL \ IPrincipal ) { $ path = $ propFind -> getPath ( ) ; $ propFind -> handle ( '{' . self :: NS_CARDDAV . '}addressbook-home-set' , function ( ) use ( $ path ) { return new LocalHref ( $ this -> getAddressBookHomeForPrincipal ( $ path ) . '/' ) ; } ) ; if ( $ this -> directories ) { $ propFind -> handle ( '{' . self :: NS_CARDDAV . '}directory-gateway' , function ( ) { return new LocalHref ( $ this -> directories ) ; } ) ; } } if ( $ node instanceof ICard ) { // The address-data property is not supposed to be a 'real' // property, but in large chunks of the spec it does act as such. // Therefore we simply expose it as a property. $ propFind -> handle ( '{' . self :: NS_CARDDAV . '}address-data' , function ( ) use ( $ node ) { $ val = $ node -> get ( ) ; if ( is_resource ( $ val ) ) { $ val = stream_get_contents ( $ val ) ; } return $ val ; } ) ; } }
Adds all CardDAV-specific properties.

@param DAV\PropFind $propFind
@param DAV\INode    $node
Adds all CardDAV - specific properties .