I want to implement Jaxl in my project as class, But all Jaxl examples are function based.All examples use closure to run callbacks.Methods in class are not accessible like function base programming.How can I call wait_for_register_form() in the class? My base class implementation is like this(Notice bold comment):
<?php
class XmppsController extends AppController {
public function test() {
require_once 'JAXL/jaxl.php';
global $client;
$client = new JAXL(array(
'jid' => 'localhost',
'log_level' => JAXL_INFO
));
$client->require_xep(array(
'0077' // InBand Registration
));
global $thisObj;
$thisObj = $this;
$client->add_cb('on_stream_features', function($stanza) {
global $client,$thisObj;
$client->xeps['0077']->get_form('localhost');
return "wait_for_register_form"; **//it calls wait_for_register_form() function, but I want call this function in class. how can I solve this problem?**
});
$client->start();
echo "done\n";
}
public function wait_for_register_form($event, $args) {
// something
}
}