XCloner – Backup and Restore - Version 4.1.3

Version Description

  • database include tables fix
Download this release

Release Info

Developer watchful
Plugin Icon 128x128 XCloner – Backup and Restore
Version 4.1.3
Comparing to
See all releases

Code changes from version 4.1.2 to 4.1.3

Files changed (41) hide show
  1. README.md +0 -65
  2. README.txt +41 -37
  3. includes/class-xcloner-database.php +8 -6
  4. vendor/sabre/dav/examples/addressbookserver.php +57 -0
  5. vendor/sabre/dav/examples/calendarserver.php +80 -0
  6. vendor/sabre/dav/examples/fileserver.php +56 -0
  7. vendor/sabre/dav/examples/groupwareserver.php +101 -0
  8. vendor/sabre/dav/examples/minimal.php +20 -0
  9. vendor/sabre/dav/examples/sql/mysql.addressbooks.sql +28 -0
  10. vendor/sabre/dav/examples/sql/mysql.calendars.sql +76 -0
  11. vendor/sabre/dav/examples/sql/mysql.locks.sql +12 -0
  12. vendor/sabre/dav/examples/sql/mysql.principals.sql +20 -0
  13. vendor/sabre/dav/examples/sql/mysql.propertystorage.sql +9 -0
  14. vendor/sabre/dav/examples/sql/mysql.users.sql +9 -0
  15. vendor/sabre/dav/examples/sql/pgsql.addressbooks.sql +44 -0
  16. vendor/sabre/dav/examples/sql/pgsql.calendars.sql +105 -0
  17. vendor/sabre/dav/examples/sql/pgsql.locks.sql +19 -0
  18. vendor/sabre/dav/examples/sql/pgsql.principals.sql +30 -0
  19. vendor/sabre/dav/examples/sql/pgsql.propertystorage.sql +13 -0
  20. vendor/sabre/dav/examples/sql/pgsql.users.sql +14 -0
  21. vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql +28 -0
  22. vendor/sabre/dav/examples/sql/sqlite.calendars.sql +76 -0
  23. vendor/sabre/dav/examples/sql/sqlite.locks.sql +12 -0
  24. vendor/sabre/dav/examples/sql/sqlite.principals.sql +20 -0
  25. vendor/sabre/dav/examples/sql/sqlite.propertystorage.sql +10 -0
  26. vendor/sabre/dav/examples/sql/sqlite.users.sql +9 -0
  27. vendor/sabre/dav/examples/webserver/apache2_htaccess.conf +16 -0
  28. vendor/sabre/dav/examples/webserver/apache2_vhost.conf +29 -0
  29. vendor/sabre/dav/examples/webserver/apache2_vhost_cgi.conf +21 -0
  30. vendor/sabre/vobject/.php_cs.dist +12 -0
  31. vendor/sabre/vobject/bin/bench.php +12 -0
  32. vendor/sabre/vobject/bin/bench_freebusygenerator.php +53 -0
  33. vendor/sabre/vobject/bin/bench_manipulatevcard.php +64 -0
  34. vendor/sabre/vobject/bin/fetch_windows_zones.php +49 -0
  35. vendor/sabre/vobject/bin/generate_vcards +241 -0
  36. vendor/sabre/vobject/bin/generateicalendardata.php +87 -0
  37. vendor/sabre/vobject/bin/mergeduplicates.php +0 -0
  38. vendor/sabre/vobject/bin/rrulebench.php +32 -0
  39. vendor/sabre/vobject/bin/vobject +27 -0
  40. vendor/sabre/vobject/phpstan.neon +3 -0
  41. xcloner.php +5 -5
README.md DELETED
@@ -1,65 +0,0 @@
1
- # XCloner Wordpress Plugin - Backup and Restore
2
-
3
- [![Author](http://img.shields.io/badge/author-@thinkovi-blue.svg?style=flat-square)](https://twitter.com/thinkovi)
4
- [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat-square)](LICENSE.txt)
5
- [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ovidiul/XCloner-Wordpress/badges/quality-score.png?b=dev)](https://scrutinizer-ci.com/g/ovidiul/XCloner-Wordpress/?branch=master)
6
- [![Build Status](https://scrutinizer-ci.com/g/ovidiul/XCloner-Wordpress/badges/build.png?b=dev)](https://scrutinizer-ci.com/g/ovidiul/XCloner-Wordpress/build-status/master)
7
-
8
- Backup your Wordpress site, restore to any web location, send your backups to Dropbox, Amazon S3, Azure, FTP, SFTP and many others with XCloner backup plugin.
9
-
10
-
11
- XCloner is a Backup and Restore plugin that is perfectly integrated with Wordpress.
12
-
13
- XCloner design was specifically created to Generate custom backups of any LAMP website through custom admin inputs, and to be able to Restore the clone on any other location with the help of the automatic Restore script we provide!
14
-
15
- XCloner Backup tool uses Open Source standards like TAR, Mysql and CSV formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.
16
-
17
- ## Features
18
-
19
- * Backup and Restore your Wordpress site easily
20
- * Create compressed and uncompressed backups using TAR open source format
21
- * Create encrypted backups archives with AES-128-CBC algorithm
22
- * Create automated backups from your Scheduled Backups Section
23
- * Received email notifications of created backups
24
- * Generate automatic backups based on cronjobs, it can run daily, weekly, monthly or even hourly
25
- * Restore your backups on any other location, XCloner will attempt to extract the backup archive files for you, as well as import the mysql dump and update the Wordpress config details
26
- * Upload your backups to Remote Storage locations supporting FTP, SFTP, Dropbox, AWS, Azure Blob and many more to come
27
- * Watch every step of XCloner through it's built in debugger
28
- * Althrough we have optimized XCloner to run properly on most hosts, we give Developers options to customize it's running speed and avoid backup timeouts, all from the XCloner Config-> System Options
29
- * Ability to split backups into multiple smaller parts if a certain size limit is reached
30
-
31
- ## Installation
32
-
33
- 1. Upload the plugin directory to wp-content/plugins directory
34
- 2. Activate the plugin
35
- 3. Access the plugin Dashboard from the Admin Sidebar -> Site Backup Menu
36
-
37
- ## UPGRADE
38
-
39
- You can do it easily from the Wordpress backend.
40
-
41
- ## Frequently Asked Questions
42
-
43
- <b>Where does XCloner keep it's database backups?</b>
44
-
45
- XCloner stores them in separate mysql dump files, inside a folder called xcloner-XXXXX inside the backup archive root path, where XXXXX is a hash number that is identical with the last 5 characters of the backup name,
46
- so if the backup name is backup_localhost-2017-02-16_15-36-sql-1c6c6.tgz , the mysql backup file will be stored in xcloner-1c6c6/ folder.
47
-
48
- <b>How do I restore my backup?</b>
49
-
50
- XCloner provide an easy to use restore script available in the Site Backup -> Restore Backups menu, the process is being described there as well.
51
-
52
- If the XCloner Restore option fails, you can manually restore your backup as follows:
53
-
54
- 1. extract the backup archive files to your new location
55
- 2. locate the xcloner-XXXXX folder inside your backup root folder, and look for the mysql backup in database-sql and import it through phpmyadmin
56
- 3. update your wp-config.php file to reflect the new mysql details
57
-
58
- <b>How do I know which files were include in the backup?</b>
59
-
60
- The XCloner Manager Backups Panel provides an easy utility to view each backup content files list. It also stores a copy of the archived backup files inside the xcloner-XXXXX/backup_files.csv file in an easy to read CSV format.
61
-
62
- <b>Do you have a log for the created backup?</b>
63
-
64
- Yes, if XCloner Logger option is enabled, it will store a log file inside the xcloner-XXXXX folder inside the backup archive, file is named xcloner-xxxxx.log
65
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.txt CHANGED
@@ -1,55 +1,60 @@
1
- === XCloner - Backup and Restore===
2
- Contributors: xcloner
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AAPE8PLAE554S
4
- Tags: backup plugin, restore plugin, database backup, backup encryption, site backup, website cloner, wordpress backup, database restore, webdav, azure, ftp, sftp, amazon s3, dropbox, google drive, differential backup
5
  Requires at least: 3.0.1
6
- Tested up to: 5.3
7
- Stable tag: 4.1.2
8
 
9
- Backup your site, restore to any web location, encrypt and send your backups to Dropbox, Amazon S3, Azure, FTP, SFTP, WebDAV, Google Drive with XCloner plugin.
10
 
11
  == Description ==
12
 
13
- XCloner is a Backup and Restore plugin that is perfectly integrated with Wordpress. It is able to create complete and differentials backups of your site, manually or automatically through the built-in scheduler.
14
 
15
- [youtube http://www.youtube.com/watch?v=V9iWpPyG1EE]
16
 
17
- XCloner design was specifically created to Generate custom backups of any Wordpress website through custom admin inputs, and to be able to Restore the backup on any other location with the help of the automatic Restore script we provide!
18
 
19
- XCloner Backup tool uses Open Source standards like TAR, Mysql and CSV formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.
 
20
 
21
- Project is actively maintained through github https://github.com/ovidiul/XCloner-Wordpress/ , all issues can be reported here https://github.com/ovidiul/XCloner-Wordpress/issues .
22
 
23
- <strong>Requirements:</strong>
24
 
25
- PHP 5.6+ with mod CURL installed
26
 
27
- <strong>Features:</strong>
 
28
 
29
- * Backup and Restore your Wordpress site easily
30
- * Create compressed and uncompressed backups using TAR open source format
31
- * Create encrypted backups archives with AES-128-CBC algorithm
32
- * Create automated backups from your Scheduled Backups Section
33
- * Received email notifications of created backups
34
- * Generate automatic backups based on cronjobs, it can run daily, weekly, monthly or even hourly
35
- * Restore your backups locally or to a remote location, XCloner will attempt to extract the backup archive files for you, as well as import the mysql dump and update the Wordpress config details
36
- * Upload your backups to Remote Storage locations supporting FTP, SFTP, Dropbox, AWS, Azure Blob, Backblaze, WebDAV, Google Drive and many more to come
37
- * Watch every step of XCloner through it's built in debugger
38
- * Althrough we have optimized XCloner to run properly on most hosts, we give Developers options to customize it's running speed and avoid backup timeouts, all from the XCloner Config-> System Options
39
- * Ability to split backups into multiple smaller parts if a certain size limit is reached
40
- * Generate Differential Backups so your backup will include only files modified after a certain date, giving you the option to decrease the total backup space disk usage
41
- * Generate automatic backups before a Wordpress automatic update
42
- * GDPR compliant by added encryption data
 
 
43
 
44
  == Installation ==
45
 
46
- 1. Upload the plugin directory to wp-content/plugins directory
47
- 2. Activate the plugin
48
- 3. Access the plugin Dashboard from the Admin Sidebar -> Site Backup Menu
 
49
 
50
  UPGRADE:
51
 
52
- You can do it easily from the Wordpress backend.
53
 
54
  == Frequently Asked Questions ==
55
 
@@ -108,12 +113,11 @@ Of course, schedules can be adjusted accordingly to how often you update your si
108
  10. Generate Backup Process
109
  11. Generate Backup Screen
110
 
111
- == DONORS ==
112
-
113
- Immigration Attorney Montana <a href="https://www.immigrationlawofmt.com" target='_blank'>https://www.immigrationlawofmt.com</a>
114
-
115
  == Changelog ==
116
 
 
 
 
117
  = 4.1.2 =
118
  * improved default backup storage path security
119
  * improved remote storage security
1
+ === Backup, Restore and Migrate WordPress Sites With the XCloner Plugin ===
2
+ Contributors: watchful,ovidiul
3
+ Donate link: http://www.xcloner.com
4
+ Tags: backup, database backup, cloud backup, WordPress backup, WordPress migration
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.4
7
+ Stable tag: 4.1.3
8
 
9
+ XCloner is a backup plugin that allows you to safely back up and restore your WordPress sites. You can send site backups to SFTP, Dropbox, Amazon, Google Drive, Backblaze and other locations.
10
 
11
  == Description ==
12
 
13
+ [XCloner](https://www.xcloner.com) is a backup plugin that allows you to safely back up and restore your WordPress sites. You can send your site backups to SFTP, Dropbox, Amazon, Google Drive, Backblaze and other locations. You can create backups manually or automatically with XCloner’s built-in scheduler.
14
 
15
+ XCloner enables you to automatically generate backups with the built-in cron script. These cron jobs can run daily, weekly, monthly or even hourly.
16
 
17
+ XCloner allows you to generate custom backups of any WordPress site, and then restore the backup on any other location with the help of the automatic restore script we provide!
18
 
19
+ XCloner has many useful safety features. For example, XCloner will generate a core, plugins, themes or languages files backup before the automatic update of WordPress core, plugins, themes or languages files.
20
+ = Remote Storage for WordPress Backups =
21
 
22
+ XCloner allows you to send your backups to remote storage locations supporting FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure and many more to come
23
 
24
+ You can generate “Differential Backups” so your backup will include only files modified after a certain date. This can decrease the space needed to store your backups.
25
 
26
+ XCloner also has safety features to make sure your backups are successful. One example: you have the ability to split backups into multiple smaller parts if a certain size limit is reached. Another example: XCloner can also store a local copy of the backup that it will then delete when the backup has been sent to the remote location.
27
 
28
+ = Secure, GDPR Compliant WordPress Backups =
29
+ XCloner is the best backup choice for people who care about security and privacy.
30
 
31
+ XCloner uses open source standards like TAR, MySQL and CSV formats so you can be sure that your backups can be restored in a variety of ways, giving you more flexibility and full control.
32
+
33
+ XCloner has a built-in security layer to protect your backups. You can create encrypted backup archives with AES-128-CBC algorithm. This encryption helps to ensure that your data is still GDPR compliant even if the backup fails.
34
+
35
+ = Restore Backups Anywhere =
36
+
37
+ You can restore backups on any location compatible with your website by using the XCloner restore feature. Your site clone can be restored on a totally different server, with new server and MySQL details.
38
+
39
+ XCloner will attempt to extract the backup archive files for you, as well as import the MySQL dump and update your WordPress configuration details.
40
+
41
+ The restore script is located inside the XCloner archive, in the /restore/ directory. XCloner can restore your original file and directory permissions. XCloner can also automatically update the new host settings to the configuration file.
42
+
43
+ XCloner has a variety of restoration options including: All Files, Only Plugins Files, Only Theme Files, Only Uploads Files, and Only Database Backup.
44
+
45
+ = XCloner works best with the Watchful dashboard =
46
+ [Watchful](https://watchful.net) is a web developers toolbox for remotely managing and monitoring multiple WordPress websites. Simply add all your production and staging sites into the Watchful Dashboard and use our tools to monitor uptime and site backups, plus updates to WordPress and core and plugins, and more. XCloner integrates smoothly with Watchful. You’ll be amazed at how much time and money you save managing your WordPress sites with [Watchful](https://wordpress.org/plugins/watchful/).
47
 
48
  == Installation ==
49
 
50
+ 1. In the WordPress backend, select Plugins > Add New.
51
+ 2. In the search bar enter `xcloner`.
52
+ 3. When the XCLoner listing is shown, click the 'Install` button.
53
+ 4. Following installation, click the `Activate` button.
54
 
55
  UPGRADE:
56
 
57
+ XLCloner can be updated from the plugins list in the WordPress backend.
58
 
59
  == Frequently Asked Questions ==
60
 
113
  10. Generate Backup Process
114
  11. Generate Backup Screen
115
 
 
 
 
 
116
  == Changelog ==
117
 
118
+ = 4.1.3 =
119
+ * database include tables fix
120
+
121
  = 4.1.2 =
122
  * improved default backup storage path security
123
  * improved remote storage security
includes/class-xcloner-database.php CHANGED
@@ -277,12 +277,14 @@ class Xcloner_Database extends wpdb {
277
 
278
  $tablesList[$inc]['excluded'] = 0;
279
 
280
- if (sizeof($included) and is_array($included))
281
- if (!in_array($table, $included))
282
- {
283
- $tablesList[$inc]['excluded'] = 1;
284
- $this->log(sprintf(__("Excluding table %s.%s from backup"), $table, $database));
285
- }
 
 
286
  $inc++;
287
  }
288
 
277
 
278
  $tablesList[$inc]['excluded'] = 0;
279
 
280
+ if (sizeof($included) and is_array($included)) {
281
+ $dbTable = $database.".".$table;
282
+ if (!in_array($table, $included) and !in_array($dbTable, $included)) {
283
+ $tablesList[$inc]['excluded'] = 1;
284
+ $this->log(sprintf(__("Excluding table %s.%s from backup"), $table, $database));
285
+ }
286
+ }
287
+
288
  $inc++;
289
  }
290
 
vendor/sabre/dav/examples/addressbookserver.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ Addressbook/CardDAV server example
6
+
7
+ This server features CardDAV support
8
+
9
+ */
10
+
11
+ // settings
12
+ date_default_timezone_set('Canada/Eastern');
13
+
14
+ // Make sure this setting is turned on and reflect the root url for your WebDAV server.
15
+ // This can be for example the root / or a complete path to your server script
16
+ $baseUri = '/';
17
+
18
+ /* Database */
19
+ $pdo = new PDO('sqlite:data/db.sqlite');
20
+ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
21
+
22
+ //Mapping PHP errors to exceptions
23
+ function exception_error_handler($errno, $errstr, $errfile, $errline) {
24
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
25
+ }
26
+ set_error_handler("exception_error_handler");
27
+
28
+ // Autoloader
29
+ require_once 'vendor/autoload.php';
30
+
31
+ // Backends
32
+ $authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo);
33
+ $principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
34
+ $carddavBackend = new Sabre\CardDAV\Backend\PDO($pdo);
35
+ //$caldavBackend = new Sabre\CalDAV\Backend\PDO($pdo);
36
+
37
+ // Setting up the directory tree //
38
+ $nodes = [
39
+ new Sabre\DAVACL\PrincipalCollection($principalBackend),
40
+ // new Sabre\CalDAV\CalendarRoot($authBackend, $caldavBackend),
41
+ new Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
42
+ ];
43
+
44
+ // The object tree needs in turn to be passed to the server class
45
+ $server = new Sabre\DAV\Server($nodes);
46
+ $server->setBaseUri($baseUri);
47
+
48
+ // Plugins
49
+ $server->addPlugin(new Sabre\DAV\Auth\Plugin($authBackend));
50
+ $server->addPlugin(new Sabre\DAV\Browser\Plugin());
51
+ //$server->addPlugin(new Sabre\CalDAV\Plugin());
52
+ $server->addPlugin(new Sabre\CardDAV\Plugin());
53
+ $server->addPlugin(new Sabre\DAVACL\Plugin());
54
+ $server->addPlugin(new Sabre\DAV\Sync\Plugin());
55
+
56
+ // And off we go!
57
+ $server->exec();
vendor/sabre/dav/examples/calendarserver.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ CalendarServer example
6
+
7
+ This server features CalDAV support
8
+
9
+ */
10
+
11
+ // settings
12
+ date_default_timezone_set('Canada/Eastern');
13
+
14
+ // If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
15
+ // You can override the baseUri here.
16
+ // $baseUri = '/';
17
+
18
+ /* Database */
19
+ $pdo = new PDO('sqlite:data/db.sqlite');
20
+ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
21
+
22
+ //Mapping PHP errors to exceptions
23
+ function exception_error_handler($errno, $errstr, $errfile, $errline) {
24
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
25
+ }
26
+ set_error_handler("exception_error_handler");
27
+
28
+ // Files we need
29
+ require_once 'vendor/autoload.php';
30
+
31
+ // Backends
32
+ $authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo);
33
+ $calendarBackend = new Sabre\CalDAV\Backend\PDO($pdo);
34
+ $principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
35
+
36
+ // Directory structure
37
+ $tree = [
38
+ new Sabre\CalDAV\Principal\Collection($principalBackend),
39
+ new Sabre\CalDAV\CalendarRoot($principalBackend, $calendarBackend),
40
+ ];
41
+
42
+ $server = new Sabre\DAV\Server($tree);
43
+
44
+ if (isset($baseUri))
45
+ $server->setBaseUri($baseUri);
46
+
47
+ /* Server Plugins */
48
+ $authPlugin = new Sabre\DAV\Auth\Plugin($authBackend);
49
+ $server->addPlugin($authPlugin);
50
+
51
+ $aclPlugin = new Sabre\DAVACL\Plugin();
52
+ $server->addPlugin($aclPlugin);
53
+
54
+ /* CalDAV support */
55
+ $caldavPlugin = new Sabre\CalDAV\Plugin();
56
+ $server->addPlugin($caldavPlugin);
57
+
58
+ /* Calendar subscription support */
59
+ $server->addPlugin(
60
+ new Sabre\CalDAV\Subscriptions\Plugin()
61
+ );
62
+
63
+ /* Calendar scheduling support */
64
+ $server->addPlugin(
65
+ new Sabre\CalDAV\Schedule\Plugin()
66
+ );
67
+
68
+ /* WebDAV-Sync plugin */
69
+ $server->addPlugin(new Sabre\DAV\Sync\Plugin());
70
+
71
+ /* CalDAV Sharing support */
72
+ $server->addPlugin(new Sabre\DAV\Sharing\Plugin());
73
+ $server->addPlugin(new Sabre\CalDAV\SharingPlugin());
74
+
75
+ // Support for html frontend
76
+ $browser = new Sabre\DAV\Browser\Plugin();
77
+ $server->addPlugin($browser);
78
+
79
+ // And off we go!
80
+ $server->exec();
vendor/sabre/dav/examples/fileserver.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ This is the best starting point if you're just interested in setting up a fileserver.
6
+
7
+ Make sure that the 'public' and 'tmpdata' exists, with write permissions
8
+ for your server.
9
+
10
+ */
11
+
12
+ // settings
13
+ date_default_timezone_set('Canada/Eastern');
14
+ $publicDir = 'public';
15
+ $tmpDir = 'tmpdata';
16
+
17
+ // If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
18
+ // You can override the baseUri here.
19
+ // $baseUri = '/';
20
+
21
+
22
+ // Files we need
23
+ require_once 'vendor/autoload.php';
24
+
25
+ // Create the root node
26
+ $root = new \Sabre\DAV\FS\Directory($publicDir);
27
+
28
+ // The rootnode needs in turn to be passed to the server class
29
+ $server = new \Sabre\DAV\Server($root);
30
+
31
+ if (isset($baseUri))
32
+ $server->setBaseUri($baseUri);
33
+
34
+ // Support for LOCK and UNLOCK
35
+ $lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir . '/locksdb');
36
+ $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend);
37
+ $server->addPlugin($lockPlugin);
38
+
39
+ // Support for html frontend
40
+ $browser = new \Sabre\DAV\Browser\Plugin();
41
+ $server->addPlugin($browser);
42
+
43
+ // Automatically guess (some) contenttypes, based on extesion
44
+ $server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
45
+
46
+ // Authentication backend
47
+ $authBackend = new \Sabre\DAV\Auth\Backend\File('.htdigest');
48
+ $auth = new \Sabre\DAV\Auth\Plugin($authBackend);
49
+ $server->addPlugin($auth);
50
+
51
+ // Temporary file filter
52
+ $tempFF = new \Sabre\DAV\TemporaryFileFilterPlugin($tmpDir);
53
+ $server->addPlugin($tempFF);
54
+
55
+ // And off we go!
56
+ $server->exec();
vendor/sabre/dav/examples/groupwareserver.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This server combines both CardDAV and CalDAV functionality into a single
5
+ * server. It is assumed that the server runs at the root of a HTTP domain (be
6
+ * that a domainname-based vhost or a specific TCP port.
7
+ *
8
+ * This example also assumes that you're using SQLite and the database has
9
+ * already been setup (along with the database tables).
10
+ *
11
+ * You may choose to use MySQL instead, just change the PDO connection
12
+ * statement.
13
+ */
14
+
15
+ /**
16
+ * UTC or GMT is easy to work with, and usually recommended for any
17
+ * application.
18
+ */
19
+ date_default_timezone_set('UTC');
20
+
21
+ /**
22
+ * Make sure this setting is turned on and reflect the root url for your WebDAV
23
+ * server.
24
+ *
25
+ * This can be for example the root / or a complete path to your server script.
26
+ */
27
+ // $baseUri = '/';
28
+
29
+ /**
30
+ * Database
31
+ *
32
+ * Feel free to switch this to MySQL, it will definitely be better for higher
33
+ * concurrency.
34
+ */
35
+ $pdo = new \PDO('sqlite:data/db.sqlite');
36
+ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
37
+
38
+ /**
39
+ * Mapping PHP errors to exceptions.
40
+ *
41
+ * While this is not strictly needed, it makes a lot of sense to do so. If an
42
+ * E_NOTICE or anything appears in your code, this allows SabreDAV to intercept
43
+ * the issue and send a proper response back to the client (HTTP/1.1 500).
44
+ */
45
+ function exception_error_handler($errno, $errstr, $errfile, $errline) {
46
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
47
+ }
48
+ set_error_handler("exception_error_handler");
49
+
50
+ // Autoloader
51
+ require_once 'vendor/autoload.php';
52
+
53
+ /**
54
+ * The backends. Yes we do really need all of them.
55
+ *
56
+ * This allows any developer to subclass just any of them and hook into their
57
+ * own backend systems.
58
+ */
59
+ $authBackend = new \Sabre\DAV\Auth\Backend\PDO($pdo);
60
+ $principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($pdo);
61
+ $carddavBackend = new \Sabre\CardDAV\Backend\PDO($pdo);
62
+ $caldavBackend = new \Sabre\CalDAV\Backend\PDO($pdo);
63
+
64
+ /**
65
+ * The directory tree
66
+ *
67
+ * Basically this is an array which contains the 'top-level' directories in the
68
+ * WebDAV server.
69
+ */
70
+ $nodes = [
71
+ // /principals
72
+ new \Sabre\CalDAV\Principal\Collection($principalBackend),
73
+ // /calendars
74
+ new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
75
+ // /addressbook
76
+ new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
77
+ ];
78
+
79
+ // The object tree needs in turn to be passed to the server class
80
+ $server = new \Sabre\DAV\Server($nodes);
81
+ if (isset($baseUri)) $server->setBaseUri($baseUri);
82
+
83
+ // Plugins
84
+ $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend));
85
+ $server->addPlugin(new \Sabre\DAV\Browser\Plugin());
86
+ $server->addPlugin(new \Sabre\DAV\Sync\Plugin());
87
+ $server->addPlugin(new \Sabre\DAV\Sharing\Plugin());
88
+ $server->addPlugin(new \Sabre\DAVACL\Plugin());
89
+
90
+ // CalDAV plugins
91
+ $server->addPlugin(new \Sabre\CalDAV\Plugin());
92
+ $server->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
93
+ $server->addPlugin(new \Sabre\CalDAV\SharingPlugin());
94
+ $server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
95
+
96
+ // CardDAV plugins
97
+ $server->addPlugin(new \Sabre\CardDAV\Plugin());
98
+ $server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
99
+
100
+ // And off we go!
101
+ $server->exec();
vendor/sabre/dav/examples/minimal.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This example shows the smallest possible sabre/dav server.
5
+ */
6
+ include 'vendor/autoload.php';
7
+
8
+ $server = new Sabre\DAV\Server([
9
+ new Sabre\DAV\FS\Directory(__DIR__)
10
+ ]);
11
+
12
+ /**
13
+ * Ok. Perhaps not the smallest possible. The browser plugin is 100% optional,
14
+ * but it really helps understanding the server.
15
+ */
16
+ $server->addPlugin(
17
+ new Sabre\DAV\Browser\Plugin()
18
+ );
19
+
20
+ $server->exec();
vendor/sabre/dav/examples/sql/mysql.addressbooks.sql ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE addressbooks (
2
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ principaluri VARBINARY(255),
4
+ displayname VARCHAR(255),
5
+ uri VARBINARY(200),
6
+ description TEXT,
7
+ synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1',
8
+ UNIQUE(principaluri(100), uri(100))
9
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
10
+
11
+ CREATE TABLE cards (
12
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
13
+ addressbookid INT(11) UNSIGNED NOT NULL,
14
+ carddata MEDIUMBLOB,
15
+ uri VARBINARY(200),
16
+ lastmodified INT(11) UNSIGNED,
17
+ etag VARBINARY(32),
18
+ size INT(11) UNSIGNED NOT NULL
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
20
+
21
+ CREATE TABLE addressbookchanges (
22
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
23
+ uri VARBINARY(200) NOT NULL,
24
+ synctoken INT(11) UNSIGNED NOT NULL,
25
+ addressbookid INT(11) UNSIGNED NOT NULL,
26
+ operation TINYINT(1) NOT NULL,
27
+ INDEX addressbookid_synctoken (addressbookid, synctoken)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
vendor/sabre/dav/examples/sql/mysql.calendars.sql ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE calendarobjects (
2
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ calendardata MEDIUMBLOB,
4
+ uri VARBINARY(200),
5
+ calendarid INTEGER UNSIGNED NOT NULL,
6
+ lastmodified INT(11) UNSIGNED,
7
+ etag VARBINARY(32),
8
+ size INT(11) UNSIGNED NOT NULL,
9
+ componenttype VARBINARY(8),
10
+ firstoccurence INT(11) UNSIGNED,
11
+ lastoccurence INT(11) UNSIGNED,
12
+ uid VARBINARY(200),
13
+ UNIQUE(calendarid, uri),
14
+ INDEX calendarid_time (calendarid, firstoccurence)
15
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
16
+
17
+ CREATE TABLE calendars (
18
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
19
+ synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1',
20
+ components VARBINARY(21)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
22
+
23
+ CREATE TABLE calendarinstances (
24
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
25
+ calendarid INTEGER UNSIGNED NOT NULL,
26
+ principaluri VARBINARY(100),
27
+ access TINYINT(1) NOT NULL DEFAULT '1' COMMENT '1 = owner, 2 = read, 3 = readwrite',
28
+ displayname VARCHAR(100),
29
+ uri VARBINARY(200),
30
+ description TEXT,
31
+ calendarorder INT(11) UNSIGNED NOT NULL DEFAULT '0',
32
+ calendarcolor VARBINARY(10),
33
+ timezone TEXT,
34
+ transparent TINYINT(1) NOT NULL DEFAULT '0',
35
+ share_href VARBINARY(100),
36
+ share_displayname VARCHAR(100),
37
+ share_invitestatus TINYINT(1) NOT NULL DEFAULT '2' COMMENT '1 = noresponse, 2 = accepted, 3 = declined, 4 = invalid',
38
+ UNIQUE(principaluri, uri),
39
+ UNIQUE(calendarid, principaluri),
40
+ UNIQUE(calendarid, share_href)
41
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
42
+
43
+ CREATE TABLE calendarchanges (
44
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
45
+ uri VARBINARY(200) NOT NULL,
46
+ synctoken INT(11) UNSIGNED NOT NULL,
47
+ calendarid INT(11) UNSIGNED NOT NULL,
48
+ operation TINYINT(1) NOT NULL,
49
+ INDEX calendarid_synctoken (calendarid, synctoken)
50
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
51
+
52
+ CREATE TABLE calendarsubscriptions (
53
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
54
+ uri VARBINARY(200) NOT NULL,
55
+ principaluri VARBINARY(100) NOT NULL,
56
+ source TEXT,
57
+ displayname VARCHAR(100),
58
+ refreshrate VARCHAR(10),
59
+ calendarorder INT(11) UNSIGNED NOT NULL DEFAULT '0',
60
+ calendarcolor VARBINARY(10),
61
+ striptodos TINYINT(1) NULL,
62
+ stripalarms TINYINT(1) NULL,
63
+ stripattachments TINYINT(1) NULL,
64
+ lastmodified INT(11) UNSIGNED,
65
+ UNIQUE(principaluri, uri)
66
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
67
+
68
+ CREATE TABLE schedulingobjects (
69
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
70
+ principaluri VARBINARY(255),
71
+ calendardata MEDIUMBLOB,
72
+ uri VARBINARY(200),
73
+ lastmodified INT(11) UNSIGNED,
74
+ etag VARBINARY(32),
75
+ size INT(11) UNSIGNED NOT NULL
76
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
vendor/sabre/dav/examples/sql/mysql.locks.sql ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE locks (
2
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ owner VARCHAR(100),
4
+ timeout INTEGER UNSIGNED,
5
+ created INTEGER,
6
+ token VARBINARY(100),
7
+ scope TINYINT,
8
+ depth TINYINT,
9
+ uri VARBINARY(1000),
10
+ INDEX(token),
11
+ INDEX(uri(100))
12
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
vendor/sabre/dav/examples/sql/mysql.principals.sql ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE principals (
2
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ uri VARBINARY(200) NOT NULL,
4
+ email VARBINARY(80),
5
+ displayname VARCHAR(80),
6
+ UNIQUE(uri)
7
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
8
+
9
+ CREATE TABLE groupmembers (
10
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
11
+ principal_id INTEGER UNSIGNED NOT NULL,
12
+ member_id INTEGER UNSIGNED NOT NULL,
13
+ UNIQUE(principal_id, member_id)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
15
+
16
+ INSERT INTO principals (uri,email,displayname) VALUES
17
+ ('principals/admin', 'admin@example.org','Administrator'),
18
+ ('principals/admin/calendar-proxy-read', null, null),
19
+ ('principals/admin/calendar-proxy-write', null, null);
20
+
vendor/sabre/dav/examples/sql/mysql.propertystorage.sql ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE propertystorage (
2
+ id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ path VARBINARY(1024) NOT NULL,
4
+ name VARBINARY(100) NOT NULL,
5
+ valuetype INT UNSIGNED,
6
+ value MEDIUMBLOB
7
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
8
+
9
+ CREATE UNIQUE INDEX path_property ON propertystorage (path(600), name(100));
vendor/sabre/dav/examples/sql/mysql.users.sql ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE users (
2
+ id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3
+ username VARBINARY(50),
4
+ digesta1 VARBINARY(32),
5
+ UNIQUE(username)
6
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
7
+
8
+ INSERT INTO users (username,digesta1) VALUES
9
+ ('admin', '87fd274b7b6c01e48d7c2f965da8ddf7');
vendor/sabre/dav/examples/sql/pgsql.addressbooks.sql ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE addressbooks (
2
+ id SERIAL NOT NULL,
3
+ principaluri VARCHAR(255),
4
+ displayname VARCHAR(255),
5
+ uri VARCHAR(200),
6
+ description TEXT,
7
+ synctoken INTEGER NOT NULL DEFAULT 1
8
+ );
9
+
10
+ ALTER TABLE ONLY addressbooks
11
+ ADD CONSTRAINT addressbooks_pkey PRIMARY KEY (id);
12
+
13
+ CREATE UNIQUE INDEX addressbooks_ukey
14
+ ON addressbooks USING btree (principaluri, uri);
15
+
16
+ CREATE TABLE cards (
17
+ id SERIAL NOT NULL,
18
+ addressbookid INTEGER NOT NULL,
19
+ carddata BYTEA,
20
+ uri VARCHAR(200),
21
+ lastmodified INTEGER,
22
+ etag VARCHAR(32),
23
+ size INTEGER NOT NULL
24
+ );
25
+
26
+ ALTER TABLE ONLY cards
27
+ ADD CONSTRAINT cards_pkey PRIMARY KEY (id);
28
+
29
+ CREATE UNIQUE INDEX cards_ukey
30
+ ON cards USING btree (addressbookid, uri);
31
+
32
+ CREATE TABLE addressbookchanges (
33
+ id SERIAL NOT NULL,
34
+ uri VARCHAR(200) NOT NULL,
35
+ synctoken INTEGER NOT NULL,
36
+ addressbookid INTEGER NOT NULL,
37
+ operation SMALLINT NOT NULL
38
+ );
39
+
40
+ ALTER TABLE ONLY addressbookchanges
41
+ ADD CONSTRAINT addressbookchanges_pkey PRIMARY KEY (id);
42
+
43
+ CREATE INDEX addressbookchanges_addressbookid_synctoken_ix
44
+ ON addressbookchanges USING btree (addressbookid, synctoken);
vendor/sabre/dav/examples/sql/pgsql.calendars.sql ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE calendarobjects (
2
+ id SERIAL NOT NULL,
3
+ calendardata BYTEA,
4
+ uri VARCHAR(200),
5
+ calendarid INTEGER NOT NULL,
6
+ lastmodified INTEGER,
7
+ etag VARCHAR(32),
8
+ size INTEGER NOT NULL,
9
+ componenttype VARCHAR(8),
10
+ firstoccurence INTEGER,
11
+ lastoccurence INTEGER,
12
+ uid VARCHAR(200)
13
+ );
14
+
15
+ ALTER TABLE ONLY calendarobjects
16
+ ADD CONSTRAINT calendarobjects_pkey PRIMARY KEY (id);
17
+
18
+ CREATE UNIQUE INDEX calendarobjects_ukey
19
+ ON calendarobjects USING btree (calendarid, uri);
20
+
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);
61
+
62
+ CREATE TABLE calendarsubscriptions (
63
+ id SERIAL NOT NULL,
64
+ uri VARCHAR(200) NOT NULL,
65
+ principaluri VARCHAR(100) NOT NULL,
66
+ source TEXT,
67
+ displayname VARCHAR(100),
68
+ refreshrate VARCHAR(10),
69
+ calendarorder INTEGER NOT NULL DEFAULT 0,
70
+ calendarcolor VARCHAR(10),
71
+ striptodos SMALLINT NULL,
72
+ stripalarms SMALLINT NULL,
73
+ stripattachments SMALLINT NULL,
74
+ lastmodified INTEGER
75
+ );
76
+
77
+ ALTER TABLE ONLY calendarsubscriptions
78
+ ADD CONSTRAINT calendarsubscriptions_pkey PRIMARY KEY (id);
79
+
80
+ CREATE UNIQUE INDEX calendarsubscriptions_ukey
81
+ ON calendarsubscriptions USING btree (principaluri, uri);
82
+
83
+ CREATE TABLE calendarchanges (
84
+ id SERIAL NOT NULL,
85
+ uri VARCHAR(200) NOT NULL,
86
+ synctoken INTEGER NOT NULL,
87
+ calendarid INTEGER NOT NULL,
88
+ operation SMALLINT NOT NULL DEFAULT 0
89
+ );
90
+
91
+ ALTER TABLE ONLY calendarchanges
92
+ ADD CONSTRAINT calendarchanges_pkey PRIMARY KEY (id);
93
+
94
+ CREATE INDEX calendarchanges_calendarid_synctoken_ix
95
+ ON calendarchanges USING btree (calendarid, synctoken);
96
+
97
+ CREATE TABLE schedulingobjects (
98
+ id SERIAL NOT NULL,
99
+ principaluri VARCHAR(255),
100
+ calendardata BYTEA,
101
+ uri VARCHAR(200),
102
+ lastmodified INTEGER,
103
+ etag VARCHAR(32),
104
+ size INTEGER NOT NULL
105
+ );
vendor/sabre/dav/examples/sql/pgsql.locks.sql ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE locks (
2
+ id SERIAL NOT NULL,
3
+ owner VARCHAR(100),
4
+ timeout INTEGER,
5
+ created INTEGER,
6
+ token VARCHAR(100),
7
+ scope SMALLINT,
8
+ depth SMALLINT,
9
+ uri TEXT
10
+ );
11
+
12
+ ALTER TABLE ONLY locks
13
+ ADD CONSTRAINT locks_pkey PRIMARY KEY (id);
14
+
15
+ CREATE INDEX locks_token_ix
16
+ ON locks USING btree (token);
17
+
18
+ CREATE INDEX locks_uri_ix
19
+ ON locks USING btree (uri);
vendor/sabre/dav/examples/sql/pgsql.principals.sql ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE principals (
2
+ id SERIAL NOT NULL,
3
+ uri VARCHAR(200) NOT NULL,
4
+ email VARCHAR(80),
5
+ displayname VARCHAR(80)
6
+ );
7
+
8
+ ALTER TABLE ONLY principals
9
+ ADD CONSTRAINT principals_pkey PRIMARY KEY (id);
10
+
11
+ CREATE UNIQUE INDEX principals_ukey
12
+ ON principals USING btree (uri);
13
+
14
+ CREATE TABLE groupmembers (
15
+ id SERIAL NOT NULL,
16
+ principal_id INTEGER NOT NULL,
17
+ member_id INTEGER NOT NULL
18
+ );
19
+
20
+ ALTER TABLE ONLY groupmembers
21
+ ADD CONSTRAINT groupmembers_pkey PRIMARY KEY (id);
22
+
23
+ CREATE UNIQUE INDEX groupmembers_ukey
24
+ ON groupmembers USING btree (principal_id, member_id);
25
+
26
+ INSERT INTO principals (uri,email,displayname) VALUES
27
+ ('principals/admin', 'admin@example.org','Administrator'),
28
+ ('principals/admin/calendar-proxy-read', null, null),
29
+ ('principals/admin/calendar-proxy-write', null, null);
30
+
vendor/sabre/dav/examples/sql/pgsql.propertystorage.sql ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE propertystorage (
2
+ id SERIAL NOT NULL,
3
+ path VARCHAR(1024) NOT NULL,
4
+ name VARCHAR(100) NOT NULL,
5
+ valuetype INT,
6
+ value BYTEA
7
+ );
8
+
9
+ ALTER TABLE ONLY propertystorage
10
+ ADD CONSTRAINT propertystorage_pkey PRIMARY KEY (id);
11
+
12
+ CREATE UNIQUE INDEX propertystorage_ukey
13
+ ON propertystorage (path, name);
vendor/sabre/dav/examples/sql/pgsql.users.sql ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE users (
2
+ id SERIAL NOT NULL,
3
+ username VARCHAR(50),
4
+ digesta1 VARCHAR(32)
5
+ );
6
+
7
+ ALTER TABLE ONLY users
8
+ ADD CONSTRAINT users_pkey PRIMARY KEY (id);
9
+
10
+ CREATE UNIQUE INDEX users_ukey
11
+ ON users USING btree (username);
12
+
13
+ INSERT INTO users (username,digesta1) VALUES
14
+ ('admin', '87fd274b7b6c01e48d7c2f965da8ddf7');
vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE addressbooks (
2
+ id integer primary key asc NOT NULL,
3
+ principaluri text NOT NULL,
4
+ displayname text,
5
+ uri text NOT NULL,
6
+ description text,
7
+ synctoken integer DEFAULT 1 NOT NULL
8
+ );
9
+
10
+ CREATE TABLE cards (
11
+ id integer primary key asc NOT NULL,
12
+ addressbookid integer NOT NULL,
13
+ carddata blob,
14
+ uri text NOT NULL,
15
+ lastmodified integer,
16
+ etag text,
17
+ size integer
18
+ );
19
+
20
+ CREATE TABLE addressbookchanges (
21
+ id integer primary key asc NOT NULL,
22
+ uri text,
23
+ synctoken integer NOT NULL,
24
+ addressbookid integer NOT NULL,
25
+ operation integer NOT NULL
26
+ );
27
+
28
+ CREATE INDEX addressbookid_synctoken ON addressbookchanges (addressbookid, synctoken);
vendor/sabre/dav/examples/sql/sqlite.calendars.sql ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE calendarobjects (
2
+ id integer primary key asc NOT NULL,
3
+ calendardata blob NOT NULL,
4
+ uri text NOT NULL,
5
+ calendarid integer NOT NULL,
6
+ lastmodified integer NOT NULL,
7
+ etag text NOT NULL,
8
+ size integer NOT NULL,
9
+ componenttype text,
10
+ firstoccurence integer,
11
+ lastoccurence integer,
12
+ uid text
13
+ );
14
+
15
+ CREATE TABLE calendars (
16
+ id integer primary key asc NOT NULL,
17
+ synctoken integer DEFAULT 1 NOT NULL,
18
+ components text NOT NULL
19
+ );
20
+
21
+ CREATE TABLE calendarinstances (
22
+ id integer primary key asc NOT NULL,
23
+ calendarid integer NOT NULL,
24
+ principaluri text NULL,
25
+ access integer COMMENT '1 = owner, 2 = read, 3 = readwrite' NOT NULL DEFAULT '1',
26
+ displayname text,
27
+ uri text NOT NULL,
28
+ description text,
29
+ calendarorder integer,
30
+ calendarcolor text,
31
+ timezone text,
32
+ transparent bool,
33
+ share_href text,
34
+ share_displayname text,
35
+ share_invitestatus integer DEFAULT '2',
36
+ UNIQUE (principaluri, uri),
37
+ UNIQUE (calendarid, principaluri),
38
+ UNIQUE (calendarid, share_href)
39
+ );
40
+
41
+ CREATE TABLE calendarchanges (
42
+ id integer primary key asc NOT NULL,
43
+ uri text,
44
+ synctoken integer NOT NULL,
45
+ calendarid integer NOT NULL,
46
+ operation integer NOT NULL
47
+ );
48
+
49
+ CREATE INDEX calendarid_synctoken ON calendarchanges (calendarid, synctoken);
50
+
51
+ CREATE TABLE calendarsubscriptions (
52
+ id integer primary key asc NOT NULL,
53
+ uri text NOT NULL,
54
+ principaluri text NOT NULL,
55
+ source text NOT NULL,
56
+ displayname text,
57
+ refreshrate text,
58
+ calendarorder integer,
59
+ calendarcolor text,
60
+ striptodos bool,
61
+ stripalarms bool,
62
+ stripattachments bool,
63
+ lastmodified int
64
+ );
65
+
66
+ CREATE TABLE schedulingobjects (
67
+ id integer primary key asc NOT NULL,
68
+ principaluri text NOT NULL,
69
+ calendardata blob,
70
+ uri text NOT NULL,
71
+ lastmodified integer,
72
+ etag text NOT NULL,
73
+ size integer NOT NULL
74
+ );
75
+
76
+ CREATE INDEX principaluri_uri ON calendarsubscriptions (principaluri, uri);
vendor/sabre/dav/examples/sql/sqlite.locks.sql ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BEGIN TRANSACTION;
2
+ CREATE TABLE locks (
3
+ id integer primary key asc NOT NULL,
4
+ owner text,
5
+ timeout integer,
6
+ created integer,
7
+ token text,
8
+ scope integer,
9
+ depth integer,
10
+ uri text
11
+ );
12
+ COMMIT;
vendor/sabre/dav/examples/sql/sqlite.principals.sql ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE principals (
2
+ id INTEGER PRIMARY KEY ASC NOT NULL,
3
+ uri TEXT NOT NULL,
4
+ email TEXT,
5
+ displayname TEXT,
6
+ UNIQUE(uri)
7
+ );
8
+
9
+ CREATE TABLE groupmembers (
10
+ id INTEGER PRIMARY KEY ASC NOT NULL,
11
+ principal_id INTEGER NOT NULL,
12
+ member_id INTEGER NOT NULL,
13
+ UNIQUE(principal_id, member_id)
14
+ );
15
+
16
+
17
+ INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin', 'admin@example.org','Administrator');
18
+ INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin/calendar-proxy-read', null, null);
19
+ INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin/calendar-proxy-write', null, null);
20
+
vendor/sabre/dav/examples/sql/sqlite.propertystorage.sql ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE propertystorage (
2
+ id integer primary key asc NOT NULL,
3
+ path text NOT NULL,
4
+ name text NOT NULL,
5
+ valuetype integer NOT NULL,
6
+ value string
7
+ );
8
+
9
+
10
+ CREATE UNIQUE INDEX path_property ON propertystorage (path, name);
vendor/sabre/dav/examples/sql/sqlite.users.sql ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE users (
2
+ id integer primary key asc NOT NULL,
3
+ username TEXT NOT NULL,
4
+ digesta1 TEXT NOT NULL,
5
+ UNIQUE(username)
6
+ );
7
+
8
+ INSERT INTO users (username,digesta1) VALUES
9
+ ('admin', '87fd274b7b6c01e48d7c2f965da8ddf7');
vendor/sabre/dav/examples/webserver/apache2_htaccess.conf ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ RewriteEngine On
2
+ # This makes every request go to server.php
3
+ RewriteRule (.*) server.php [L]
4
+
5
+ # Output buffering needs to be off, to prevent high memory usage
6
+ php_flag output_buffering off
7
+
8
+ # This is also to prevent high memory usage
9
+ php_flag always_populate_raw_post_data off
10
+
11
+ # This is almost a given, but magic quotes is *still* on on some
12
+ # linux distributions
13
+ php_flag magic_quotes_gpc off
14
+
15
+ # SabreDAV is not compatible with mbstring function overloading
16
+ php_flag mbstring.func_overload off
vendor/sabre/dav/examples/webserver/apache2_vhost.conf ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a sample configuration to setup a dedicated Apache vhost for WebDAV.
2
+ #
3
+ # The main thing that should be configured is the servername, and the path to
4
+ # your SabreDAV installation (DocumentRoot).
5
+ #
6
+ # This configuration assumed mod_php5 is used, as it sets a few default php
7
+ # settings as well.
8
+ <VirtualHost *:*>
9
+
10
+ # Don't forget to change the server name
11
+ # ServerName dav.example.org
12
+
13
+ # The DocumentRoot is also required
14
+ # DocumentRoot /home/sabredav/
15
+
16
+ RewriteEngine On
17
+ # This makes every request go to server.php
18
+ RewriteRule ^/(.*)$ /server.php [L]
19
+
20
+ # Output buffering needs to be off, to prevent high memory usage
21
+ php_flag output_buffering off
22
+
23
+ # This is also to prevent high memory usage
24
+ php_flag always_populate_raw_post_data off
25
+
26
+ # SabreDAV is not compatible with mbstring function overloading
27
+ php_flag mbstring.func_overload off
28
+
29
+ </VirtualHost *:*>
vendor/sabre/dav/examples/webserver/apache2_vhost_cgi.conf ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a sample configuration to setup a dedicated Apache vhost for WebDAV.
2
+ #
3
+ # The main thing that should be configured is the servername, and the path to
4
+ # your SabreDAV installation (DocumentRoot).
5
+ #
6
+ # This configuration assumes CGI or FastCGI is used.
7
+ <VirtualHost *:*>
8
+
9
+ # Don't forget to change the server name
10
+ # ServerName dav.example.org
11
+
12
+ # The DocumentRoot is also required
13
+ # DocumentRoot /home/sabredav/
14
+
15
+ # This makes every request go to server.php. This also makes sure
16
+ # the Authentication information is available. If your server script is
17
+ # not called server.php, be sure to change it.
18
+ RewriteEngine On
19
+ RewriteRule ^/(.*)$ /server.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
20
+
21
+ </VirtualHost *:*>
vendor/sabre/vobject/.php_cs.dist ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = PhpCsFixer\Config::create();
4
+ $config->getFinder()
5
+ ->exclude('vendor')
6
+ ->in(__DIR__);
7
+ $config->setRules([
8
+ '@PSR1' => true,
9
+ '@Symfony' =>true
10
+ ]);
11
+
12
+ return $config;
vendor/sabre/vobject/bin/bench.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ include __DIR__.'/../vendor/autoload.php';
5
+
6
+ $data = stream_get_contents(STDIN);
7
+
8
+ $start = microtime(true);
9
+
10
+ $lol = Sabre\VObject\Reader::read($data);
11
+
12
+ echo 'time: '.(microtime(true) - $start)."\n";
vendor/sabre/vobject/bin/bench_freebusygenerator.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include __DIR__.'/../vendor/autoload.php';
4
+
5
+ if ($argc < 2) {
6
+ echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " freebusy benchmark\n";
7
+ echo "\n";
8
+ echo "This script can be used to measure the speed of generating a\n";
9
+ echo "free-busy report based on a calendar.\n";
10
+ echo "\n";
11
+ echo "The process will be repeated 100 times to get accurate stats\n";
12
+ echo "\n";
13
+ echo 'Usage: '.$argv[0]." inputfile.ics\n";
14
+ die();
15
+ }
16
+
17
+ list(, $inputFile) = $argv;
18
+
19
+ $bench = new Hoa\Bench\Bench();
20
+ $bench->parse->start();
21
+
22
+ $vcal = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
23
+
24
+ $bench->parse->stop();
25
+
26
+ $repeat = 100;
27
+ $start = new \DateTime('2000-01-01');
28
+ $end = new \DateTime('2020-01-01');
29
+ $timeZone = new \DateTimeZone('America/Toronto');
30
+
31
+ $bench->fb->start();
32
+
33
+ for ($i = 0; $i < $repeat; ++$i) {
34
+ $fb = new Sabre\VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
35
+ $results = $fb->getResult();
36
+ }
37
+ $bench->fb->stop();
38
+
39
+ echo $bench,"\n";
40
+
41
+ function formatMemory($input)
42
+ {
43
+ if (strlen($input) > 6) {
44
+ return round($input / (1024 * 1024)).'M';
45
+ } elseif (strlen($input) > 3) {
46
+ return round($input / 1024).'K';
47
+ }
48
+ }
49
+
50
+ unset($input, $splitter);
51
+
52
+ echo 'peak memory usage: '.formatMemory(memory_get_peak_usage()), "\n";
53
+ echo 'current memory usage: '.formatMemory(memory_get_usage()), "\n";
vendor/sabre/vobject/bin/bench_manipulatevcard.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include __DIR__.'/../vendor/autoload.php';
4
+
5
+ if ($argc < 2) {
6
+ echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " manipulation benchmark\n";
7
+ echo "\n";
8
+ echo "This script can be used to measure the speed of opening a large amount of\n";
9
+ echo "vcards, making a few alterations and serializing them again.\n";
10
+ echo 'system.';
11
+ echo "\n";
12
+ echo 'Usage: '.$argv[0]." inputfile.vcf\n";
13
+ die();
14
+ }
15
+
16
+ list(, $inputFile) = $argv;
17
+
18
+ $input = file_get_contents($inputFile);
19
+
20
+ $splitter = new Sabre\VObject\Splitter\VCard($input);
21
+
22
+ $bench = new Hoa\Bench\Bench();
23
+
24
+ while (true) {
25
+ $bench->parse->start();
26
+ $vcard = $splitter->getNext();
27
+ $bench->parse->pause();
28
+
29
+ if (!$vcard) {
30
+ break;
31
+ }
32
+
33
+ $bench->manipulate->start();
34
+ $vcard->{'X-FOO'} = 'Random new value!';
35
+ $emails = [];
36
+ if (isset($vcard->EMAIL)) {
37
+ foreach ($vcard->EMAIL as $email) {
38
+ $emails[] = (string) $email;
39
+ }
40
+ }
41
+ $bench->manipulate->pause();
42
+
43
+ $bench->serialize->start();
44
+ $vcard2 = $vcard->serialize();
45
+ $bench->serialize->pause();
46
+
47
+ $vcard->destroy();
48
+ }
49
+
50
+ echo $bench,"\n";
51
+
52
+ function formatMemory($input)
53
+ {
54
+ if (strlen($input) > 6) {
55
+ return round($input / (1024 * 1024)).'M';
56
+ } elseif (strlen($input) > 3) {
57
+ return round($input / 1024).'K';
58
+ }
59
+ }
60
+
61
+ unset($input, $splitter);
62
+
63
+ echo 'peak memory usage: '.formatMemory(memory_get_peak_usage()), "\n";
64
+ echo 'current memory usage: '.formatMemory(memory_get_usage()), "\n";
vendor/sabre/vobject/bin/fetch_windows_zones.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ $windowsZonesUrl = 'http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml';
5
+ $outputFile = __DIR__.'/../lib/timezonedata/windowszones.php';
6
+
7
+ echo 'Fetching timezone map from: '.$windowsZonesUrl, "\n";
8
+
9
+ $data = file_get_contents($windowsZonesUrl);
10
+
11
+ $xml = simplexml_load_string($data);
12
+
13
+ $map = [];
14
+
15
+ foreach ($xml->xpath('//mapZone') as $mapZone) {
16
+ $from = (string) $mapZone['other'];
17
+ $to = (string) $mapZone['type'];
18
+
19
+ list($to) = explode(' ', $to, 2);
20
+
21
+ if (!isset($map[$from])) {
22
+ $map[$from] = $to;
23
+ }
24
+ }
25
+
26
+ ksort($map);
27
+ echo "Writing to: $outputFile\n";
28
+
29
+ $f = fopen($outputFile, 'w');
30
+ fwrite($f, "<?php\n\n");
31
+ fwrite($f, "/**\n");
32
+ fwrite($f, " * Automatically generated timezone file\n");
33
+ fwrite($f, " *\n");
34
+ fwrite($f, ' * Last update: '.date(DATE_W3C)."\n");
35
+ fwrite($f, ' * Source: '.$windowsZonesUrl."\n");
36
+ fwrite($f, " *\n");
37
+ fwrite($f, " * @copyright Copyright (C) fruux GmbH (https://fruux.com/).\n");
38
+ fwrite($f, " * @license http://sabre.io/license/ Modified BSD License\n");
39
+ fwrite($f, " */\n");
40
+ fwrite($f, "\n");
41
+ fwrite($f, 'return ');
42
+ fwrite($f, var_export($map, true).';');
43
+ fclose($f);
44
+
45
+ echo "Formatting\n";
46
+
47
+ exec(__DIR__.'/sabre-cs-fixer fix '.escapeshellarg($outputFile));
48
+
49
+ echo "Done\n";
vendor/sabre/vobject/bin/generate_vcards ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ namespace Sabre\VObject;
5
+
6
+ // This sucks.. we have to try to find the composer autoloader. But chances
7
+ // are, we can't find it this way. So we'll do our bestest
8
+ $paths = [
9
+ __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly
10
+ __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency.
11
+ ];
12
+
13
+ foreach($paths as $path) {
14
+ if (file_exists($path)) {
15
+ include $path;
16
+ break;
17
+ }
18
+ }
19
+
20
+ if (!class_exists('Sabre\\VObject\\Version')) {
21
+ fwrite(STDERR, "Composer autoloader could not be properly loaded.\n");
22
+ die(1);
23
+ }
24
+
25
+ if ($argc < 2) {
26
+
27
+ $version = Version::VERSION;
28
+
29
+ $help = <<<HI
30
+ sabre/vobject $version
31
+ Usage:
32
+ generate_vcards [count]
33
+
34
+ Options:
35
+ count The number of random vcards to generate
36
+
37
+ Examples:
38
+ generate_vcards 1000 > testdata.vcf
39
+
40
+ HI;
41
+
42
+ fwrite(STDERR, $help);
43
+ exit(2);
44
+ }
45
+
46
+ $count = (int)$argv[1];
47
+ if ($count < 1) {
48
+ fwrite(STDERR, "Count must be at least 1\n");
49
+ exit(2);
50
+ }
51
+
52
+ fwrite(STDERR, "sabre/vobject " . Version::VERSION . "\n");
53
+ fwrite(STDERR, "Generating " . $count . " vcards in vCard 4.0 format\n");
54
+
55
+ /**
56
+ * The following list is just some random data we compiled from various
57
+ * sources online.
58
+ *
59
+ * Very little thought went into compiling this list, and certainly nothing
60
+ * political or ethical.
61
+ *
62
+ * We would _love_ more additions to this to add more variation to this list.
63
+ *
64
+ * Send us PR's and don't be shy adding your own first and last name for fun.
65
+ */
66
+
67
+ $sets = array(
68
+ "nl" => array(
69
+ "country" => "Netherlands",
70
+ "boys" => array(
71
+ "Anno",
72
+ "Bram",
73
+ "Daan",
74
+ "Evert",
75
+ "Finn",
76
+ "Jayden",
77
+ "Jens",
78
+ "Jesse",
79
+ "Levi",
80
+ "Lucas",
81
+ "Luuk",
82
+ "Milan",
83
+ "René",
84
+ "Sem",
85
+ "Sibrand",
86
+ "Willem",
87
+ ),
88
+ "girls" => array(
89
+ "Celia",
90
+ "Emma",
91
+ "Fenna",
92
+ "Geke",
93
+ "Inge",
94
+ "Julia",
95
+ "Lisa",
96
+ "Lotte",
97
+ "Mila",
98
+ "Sara",
99
+ "Sophie",
100
+ "Tess",
101
+ "Zoë",
102
+ ),
103
+ "last" => array(
104
+ "Bakker",
105
+ "Bos",
106
+ "De Boer",
107
+ "De Groot",
108
+ "De Jong",
109
+ "De Vries",
110
+ "Jansen",
111
+ "Janssen",
112
+ "Meyer",
113
+ "Mulder",
114
+ "Peters",
115
+ "Smit",
116
+ "Van Dijk",
117
+ "Van den Berg",
118
+ "Visser",
119
+ "Vos",
120
+ ),
121
+ ),
122
+ "us" => array(
123
+ "country" => "United States",
124
+ "boys" => array(
125
+ "Aiden",
126
+ "Alexander",
127
+ "Charles",
128
+ "David",
129
+ "Ethan",
130
+ "Jacob",
131
+ "James",
132
+ "Jayden",
133
+ "John",
134
+ "Joseph",
135
+ "Liam",
136
+ "Mason",
137
+ "Michael",
138
+ "Noah",
139
+ "Richard",
140
+ "Robert",
141
+ "Thomas",
142
+ "William",
143
+ ),
144
+ "girls" => array(
145
+ "Ava",
146
+ "Barbara",
147
+ "Chloe",
148
+ "Dorothy",
149
+ "Elizabeth",
150
+ "Emily",
151
+ "Emma",
152
+ "Isabella",
153
+ "Jennifer",
154
+ "Lily",
155
+ "Linda",
156
+ "Margaret",
157
+ "Maria",
158
+ "Mary",
159
+ "Mia",
160
+ "Olivia",
161
+ "Patricia",
162
+ "Roxy",
163
+ "Sophia",
164
+ "Susan",
165
+ "Zoe",
166
+ ),
167
+ "last" => array(
168
+ "Smith",
169
+ "Johnson",
170
+ "Williams",
171
+ "Jones",
172
+ "Brown",
173
+ "Davis",
174
+ "Miller",
175
+ "Wilson",
176
+ "Moore",
177
+ "Taylor",
178
+ "Anderson",
179
+ "Thomas",
180
+ "Jackson",
181
+ "White",
182
+ "Harris",
183
+ "Martin",
184
+ "Thompson",
185
+ "Garcia",
186
+ "Martinez",
187
+ "Robinson",
188
+ ),
189
+ ),
190
+ );
191
+
192
+ $current = 0;
193
+
194
+ $r = function($arr) {
195
+
196
+ return $arr[mt_rand(0,count($arr)-1)];
197
+
198
+ };
199
+
200
+ $bdayStart = strtotime('-85 years');
201
+ $bdayEnd = strtotime('-20 years');
202
+
203
+ while($current < $count) {
204
+
205
+ $current++;
206
+ fwrite(STDERR, "\033[100D$current/$count");
207
+
208
+ $country = array_rand($sets);
209
+ $gender = mt_rand(0,1)?'girls':'boys';
210
+
211
+ $vcard = new Component\VCard(array(
212
+ 'VERSION' => '4.0',
213
+ 'FN' => $r($sets[$country][$gender]) . ' ' . $r($sets[$country]['last']),
214
+ 'UID' => UUIDUtil::getUUID(),
215
+ ));
216
+
217
+ $bdayRatio = mt_rand(0,9);
218
+
219
+ if($bdayRatio < 2) {
220
+ // 20% has a birthday property with a full date
221
+ $dt = new \DateTime('@' . mt_rand($bdayStart, $bdayEnd));
222
+ $vcard->add('BDAY', $dt->format('Ymd'));
223
+
224
+ } elseif ($bdayRatio < 3) {
225
+ // 10% we only know the month and date of
226
+ $dt = new \DateTime('@' . mt_rand($bdayStart, $bdayEnd));
227
+ $vcard->add('BDAY', '--' . $dt->format('md'));
228
+ }
229
+ if ($result = $vcard->validate()) {
230
+ ob_start();
231
+ echo "\nWe produced an invalid vcard somehow!\n";
232
+ foreach($result as $message) {
233
+ echo " " . $message['message'] . "\n";
234
+ }
235
+ fwrite(STDERR, ob_get_clean());
236
+ }
237
+ echo $vcard->serialize();
238
+
239
+ }
240
+
241
+ fwrite(STDERR,"\nDone.\n");
vendor/sabre/vobject/bin/generateicalendardata.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ use Sabre\VObject;
5
+
6
+ if ($argc < 2) {
7
+ $cmd = $argv[0];
8
+ fwrite(STDERR, <<<HI
9
+ Fruux test data generator
10
+
11
+ This script generates a lot of test data. This is used for profiling and stuff.
12
+ Currently it just generates events in a single calendar.
13
+
14
+ The iCalendar output goes to stdout. Other messages to stderr.
15
+
16
+ {$cmd} [events]
17
+
18
+
19
+ HI
20
+ );
21
+ die();
22
+ }
23
+
24
+ $events = 100;
25
+
26
+ if (isset($argv[1])) {
27
+ $events = (int) $argv[1];
28
+ }
29
+
30
+ include __DIR__.'/../vendor/autoload.php';
31
+
32
+ fwrite(STDERR, 'Generating '.$events." events\n");
33
+
34
+ $currentDate = new DateTime('-'.round($events / 2).' days');
35
+
36
+ $calendar = new VObject\Component\VCalendar();
37
+
38
+ $ii = 0;
39
+
40
+ while ($ii < $events) {
41
+ ++$ii;
42
+
43
+ $event = $calendar->add('VEVENT');
44
+ $event->DTSTART = 'bla';
45
+ $event->SUMMARY = 'Event #'.$ii;
46
+ $event->UID = md5(microtime(true));
47
+
48
+ $doctorRandom = mt_rand(1, 1000);
49
+
50
+ switch ($doctorRandom) {
51
+ // All-day event
52
+ case 1:
53
+ $event->DTEND = 'bla';
54
+ $dtStart = clone $currentDate;
55
+ $dtEnd = clone $currentDate;
56
+ $dtEnd->modify('+'.mt_rand(1, 3).' days');
57
+ $event->DTSTART->setDateTime($dtStart);
58
+ $event->DTSTART['VALUE'] = 'DATE';
59
+ $event->DTEND->setDateTime($dtEnd);
60
+ break;
61
+ case 2:
62
+ $event->RRULE = 'FREQ=DAILY;COUNT='.mt_rand(1, 10);
63
+ // no break intentional
64
+ default:
65
+ $dtStart = clone $currentDate;
66
+ $dtStart->setTime(mt_rand(1, 23), mt_rand(0, 59), mt_rand(0, 59));
67
+ $event->DTSTART->setDateTime($dtStart);
68
+ $event->DURATION = 'PT'.mt_rand(1, 3).'H';
69
+ break;
70
+ }
71
+
72
+ $currentDate->modify('+ '.mt_rand(0, 3).' days');
73
+ }
74
+ fwrite(STDERR, "Validating\n");
75
+
76
+ $result = $calendar->validate();
77
+ if ($result) {
78
+ fwrite(STDERR, "Errors!\n");
79
+ fwrite(STDERR, print_r($result, true));
80
+ die(-1);
81
+ }
82
+
83
+ fwrite(STDERR, "Serializing this beast\n");
84
+
85
+ echo $calendar->serialize();
86
+
87
+ fwrite(STDERR, "done.\n");
vendor/sabre/vobject/bin/mergeduplicates.php ADDED
File without changes
vendor/sabre/vobject/bin/rrulebench.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include __DIR__.'/../vendor/autoload.php';
4
+
5
+ if ($argc < 4) {
6
+ echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " RRULE benchmark\n";
7
+ echo "\n";
8
+ echo "This script can be used to measure the speed of the 'recurrence expansion'\n";
9
+ echo 'system.';
10
+ echo "\n";
11
+ echo 'Usage: '.$argv[0]." inputfile.ics startdate enddate\n";
12
+ die();
13
+ }
14
+
15
+ list(, $inputFile, $startDate, $endDate) = $argv;
16
+
17
+ $bench = new Hoa\Bench\Bench();
18
+ $bench->parse->start();
19
+
20
+ echo "Parsing.\n";
21
+ $vobj = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
22
+
23
+ $bench->parse->stop();
24
+
25
+ echo "Expanding.\n";
26
+ $bench->expand->start();
27
+
28
+ $vobj->expand(new DateTime($startDate), new DateTime($endDate));
29
+
30
+ $bench->expand->stop();
31
+
32
+ echo $bench,"\n";
vendor/sabre/vobject/bin/vobject ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ namespace Sabre\VObject;
5
+
6
+ // This sucks.. we have to try to find the composer autoloader. But chances
7
+ // are, we can't find it this way. So we'll do our bestest
8
+ $paths = [
9
+ __DIR__ . '/../vendor/autoload.php', // In case vobject is cloned directly
10
+ __DIR__ . '/../../../autoload.php', // In case vobject is a composer dependency.
11
+ ];
12
+
13
+ foreach($paths as $path) {
14
+ if (file_exists($path)) {
15
+ include $path;
16
+ break;
17
+ }
18
+ }
19
+
20
+ if (!class_exists('Sabre\\VObject\\Version')) {
21
+ fwrite(STDERR, "Composer autoloader could not be loaded.\n");
22
+ die(1);
23
+ }
24
+
25
+ $cli = new Cli();
26
+ exit($cli->main($argv));
27
+
vendor/sabre/vobject/phpstan.neon ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ parameters:
2
+ level: 0
3
+ bootstrap: %currentWorkingDirectory%/vendor/autoload.php
xcloner.php CHANGED
@@ -7,17 +7,17 @@
7
  * registers the activation and deactivation functions, and defines a function
8
  * that starts the plugin.
9
  *
10
- * @link http://www.thinkovi.com
11
  * @since 1.0.0
12
  * @package Xcloner
13
  *
14
  * @wordpress-plugin
15
  * Plugin Name: XCloner - Site Backup and Restore
16
- * Plugin URI: http://www.xcloner.com
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
- * Version: 4.1.2
19
- * Author: Liuta Ovidiu
20
- * Author URI: http://www.thinkovi.com
21
  * License: GPL-2.0+
22
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23
  * Text Domain: xcloner-backup-and-restore
7
  * registers the activation and deactivation functions, and defines a function
8
  * that starts the plugin.
9
  *
10
+ * @link https://www.xcloner.com/
11
  * @since 1.0.0
12
  * @package Xcloner
13
  *
14
  * @wordpress-plugin
15
  * Plugin Name: XCloner - Site Backup and Restore
16
+ * Plugin URI: https://www.xcloner.com
17
  * Description: XCloner is a tool that will help you manage your website backups, generate/restore/move so your website will be always secured! With XCloner you will be able to clone your site to any other location with just a few clicks, as well as transfer the backup archives to remote FTP, SFTP, DropBox, Amazon S3, Google Drive, WebDAV, Backblaze, Azure accounts.
18
+ * Version: 4.1.3
19
+ * Author: watchful
20
+ * Author URI: https://watchful.net
21
  * License: GPL-2.0+
22
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23
  * Text Domain: xcloner-backup-and-restore