PHP 8.1.28 Released!

Yar_Server::__construct

(PECL yar >= 1.0.0)

Yar_Server::__constructRegistrar un servidor

Descripción

final public Yar_Server::__construct(Object $obj)

Configurar un Servidor Yar HTTP RPC. Todos los métodos públicos de $obj serán registrados como un servicio RPC.

Parámetros

obj

Un objeto, todos sus métodos publicos serán registrados como servicioes RPC.

Valores devueltos

Una instancia de Yar_Server.

Ejemplos

Ejemplo #1 Ejemplo de Yar_Server::__construct()

<?php
class API {
/**
* the doc info will be generated automatically into service info page.
* @params
* @return
*/
public function some_method($parameter, $option = "foo") {
return
"some_method";
}

protected function
client_can_not_see() {
}
}

$service = new Yar_Server(new API());
$service->handle();
?>

El resultado del ejemplo sería algo similar a:


Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top