1<?php
2
3set_include_path(__DIR__ . '/../lib/' . PATH_SEPARATOR . __DIR__ . PATH_SEPARATOR . get_include_path());
4
5$autoLoader = include __DIR__ . '/../vendor/autoload.php';
6
7// SabreDAV tests auto loading
8$autoLoader->add('Sabre\\', __DIR__);
9// VObject tests auto loading
10$autoLoader->addPsr4('Sabre\\VObject\\',__DIR__ . '/../vendor/sabre/vobject/tests/VObject');
11
12date_default_timezone_set('UTC');
13
14$config = [
15    'SABRE_TEMPDIR'   => dirname(__FILE__) . '/temp/',
16    'SABRE_HASSQLITE' => in_array('sqlite',PDO::getAvailableDrivers()),
17    'SABRE_HASMYSQL'  => in_array('mysql',PDO::getAvailableDrivers()),
18    'SABRE_MYSQLDSN'  => 'mysql:host=127.0.0.1;dbname=sabredav',
19    'SABRE_MYSQLUSER' => 'root',
20    'SABRE_MYSQLPASS' => '',
21];
22
23foreach($config as $key=>$value) {
24    if (!defined($key)) define($key, $value);
25}
26
27if (!file_exists(SABRE_TEMPDIR)) mkdir(SABRE_TEMPDIR);
28if (file_exists('.sabredav')) unlink('.sabredav');
29