From: Christian Weiske Date: Wed, 20 Dec 2023 21:11:30 +0000 (+0100) Subject: Support simple vCard configuration X-Git-Tag: v0.7.0~2 X-Git-Url: https://git.cweiske.de/bdrem.git/commitdiff_plain/e551d5037811aff231479067138946816f8c816d?ds=inline Support simple vCard configuration --- diff --git a/data/bdrem.config.php.dist b/data/bdrem.config.php.dist index 46773ed..55dbe81 100644 --- a/data/bdrem.config.php.dist +++ b/data/bdrem.config.php.dist @@ -54,12 +54,7 @@ $source = [ ]; //Source: Directory of .vcf vCard files (2 subfolder levels supported) -$source = [ - 'vCard', - [ - 'folder' => '/home/cweiske/dev/contacts-backup/contacts' - ] -]; +$source = ['vCard', '/home/user/contacts/']; $daysPrev = 3; diff --git a/src/bdrem/Source/vCard.php b/src/bdrem/Source/vCard.php index 98b8e00..3d55915 100644 --- a/src/bdrem/Source/vCard.php +++ b/src/bdrem/Source/vCard.php @@ -37,8 +37,13 @@ class Source_vCard /** * Set the VCard folder path */ - public function __construct(array $config) + public function __construct($config) { + if (is_string($config)) { + $config = array( + 'folder' => $config + ); + } $this->folder = $config['folder']; if (!is_dir($this->folder)) { throw new \Exception(