Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloud-config-converter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-05-04 14:36:31 +0300
committerMorris Jobke <hey@morrisjobke.de>2020-05-04 14:36:31 +0300
commit1d2c17a9e9ecb6efdb3acd27e51ba06af4104af2 (patch)
tree2b8b303fa0ad299dec1658988a9503a6d86f48dd /convert.php
parentc46b30b1d7d350b2ce10febe335a0e2c00f82de2 (diff)
Fix detection of config sample for new array syntax
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'convert.php')
-rw-r--r--convert.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/convert.php b/convert.php
index 6d9fe57..6cc8cdd 100644
--- a/convert.php
+++ b/convert.php
@@ -105,10 +105,16 @@ $docBlock = file_get_contents($CONFIG_SAMPLE_FILE);
// trim everything before this (including itself)
$start = '$CONFIG = array(';
+if (strpos($docBlock, $start) === false) {
+ $start = '$CONFIG = [';
+}
$docBlock = substr($docBlock, strpos($docBlock, $start) + strlen($start));
// trim the end of the config variable
$end = ');';
+if (strrpos($docBlock, $end) === false) {
+ $end = '];';
+}
$docBlock = substr($docBlock, 0, strrpos($docBlock, $end));
// split on '/**'