summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/de/weechat_scripting.de.adoc16
-rw-r--r--doc/en/weechat_scripting.en.adoc16
-rw-r--r--doc/fr/weechat_scripting.fr.adoc16
-rw-r--r--doc/it/weechat_scripting.it.adoc16
-rw-r--r--doc/ja/weechat_scripting.ja.adoc16
-rw-r--r--doc/pl/weechat_scripting.pl.adoc16
6 files changed, 42 insertions, 54 deletions
diff --git a/doc/de/weechat_scripting.de.adoc b/doc/de/weechat_scripting.de.adoc
index be02f4b8f..e37aa994f 100644
--- a/doc/de/weechat_scripting.de.adoc
+++ b/doc/de/weechat_scripting.de.adoc
@@ -191,12 +191,8 @@ weechat.print("", "Hallo, von einem javascript Skript!");
[source,php]
----
-<?php
-
-new class {
- function __construct() {
- weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test Skript', '', '');
- weechat_printf('', 'Hallo, von einem PHP Skript!');
+weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test Skript', '', '');
+weechat_print('', 'Hallo, von einem PHP Skript!');
----
[[load_script]]
@@ -407,10 +403,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]]
diff --git a/doc/en/weechat_scripting.en.adoc b/doc/en/weechat_scripting.en.adoc
index f8e4c2f38..212adc155 100644
--- a/doc/en/weechat_scripting.en.adoc
+++ b/doc/en/weechat_scripting.en.adoc
@@ -185,12 +185,8 @@ weechat.print("", "Hello, from javascript script!");
[source,php]
----
-<?php
-
-new class {
- function __construct() {
- weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
- weechat_printf('', 'Hello, from PHP script!');
+weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
+weechat_print('', 'Hello, from PHP script!');
----
[[load_script]]
@@ -394,10 +390,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]]
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]]
diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc
index 77d5f520a..cebf908c2 100644
--- a/doc/it/weechat_scripting.it.adoc
+++ b/doc/it/weechat_scripting.it.adoc
@@ -194,12 +194,8 @@ weechat.print("", "Hello, from javascript script!");
[source,php]
----
-<?php
-
-new class {
- function __construct() {
- weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
- weechat_printf('', 'Hello, from PHP script!');
+weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
+weechat_print('', 'Hello, from PHP script!');
----
[[load_script]]
@@ -410,10 +406,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]]
diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc
index 3f0d59c5d..0950a477a 100644
--- a/doc/ja/weechat_scripting.ja.adoc
+++ b/doc/ja/weechat_scripting.ja.adoc
@@ -191,12 +191,8 @@ weechat.print("", "Hello, from javascript script!");
[source,php]
----
-<?php
-
-new class {
- function __construct() {
- weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
- weechat_printf('', 'Hello, from PHP script!');
+weechat_register('test_php', 'FlashCode', '1.0', 'GPL3', 'Test script', '', '');
+weechat_print('', 'Hello, from PHP script!');
----
[[load_script]]
@@ -402,10 +398,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]]
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]]