Skip to content

Commit 3025391

Browse files
committed
Merge branch 'master' of github.com:fruux/sabre-dav
2 parents 045bee6 + 7239902 commit 3025391

File tree

116 files changed

+2971
-2009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2971
-2009
lines changed

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ php:
33
- 5.5
44
- 5.6
55
- 7
6-
- hhvm
7-
8-
matrix:
9-
allow_failures:
10-
- php: hhvm
116

127
env:
138
matrix:
@@ -16,15 +11,21 @@ env:
1611

1712
services:
1813
- mysql
14+
- postgresql
1915

2016
sudo: false
2117

2218
before_script:
23-
- mysql -e 'create database sabredav'
19+
- mysql -e 'create database sabredav_test'
20+
- psql -c "create database sabredav_test" -U postgres
21+
- psql -c "create user sabredav with PASSWORD 'sabredav';GRANT ALL PRIVILEGES ON DATABASE sabredav_test TO sabredav" -U postgres
2422
- phpenv config-rm xdebug.ini; true
2523
# - composer self-update
2624
- composer update --prefer-dist $LOWEST_DEPS
2725

26+
# addons:
27+
# postgresql: "9.5"
28+
2829
script:
2930
- ./bin/phpunit --configuration tests/phpunit.xml.dist $TEST_DEPS
3031
- ./bin/sabre-cs-fixer fix lib/ --dry-run --diff

CHANGELOG.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
ChangeLog
22
=========
33

4-
3.2.0-alpha1 (????-??-??)
4+
3.2.0-alpha2 (2016-??-??)
5+
-------------------------
6+
7+
* #833: Calendars throw exceptions when the sharing plugin is not enabled.
8+
9+
10+
3.2.0-alpha1 (2016-05-09)
511
-------------------------
612

713
* Database changes for CalDAV. If you are using the CalDAV PDO backends, you
@@ -11,29 +17,66 @@ ChangeLog
1117
others to their calendar and give them read/read-write access!
1218
* #397: Support for PSR-3. You can now log exceptions with your favourite
1319
psr3-compatible logging tool.
20+
* #825: Actual proper, tested support for PostgreSQL. We require version 9.5.
1421
* Removed database migration script for sabre/dav 1.7. To update from that
1522
version you now first need to update to sabre/dav 3.1.
1623
* Removed deprecated function: `Sabre\DAV\Auth\Plugin::getCurrentUser()`.
1724
* #774: Fixes for getting free disk space on Windows.
1825
* #803: Major changes in the sharing API. If you were using an old sabre/dav
1926
sharing api, head to the website for more detailed migration notes.
27+
* #657: Support for optional auth using `{DAV:}unauthorized` and `{DAV:}all`
28+
privileges. This allows you to assign a privilege to a resource, allowing
29+
non-authenticated users to access it. For instance, this could allow you
30+
to create a public read-only collection.
31+
* #812 #814: ICS/VCF exporter now includes a more useful filename in its
32+
`Content-Disposition` header. (@Xenopathic).
2033
* #801: BC break: If you were using the `Href` object before, it's behavior
2134
now changed a bit, and `LocalHref` was added to replace the old, default
2235
behavior of `Href`. See the migration doc for more info.
36+
* Removed `Sabre\DAVACL\Plugin::$allowAccessToNodesWithoutACL` setting.
37+
Instead, you can provide a set of default ACL rules with
38+
`Sabre\DAVACL\Plugin::setDefaultAcl()`.
39+
* Introduced `Sabre\DAVACL\ACLTrait` which contains a default implementation
40+
of `Sabre\DAV\IACL` with some sane defaults. We're using this trait all over
41+
the place now, reducing the amount of boilerplate.
42+
* Plugins can now control the "Supported Privilege Set".
2343
* Added Sharing, ICSExport and VCFExport plugins to `groupwareserver.php`
2444
example.
45+
* The `{DAV:}all` privilege is now no longer abstract, so it can be assigned
46+
directly. We're using the `{DAV:}all` privilege now in a lot of cases where
47+
we before assigned both `{DAV:}read` and `{DAV:}write`.
48+
* Resources that are not collections no longer support the `{DAV:}bind` and
49+
`{DAV:}unbind` privileges.
50+
* Corrected the CalDAV-scheduling related privileges.
51+
* Doing an `UNLOCK` no longer requires the `{DAV:}write-content` privilege.
2552
* Added a new `getPrincipalByUri` plugin event. Allowing plugins to request
2653
quickly where a principal lives on a server.
2754
* Renamed `phpunit.xml` to `phpunit.xml.dist` to make local modifications easy.
2855
* Functionality from `IShareableCalendar` is merged into `ISharedCalendar`.
2956
* #751: Fixed XML responses from failing `MKCOL` requests.
57+
* #600: Support for `principal-match` ACL `REPORT`.
58+
* #599: Support for `acl-principal-prop-set` ACL `REPORT`.
59+
* #798: Added an index on `firstoccurence` field in MySQL CalDAV backend. This
60+
should speed up common calendar-query requests.
61+
* #759: DAV\Client is now able to actually correctly resolve relative urls.
62+
* #671: We are no longer checking the `read-free-busy` privilege on individual
63+
calendars during freebusy operations in the scheduling plugin. Instead, we
64+
check the `schedule-query-freebusy` privilege on the target users' inbox,
65+
which validates access for the entire account, per the spec.
66+
* The zip release ships with [sabre/vobject 4.1.0][vobj],
67+
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
68+
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml].
3069

31-
3.1.3 (????-??-??)
70+
71+
3.1.3 (2016-04-06)
3272
------------------
3373

3474
* Set minimum libxml version to 2.7.0 in `composer.json`.
3575
* #805: It wasn't possible to create calendars that hold events, journals and
3676
todos using MySQL, because the `components` column was 1 byte too small.
77+
* The zip release ships with [sabre/vobject 4.1.0][vobj],
78+
[sabre/http 4.2.1][http], [sabre/event 3.0.0][evnt],
79+
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml].
3780

3881

3982
3.1.2 (2016-03-12)
@@ -124,13 +167,16 @@ ChangeLog
124167
[sabre/uri 1.0.1][uri] and [sabre/xml 1.1.0][xml].
125168

126169

127-
3.0.9 (????-??-??)
170+
3.0.9 (2016-04-06)
128171
------------------
129172

130173
* Set minimum libxml version to 2.7.0 in `composer.json`.
131174
* #727: Added another workaround to make CalDAV work for Windows 10 clients.
132175
* #805: It wasn't possible to create calendars that hold events, journals and
133176
todos using MySQL, because the `components` column was 1 byte too small.
177+
* The zip release ships with [sabre/vobject 3.5.1][vobj],
178+
[sabre/http 4.2.1][http], [sabre/event 2.0.2][evnt],
179+
[sabre/uri 1.1.0][uri] and [sabre/xml 1.4.1][xml].
134180

135181

136182
3.0.8 (2016-03-12)

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Build status
2424
| 1.7 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=1.7)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.3 |
2525
| 1.6 | [![Build Status](https://travis-ci.org/fruux/sabre-dav.svg?branch=1.6)](https://travis-ci.org/fruux/sabre-dav) | PHP 5.3 |
2626

27+
Documentation
28+
-------------
29+
30+
* [Introduction](http://sabre.io/dav/).
31+
* [Installation](http://sabre.io/dav/install/).
32+
2733
Made at fruux
2834
-------------
2935

bin/build.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function test() {
110110

111111
echo " Running all unittests.\n";
112112
echo " This may take a while.\n\n";
113-
system(__DIR__ . '/phpunit --configuration ' . $baseDir . '/tests/phpunit.xml --stop-on-failure', $code);
113+
system(__DIR__ . '/phpunit --configuration ' . $baseDir . '/tests/phpunit.xml.dist --stop-on-failure', $code);
114114
if ($code != 0) {
115115
echo "PHPUnit reported error code $code\n";
116116
die(1);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php": ">=5.5.0",
1818
"sabre/vobject": "^4.1.0",
1919
"sabre/event" : ">=2.0.0, <4.0.0",
20-
"sabre/xml" : "^1.3.0",
20+
"sabre/xml" : "^1.4.0",
2121
"sabre/http" : "^4.2.1",
2222
"sabre/uri" : "^1.0.1",
2323
"ext-dom": "*",

examples/sql/mysql.calendars.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ CREATE TABLE calendarobjects (
1010
firstoccurence INT(11) UNSIGNED,
1111
lastoccurence INT(11) UNSIGNED,
1212
uid VARBINARY(200),
13-
UNIQUE(calendarid, uri)
13+
UNIQUE(calendarid, uri),
14+
INDEX calendarid_time (calendarid, firstoccurence)
1415
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
1516

1617
CREATE TABLE calendars (
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CREATE UNIQUE INDEX addressbooks_ukey
1616
CREATE TABLE cards (
1717
id SERIAL NOT NULL,
1818
addressbookid INTEGER NOT NULL,
19-
carddata TEXT,
19+
carddata BYTEA,
2020
uri VARCHAR(200),
2121
lastmodified INTEGER,
2222
etag VARCHAR(32),
@@ -29,10 +29,6 @@ ALTER TABLE ONLY cards
2929
CREATE UNIQUE INDEX cards_ukey
3030
ON cards USING btree (addressbookid, uri);
3131

32-
ALTER TABLE ONLY cards
33-
ADD CONSTRAINT cards_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
34-
ON DELETE CASCADE;
35-
3632
CREATE TABLE addressbookchanges (
3733
id SERIAL NOT NULL,
3834
uri VARCHAR(200) NOT NULL,
@@ -46,7 +42,3 @@ ALTER TABLE ONLY addressbookchanges
4642

4743
CREATE INDEX addressbookchanges_addressbookid_synctoken_ix
4844
ON addressbookchanges USING btree (addressbookid, synctoken);
49-
50-
ALTER TABLE ONLY addressbookchanges
51-
ADD CONSTRAINT addressbookchanges_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
52-
ON DELETE CASCADE;

examples/sql/pgsql.calendars.sql

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
1-
CREATE TABLE calendars (
2-
id SERIAL NOT NULL,
3-
principaluri VARCHAR(100),
4-
displayname VARCHAR(100),
5-
uri VARCHAR(200),
6-
synctoken INTEGER NOT NULL DEFAULT 1,
7-
description TEXT,
8-
calendarorder INTEGER NOT NULL DEFAULT 0,
9-
calendarcolor VARCHAR(10),
10-
timezone TEXT,
11-
components VARCHAR(20),
12-
uid VARCHAR(200),
13-
transparent SMALLINT NOT NULL DEFAULT '0'
14-
);
15-
16-
ALTER TABLE ONLY calendars
17-
ADD CONSTRAINT calendars_pkey PRIMARY KEY (id);
18-
19-
CREATE UNIQUE INDEX calendars_ukey
20-
ON calendars USING btree (principaluri, uri);
21-
221
CREATE TABLE calendarobjects (
232
id SERIAL NOT NULL,
24-
calendardata TEXT,
3+
calendardata BYTEA,
254
uri VARCHAR(200),
265
calendarid INTEGER NOT NULL,
276
lastmodified INTEGER,
@@ -39,9 +18,46 @@ ALTER TABLE ONLY calendarobjects
3918
CREATE UNIQUE INDEX calendarobjects_ukey
4019
ON calendarobjects USING btree (calendarid, uri);
4120

42-
ALTER TABLE ONLY calendarobjects
43-
ADD CONSTRAINT calendarobjects_calendarid_fkey FOREIGN KEY (calendarid) REFERENCES calendars(id)
44-
ON DELETE CASCADE;
21+
22+
CREATE TABLE calendars (
23+
id SERIAL NOT NULL,
24+
synctoken INTEGER NOT NULL DEFAULT 1,
25+
components VARCHAR(21)
26+
);
27+
28+
ALTER TABLE ONLY calendars
29+
ADD CONSTRAINT calendars_pkey PRIMARY KEY (id);
30+
31+
32+
CREATE TABLE calendarinstances (
33+
id SERIAL NOT NULL,
34+
calendarid INTEGER NOT NULL,
35+
principaluri VARCHAR(100),
36+
access SMALLINT NOT NULL DEFAULT '1', -- '1 = owner, 2 = read, 3 = readwrite'
37+
displayname VARCHAR(100),
38+
uri VARCHAR(200),
39+
description TEXT,
40+
calendarorder INTEGER NOT NULL DEFAULT 0,
41+
calendarcolor VARCHAR(10),
42+
timezone TEXT,
43+
transparent SMALLINT NOT NULL DEFAULT '0',
44+
share_href VARCHAR(100),
45+
share_displayname VARCHAR(100),
46+
share_invitestatus SMALLINT NOT NULL DEFAULT '2' -- '1 = noresponse, 2 = accepted, 3 = declined, 4 = invalid'
47+
);
48+
49+
ALTER TABLE ONLY calendarinstances
50+
ADD CONSTRAINT calendarinstances_pkey PRIMARY KEY (id);
51+
52+
CREATE UNIQUE INDEX calendarinstances_principaluri_uri
53+
ON calendarinstances USING btree (principaluri, uri);
54+
55+
56+
CREATE UNIQUE INDEX calendarinstances_principaluri_calendarid
57+
ON calendarinstances USING btree (principaluri, calendarid);
58+
59+
CREATE UNIQUE INDEX calendarinstances_principaluri_share_href
60+
ON calendarinstances USING btree (principaluri, share_href);
4561

4662
CREATE TABLE calendarsubscriptions (
4763
id SERIAL NOT NULL,
@@ -78,10 +94,6 @@ ALTER TABLE ONLY calendarchanges
7894
CREATE INDEX calendarchanges_calendarid_synctoken_ix
7995
ON calendarchanges USING btree (calendarid, synctoken);
8096

81-
ALTER TABLE ONLY calendarchanges
82-
ADD CONSTRAINT calendarchanges_calendar_fk FOREIGN KEY (calendarid) REFERENCES calendars(id)
83-
ON DELETE CASCADE;
84-
8597
CREATE TABLE schedulingobjects (
8698
id SERIAL NOT NULL,
8799
principaluri VARCHAR(255),

examples/sql/pgsql.principals.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ ALTER TABLE ONLY groupmembers
2323
CREATE UNIQUE INDEX groupmembers_ukey
2424
ON groupmembers USING btree (principal_id, member_id);
2525

26-
ALTER TABLE ONLY groupmembers
27-
ADD CONSTRAINT groupmembers_principal_id_fkey FOREIGN KEY (principal_id) REFERENCES principals(id)
28-
ON DELETE CASCADE;
29-
30-
ALTER TABLE ONLY groupmembers
31-
ADD CONSTRAINT groupmembers_member_id_id_fkey FOREIGN KEY (member_id) REFERENCES principals(id)
32-
ON DELETE CASCADE;
33-
3426
INSERT INTO principals (uri,email,displayname) VALUES
3527
('principals/admin', 'admin@example.org','Administrator'),
3628
('principals/admin/calendar-proxy-read', null, null),

0 commit comments

Comments
 (0)