summaryrefslogtreecommitdiff
path: root/doc/fr
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-09-09 15:20:38 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-09-09 15:20:38 +0200
commit65a6a6dff2b244700f148c1b283cb9336e525196 (patch)
tree95e007a6257c3b37e9747e62e1f0dd21c28be591 /doc/fr
parente5acc3977042c8ad6d8e9c60663fb052e377b5bb (diff)
downloadweechat-65a6a6dff2b244700f148c1b283cb9336e525196.zip
doc: fix PHP examples in scripting guide
Diffstat (limited to 'doc/fr')
-rw-r--r--doc/fr/weechat_scripting.fr.adoc16
1 files changed, 7 insertions, 9 deletions
diff --git a/doc/fr/weechat_scripting.fr.adoc b/doc/fr/weechat_scripting.fr.adoc
index 2aef5c490..721ce8a70 100644
--- a/doc/fr/weechat_scripting.fr.adoc
+++ b/doc/fr/weechat_scripting.fr.adoc
@@ -189,12 +189,8 @@ weechat.print("", "Bonjour, du script javascript !");
[source,php]
----
-<?php
-
-new class {
- function __construct() {
- weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Script de test', '', '');
- weechat_printf('', 'Bonjour, du script PHP !');
+weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Script de test', '', '');
+weechat_print('', 'Bonjour, du script PHP !');
----
[[load_script]]
@@ -406,10 +402,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]]