Getting store.php to work with PHP 7+

89 views
Skip to first unread message

Billy

unread,
Nov 15, 2017, 10:44:55 AM11/15/17
to TiddlyWiki
Hello Tiddlers,

I've got TiddlyWiki running on a server and saving it with the infamous store.php file. It works great. But, I had to remove a few lines of code in the store.php file to make it work. My server is using PHP 7 and split() has been removed in this version of PHP. A replacement is preg_split(), but I couldn't get that to work either. To experiment, I decided to see what happens if I just remove this "get options" code. I went for it, and now everything saves with no errors or warnings. 

// get options
foreach($optionArr as $o) {
list($key, $value) = split('=', $o);
$options[$key] = $value;
}

If this code is important, could anyone tell me how to code it properly for PHP 7+ ? The error I get if I change split() to preg_split() is that the delimiter is missing. 

Thanks,
Billy

Mark S.

unread,
Nov 15, 2017, 11:04:21 AM11/15/17
to TiddlyWiki
Apparently "explode" can be used instead.
Reply all
Reply to author
Forward
0 new messages