diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-09 15:20:38 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-09-09 15:20:38 +0200 |
commit | 65a6a6dff2b244700f148c1b283cb9336e525196 (patch) | |
tree | 95e007a6257c3b37e9747e62e1f0dd21c28be591 /doc/pl | |
parent | e5acc3977042c8ad6d8e9c60663fb052e377b5bb (diff) | |
download | weechat-65a6a6dff2b244700f148c1b283cb9336e525196.zip |
doc: fix PHP examples in scripting guide
Diffstat (limited to 'doc/pl')
-rw-r--r-- | doc/pl/weechat_scripting.pl.adoc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/doc/pl/weechat_scripting.pl.adoc b/doc/pl/weechat_scripting.pl.adoc index 02d2d1307..e7bc5259a 100644 --- a/doc/pl/weechat_scripting.pl.adoc +++ b/doc/pl/weechat_scripting.pl.adoc @@ -191,12 +191,8 @@ weechat.print("", "Witaj ze skryptu javascript!"); [source,php] ---- -<?php - -new class { - function __construct() { - weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Skrypt testowy', '', ''); - weechat_printf('', 'Witaj ze skryptu PHP!'); +weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Skrypt testowy', '', ''); +weechat_print('', 'Witaj ze skryptu PHP!'); ---- [[load_script]] @@ -400,10 +396,12 @@ weechat.hook_timer(1000, 0, 1, "timer_cb", "test"); [source,php] ---- -weechat_hook_timer(1000, 0, 1, function ($data, remaining_calls) { - weechat_printf('', 'timer! data=' . $data); +$timer_cb = function ($data, $remaining_calls) { + weechat_print('', 'timer! data=' . $data); return WEECHAT_RC_OK; -}, 'test'); +}; + +weechat_hook_timer(1000, 0, 1, $timer_cb, 'test'); ---- [[script_api]] |