mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
0bc0a09bf4
- application/extensions file system permission now is 775 - application/logs file system permission now is 775 - Added extensions directory in application/: config, controllers, helpers, hooks, libraries, models, views and widgets - Added view views/extensions/manage.php - Added controller controllers/system/extensions/Manager.php - Added library ExtensionsLib to manage extensions - Added model models/system/Extensions_model.php - Moved code related to print out info from MigrationLib to EPrintfLib
63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
|
|
CalendarServer example
|
|
|
|
This server features CalDAV support
|
|
|
|
*/
|
|
|
|
// settings
|
|
date_default_timezone_set('Canada/Eastern');
|
|
|
|
// If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
|
|
// You can override the baseUri here.
|
|
// $baseUri = '/';
|
|
|
|
/* Database */
|
|
$pdo = new \PDO('sqlite:data/db.sqlite');
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
|
|
|
//Mapping PHP errors to exceptions
|
|
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
|
|
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
|
|
}
|
|
set_error_handler("exception_error_handler");
|
|
|
|
// Files we need
|
|
require_once 'vendor/autoload.php';
|
|
|
|
// Backends
|
|
$authBackend = new \Sabre\DAV\Auth\Backend\PDO($pdo);
|
|
$calendarBackend = new \Sabre\CalDAV\Backend\PDO($pdo);
|
|
$principalBackend = new \Sabre\DAVACL\PrincipalBackend\PDO($pdo);
|
|
|
|
// Directory structure
|
|
$tree = array(
|
|
new \Sabre\CalDAV\Principal\Collection($principalBackend),
|
|
new \Sabre\CalDAV\CalendarRootNode($principalBackend, $calendarBackend),
|
|
);
|
|
|
|
$server = new \Sabre\DAV\Server($tree);
|
|
|
|
if (isset($baseUri))
|
|
$server->setBaseUri($baseUri);
|
|
|
|
/* Server Plugins */
|
|
$authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend,'SabreDAV');
|
|
$server->addPlugin($authPlugin);
|
|
|
|
$aclPlugin = new \Sabre\DAVACL\Plugin();
|
|
$server->addPlugin($aclPlugin);
|
|
|
|
$caldavPlugin = new \Sabre\CalDAV\Plugin();
|
|
$server->addPlugin($caldavPlugin);
|
|
|
|
// Support for html frontend
|
|
$browser = new \Sabre\DAV\Browser\Plugin();
|
|
$server->addPlugin($browser);
|
|
|
|
// And off we go!
|
|
$server->exec();
|