Overview

Packages

  • awl
    • caldav-client-v2
    • RRule
  • davical
    • authentication
      • drivers
    • caldav
    • DAViCalSession
    • DAVTicket
    • external-bind
    • feed
    • HTTPAuthSession
    • iSchedule
    • iSchedule-POST
    • logging
    • metrics
    • Principal
    • propfind
    • PublicSession
    • Request
    • Resource
    • tzservice
  • None

Classes

  • DAVResource
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class DAVResource

A class for things to do with a DAV Resource

Direct known subclasses

WritableCollection
Package: davical\Resource
Copyright: Morphoss Ltd
License: GNU GPL v3 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at DAVResource.php
Methods summary
public
# __construct( mixed $parameters = null )

Constructor

Constructor

Parameters

$parameters

If null, an empty Resourced is created. If it is an object then it is expected to be a record that was read elsewhere.

public
# FromRow( object $row )

Initialise from a database row

Initialise from a database row

Parameters

$row
The row from the DB.
public
# FromPath( object $inpath )

Initialise from a path

Initialise from a path

Parameters

$inpath
The path to populate the resource data from
protected
# FetchCollection( )

Find the collection associated with this resource.

Find the collection associated with this resource.

protected
# FetchPrincipal( )

Find the principal associated with this resource.

Find the principal associated with this resource.

protected
# FetchResource( )

Retrieve the actual resource.

Retrieve the actual resource.

protected
# FetchDeadProperties( )

Fetch any dead properties for this URL

Fetch any dead properties for this URL

public static
# BuildDeadPropertyXML( $property_name, $raw_string )

FIXME: does this function return a string or an array, or either? It used to be string only, but b4fd9e2e changed successfully parsed values to array. However values not in angle brackets are passed through, and those seem to be the majority in my database?!

FIXME: does this function return a string or an array, or either? It used to be string only, but b4fd9e2e changed successfully parsed values to array. However values not in angle brackets are passed through, and those seem to be the majority in my database?!

protected
# FetchPrivileges( )

Build permissions for this URL

Build permissions for this URL

public
# GetParentContainer( )

Get a DAVResource which is the parent to this resource.

Get a DAVResource which is the parent to this resource.

public
# FetchParentContainer( )

Fetch the parent to this resource. This is deprecated - use GetParentContainer() instead.

Fetch the parent to this resource. This is deprecated - use GetParentContainer() instead.

Deprecated

public
# Privileges( )

Return the privileges bits for the current session user to this resource

Return the privileges bits for the current session user to this resource

public boolean
# HavePrivilegeTo( $do_what, $any = null )

Does the user have the privileges to do what is requested.

Does the user have the privileges to do what is requested.

Parameters

$do_what
The request privilege name, or array of privilege names, to be checked.
$any
Whether we accept any of the privileges. The default is true, unless the requested privilege is 'all', when it is false.

Returns

boolean
Whether they do have one of those privileges against this resource.
public
# NeedPrivilege( string $privilege, boolean $any = null )

Check if we have the needed privilege or send an error response. If the user does not have the privileges then the call will not return, and an XML error document will be output.

Check if we have the needed privilege or send an error response. If the user does not have the privileges then the call will not return, and an XML error document will be output.

Parameters

$privilege
The name of the needed privilege.
$any
Whether we accept any of the privileges. The default is true, unless the requested privilege is 'all', when it is false.
public
# BuildPrivileges( $privilege_names = null, & $xmldoc = null )

Returns the array of privilege names converted into XMLElements

Returns the array of privilege names converted into XMLElements

public
# FetchSupportedMethods( )

Returns the array of supported methods

Returns the array of supported methods

public
# BuildSupportedMethods( )

Returns the array of supported methods converted into XMLElements

Returns the array of supported methods converted into XMLElements

public
# FetchSupportedReports( )

Returns the array of supported reports

Returns the array of supported reports

public
# BuildSupportedReports( & $reply )

Returns the array of supported reports converted into XMLElements

Returns the array of supported reports converted into XMLElements

public
# FetchTickets( )

Fetches an array of the access_ticket records applying to this path

Fetches an array of the access_ticket records applying to this path

public XMLTreeFragment
# BuildTicketinfo( &XMLDocument & $reply )

Returns the array of tickets converted into XMLElements

Returns the array of tickets converted into XMLElements

If the current user does not have DAV::read-acl privilege on this resource they will only get to see the tickets where they are the owner, or which they supplied along with the request.

Parameters

$reply
A reference to the XMLDocument used to construct the reply

Returns

XMLTreeFragment
A fragment of an XMLDocument to go in the reply
public
# IsLocked( $depth = 0 )

Checks whether the resource is locked, returning any lock token, or false

Checks whether the resource is locked, returning any lock token, or false

Todo

This logic does not catch all locking scenarios. For example an infinite depth request should check the permissions for all collections and resources within that. At present we only maintain permissions on a per-collection basis though.


public
# IsCollection( )

Checks whether this resource is a collection

Checks whether this resource is a collection

public
# IsPrincipal( )

Checks whether this resource is a principal

Checks whether this resource is a principal

public
# IsCalendar( )

Checks whether this resource is a calendar

Checks whether this resource is a calendar

public
# IsSchedulingCollection( string $type = 'any' )

Checks whether this resource is a scheduling inbox/outbox collection

Checks whether this resource is a scheduling inbox/outbox collection

Parameters

$type
The type of scheduling collection, 'inbox', 'outbox' or 'any'
public
# IsInSchedulingCollection( string $type = 'any' )

Checks whether this resource is IN a scheduling inbox/outbox collection

Checks whether this resource is IN a scheduling inbox/outbox collection

Parameters

$type
The type of scheduling collection, 'inbox', 'outbox' or 'any'
public
# IsAddressbook( )

Checks whether this resource is an addressbook

Checks whether this resource is an addressbook

public
# IsBinding( )

Checks whether this resource is a bind to another resource

Checks whether this resource is a bind to another resource

public
# IsExternal( )

Checks whether this resource is a bind to an external resource

Checks whether this resource is a bind to an external resource

public
# Exists( )

Checks whether this resource actually exists, in the virtual sense, within the hierarchy

Checks whether this resource actually exists, in the virtual sense, within the hierarchy

public
# ContainerExists( )

Checks whether the container for this resource actually exists, in the virtual sense, within the hierarchy

Checks whether the container for this resource actually exists, in the virtual sense, within the hierarchy

public
# url( )

Returns the URL of our resource

Returns the URL of our resource

public
# dav_name( )

Returns the dav_name of the resource in our internal namespace

Returns the dav_name of the resource in our internal namespace

public
# bound_from( )

Returns the dav_name of the resource we are bound to, within our internal namespace

Returns the dav_name of the resource we are bound to, within our internal namespace

public
# set_bind_location( $new_dav_name )

Sets the dav_name of the resource we are bound as

Sets the dav_name of the resource we are bound as

public
# parent_path( )

Returns the dav_name of the resource in our internal namespace

Returns the dav_name of the resource in our internal namespace

public
# principal_url( )

Returns the principal-URL for this resource

Returns the principal-URL for this resource

public
# user_no( )

Returns the internal user_no for the principal for this resource

Returns the internal user_no for the principal for this resource

public
# collection_id( )

Returns the internal collection_id for this collection, or the collection containing this resource

Returns the internal collection_id for this collection, or the collection containing this resource

public
# resource( )

Returns the database row for this resource

Returns the database row for this resource

public
# unique_tag( )

Returns the unique_tag (ETag or getctag) for this resource

Returns the unique_tag (ETag or getctag) for this resource

public
# resource_id( )

Returns the definitive resource_id for this resource - usually a dav_id

Returns the definitive resource_id for this resource - usually a dav_id

public
# sync_token( $cachedOK = true )

Returns the current sync_token for this collection, or the containing collection

Returns the current sync_token for this collection, or the containing collection

public
# IsPublic( )

Checks whether the target collection is publicly_readable

Checks whether the target collection is publicly_readable

public
# IsPublicOnly( )

Checks whether the target collection is for public events only

Checks whether the target collection is for public events only

public
# ContainerType( )

Return the type of whatever contains this resource, or would if it existed.

Return the type of whatever contains this resource, or would if it existed.

public
# BuildACE( & $xmldoc, $privs, $principal )

BuildACE - construct an XMLElement subtree for a DAV::ace

BuildACE - construct an XMLElement subtree for a DAV::ace

public
# GetACL( & $xmldoc )

Return ACL settings

Return ACL settings

public
# GetProperty( $name )

Return general server-related properties, in plain form

Return general server-related properties, in plain form

public
# DAV_AllProperties( )

Return an array which is an expansion of the DAV::allprop

Return an array which is an expansion of the DAV::allprop

public
# ResourceProperty( $tag, $prop, & $reply, & $denied )

Return general server-related properties for this URL

Return general server-related properties for this URL

public string
# GetPropStat( array $properties, & $reply, $props_only = false )

Construct XML propstat fragment for this resource

Construct XML propstat fragment for this resource

Parameters

$properties
string $properties The requested properties for this resource
$reply
$props_only

Returns

string
An XML fragment with the requested properties for this resource
public string
# RenderAsXML( array $properties, reference & $reply, $bound_parent_path = null )

Render XML for this resource

Render XML for this resource

Parameters

$properties
The requested properties for this principal
$reply
A reference to the XMLDocument being used for the reply
$bound_parent_path

Returns

string
An XML fragment with the requested properties for this principal
Properties summary
protected The $dav_name

partial URL of the resource within our namespace, which this resource is being retrieved as

partial URL of the resource within our namespace, which this resource is being retrieved as

#
protected Boolean: $exists

does the resource actually exist yet?

does the resource actually exist yet?

#
protected The $unique_tag

unique etag associated with the current version of the resource

unique etag associated with the current version of the resource

#
protected The $resource

actual resource content, if it exists and is not a collection

actual resource content, if it exists and is not a collection

#
protected The $parent

parent of the resource, which will always be a collection

parent of the resource, which will always be a collection

#
protected The $resourcetypes

types of the resource, possibly multiple

types of the resource, possibly multiple

#
protected The $contenttype

type of the content

type of the content

#
protected The $bound_from

canonical name which this resource exists at

canonical name which this resource exists at

#
DAViCal API documentation generated by ApiGen