Custom section parsers broken

49 views
Skip to first unread message

Vlad Sidorov

unread,
Jan 25, 2020, 1:26:31 PM1/25/20
to Fat-Free Framework
I recived error Invalid hive key 'widget > Config->parse' (for v3.7.0 and 3.7.1)

ini file:
[widget > Config->parse]
option1 = foo
option2 = bar

php file:
class Config extends \Prefab {

/** @var static \Base */
protected $f3;

function __construct() {
$this->f3 = \Base::instance();
}

public function parse($key, $value, $scope) {
$this->f3->set($scope.'.'.$key, $value);
}
}

But for v 3.6.5 this parsed fine.

xfra35

unread,
Jan 26, 2020, 2:07:16 AM1/26/20
to Fat-Free Framework
I wonder how this could work earlier. The correct syntax is:

Vlad Sidorov

unread,
Jan 26, 2020, 3:22:28 AM1/26/20
to Fat-Free Framework


воскресенье, 26 января 2020 г., 9:07:16 UTC+2 пользователь xfra35 написал:
Thanks, but in v3.6.0 was added feature:
  • NEW: custom config section parser, i.e. [conf > Foo::bar]
For new syntax parser function recived 3 arguments ($key, $value, $scope), but in case [conf:Foo::bar] Foo::bar recive only 1 argument $value.
This new syntax worked fine until v3.7.0.

xfra35

unread,
Jan 26, 2020, 8:45:42 AM1/26/20
to Fat-Free Framework
Oh indeed. I forgot that one.

Vlad Sidorov

unread,
Jan 26, 2020, 9:45:00 AM1/26/20
to Fat-Free Framework
You are right. This feature has been broken after fixing config section detection.

воскресенье, 26 января 2020 г., 15:45:42 UTC+2 пользователь xfra35 написал:

ikkez

unread,
Jan 28, 2020, 8:43:53 AM1/28/20
to Fat-Free Framework
should be fixed now

Vlad Sidorov

unread,
Jan 28, 2020, 9:30:22 AM1/28/20
to Fat-Free Framework
Thank you. Now everything works correctly.

вторник, 28 января 2020 г., 15:43:53 UTC+2 пользователь ikkez написал:
Reply all
Reply to author
Forward
0 new messages