doc: fix PHP examples in scripting guide
parent
e5acc39770
commit
65a6a6dff2
|
@ -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]]
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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]]
|
||||
|
|
|
@ -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]]
|
||||
|
|
Loading…
Reference in New Issue