~unity-api-team/storage-provider-webdav/trunk

« back to all changes in this revision

Viewing changes to tests/utils/sabredav-server.php

  • Committer: James Henstridge
  • Date: 2016-09-23 03:27:31 UTC
  • mto: (7.2.5 roots)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james@jamesh.id.au-20160923032731-xda3vzjre2abzpq4
Make sabredav-server.php function on vivid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
// settings
4
4
date_default_timezone_set('UTC');
5
 
$publicDir = '.';
 
5
$publicDir = getcwd();
6
6
 
7
 
// Files we need
8
 
require_once 'Sabre/autoload.php';
 
7
// The SabreDAV autoloader in Vivid is broken, so add one that just loads
 
8
// arbitrary files from /usr/share/php.
 
9
spl_autoload_register(function($class_name) {
 
10
    $file = "/usr/share/php/" . str_replace("\\", "/", $class_name) . ".php";
 
11
    if (file_exists($file)) {
 
12
        require_once $file;
 
13
    }
 
14
});
9
15
 
10
16
class DummyAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
11
17
    protected function validateUserPass($username, $password) {