mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 18:08:49 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
49
dav/SabreDAV/tests/Sabre/TestUtil.php
Normal file
49
dav/SabreDAV/tests/Sabre/TestUtil.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
class Sabre_TestUtil {
|
||||
|
||||
/**
|
||||
* This function deletes all the contents of the temporary directory.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
static function clearTempDir() {
|
||||
|
||||
self::deleteTree(SABRE_TEMPDIR,false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static private function deleteTree($path,$deleteRoot = true) {
|
||||
|
||||
foreach(scandir($path) as $node) {
|
||||
|
||||
if ($node=='.' || $node=='..') continue;
|
||||
$myPath = $path.'/'. $node;
|
||||
if (is_file($myPath)) {
|
||||
unlink($myPath);
|
||||
} else {
|
||||
self::deleteTree($myPath);
|
||||
}
|
||||
|
||||
}
|
||||
if ($deleteRoot) {
|
||||
rmdir($path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static function getMySQLDB() {
|
||||
|
||||
try {
|
||||
$pdo = new PDO(SABRE_MYSQLDSN,SABRE_MYSQLUSER,SABRE_MYSQLPASS);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
||||
return $pdo;
|
||||
} catch (PDOException $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue