« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 9 of about 9 for setDefaultCallback (0.003 sec.)
EventHttp::setDefaultCallback — Sets default callback to handle requests that a... 13732
EventHttp::setDefaultCallback (PECL event >= 1.4.0-beta) EventHttp::setDefaultCallback — Sets default callback to handle requests that are not caught by specific callbacks 説明 public function EventHttp::setDefaultCallback ( string $cb , st ... ser custom data passed to the callback. 戻り値 成功した場合に true を、失敗した場合に false を返します。 例 例1 EventHttp::setDefaultCallback() example <?php $base = new EventBase (); $http = new EventHttp ( $base ); $socket = socket_create ( AF_INET , SOCK_STREAM ... , SOL_TCP ); if (! $http -> bind ( "127.0.0.1" , 8088 )) { exit( "bind(1) failed\n" ); }; $http -> setDefaultCallback (function( $req ) { echo "URI: " , $req -> getUri (), PHP_EOL ; $req -> sendReply ( 200 , "OK" ); }); $base -> dispatch () ...
https://man.mtool.work/php/8.3/eventhttp.setdefaultcallback.html
The EventHttp class | PHP 8.3 9850
The EventHttp class (PECL event >= 1.4.0-beta) はじめに Represents HTTP server. クラス概要 final class EventHttp { /* メソッド */ public function accept ( mixed $socket ): bool public function addServerAlias ( string $alias ): bool public f ... s ( int $methods ): void public function setCallback ( string $path , string $cb , string $arg = ? ): void public function setDefaultCallback ( string $cb , string $arg = ? ): void public function setMaxBodySize ( int $value ): void public function setMaxHeadersSi ... ccepted by this server, and passed to user callbacks EventHttp::setCallback — Sets a callback for specified URI EventHttp::setDefaultCallback — Sets default callback to handle requests that are not caught by specific callbacks EventHttp::setMaxBodySize — Sets maxi ...
https://man.mtool.work/php/8.3/class.eventhttp.html
EventHttp::setCallback — Sets a callback for specified URI | PHP 8.3 9005
EventHttp::setCallback (PECL event >= 1.4.0-beta) EventHttp::setCallback — Sets a callback for specified URI 説明 public function EventHttp::setCallback ( string $path , string $cb , string $arg = ? ): void Sets a callback for specified URI ... ttp -> setCallback ( "/dump" , "_http_dump" , array( 4 , 8 )); $http -> setCallback ( "/about" , "_http_about" ); $http -> setDefaultCallback ( "_http_default" , "custom data value" ); $http -> bind ( "0.0.0.0" , 8010 ); $base -> loop (); ?> 上の例の出力は、 たとえ ... ば以下のようになります。 a=12 HTTP/1.0 200 OK Content-Type: text/html; charset=ISO-8859-1 Connection: close 参考 EventHttp::setDefaultCallback() - Sets default callback to handle requests that are not caught by specific callbacks 他のマニュアルの関連ページ Python h ...
https://man.mtool.work/php/8.3/eventhttp.setcallback.html
EventHttp::accept — Makes an HTTP server accept connections on the specified so... 8286
EventHttp::accept (PECL event >= 1.2.6-beta) EventHttp::accept — Makes an HTTP server accept connections on the specified socket stream or resource 説明 public function EventHttp::accept ( mixed $socket ): bool Makes an HTTP server accept c ... "(some-page)\n" ; echo "URI: " , $req -> getUri (), PHP_EOL ; $req -> sendReply ( 200 , "OK" ); echo "OK\n" ; }); $http -> setDefaultCallback (function ( $req ) { echo "URI: " , $req -> getUri (), PHP_EOL ; $req -> sendReply ( 200 , "OK" ); echo "OK\n" ; }); $sign ...
https://man.mtool.work/php/8.3/eventhttp.accept.html
EventHttpConnection::setCloseCallback — Set callback for connection close | PHP... 8286
EventHttpConnection::setCloseCallback (PECL event >= 1.8.0) EventHttpConnection::setCloseCallback — Set callback for connection close 説明 public function EventHttpConnection::setCloseCallback ( callable $callback , mixed $data = ? ): void ... rt <= 0 || $port > 65535 ) { exit( "Invalid port" ); } $base = new EventBase (); $http = new EventHttp ( $base ); $http -> setDefaultCallback ( "_http_default" , NULL ); $http -> bind ( "0.0.0.0" , $port ); $base -> loop (); ?> 他のマニュアルの関連ページ Python ht ...
https://man.mtool.work/php/8.3/eventhttpconnection.setclosecallback.html
EventHttp::__construct — Constructs EventHttp object (the HTTP server) | PHP 8.... 8178
EventHttp::__construct (PECL event >= 1.2.6-beta) EventHttp::__construct — Constructs EventHttp object (the HTTP server) 説明 public function EventHttp::__construct ( EventBase $base , EventSslContext $ctx = null ) Constructs the HTTP serve ... ttp -> setCallback ( "/dump" , "_http_dump" , array( 4 , 8 )); $http -> setCallback ( "/about" , "_http_about" ); $http -> setDefaultCallback ( "_http_default" , "custom data value" ); $http -> bind ( "0.0.0.0" , 8010 ); $base -> loop (); ?> 上の例の出力は、 たとえ ...
https://man.mtool.work/php/8.3/eventhttp.construct.html
Event | PHP 8.3 7962
Event はじめに This is an extension to efficiently schedule I/O, time and signal based events using the best I/O notification mechanism available for specific platform. This is a port of libevent to the PHP infrastructure. 注意 : Note, Wind ... ccepted by this server, and passed to user callbacks EventHttp::setCallback — Sets a callback for specified URI EventHttp::setDefaultCallback — Sets default callback to handle requests that are not caught by specific callbacks EventHttp::setMaxBodySize — Sets maxi ...
https://man.mtool.work/php/8.3/book.event.html
例 | PHP 8.3 7962
例 例1 Simple HTTP client <?php // Read callback function readcb ( $bev , $base ) { //$input = $bev->input; //$bev->getInput(); //$pos = $input->search("TTP"); $pos = $bev -> input -> search ( "TTP" ); while (( $n = $bev -> input -> remove ... ttp -> setCallback ( "/dump" , "_http_dump" , array( 4 , 8 )); $http -> setCallback ( "/about" , "_http_about" ); $http -> setDefaultCallback ( "_http_default" , "custom data value" ); $http -> bind ( "0.0.0.0" , 8010 ); $base -> loop (); ?> 上の例の出力は、 たとえ ... y( 4 , 8 )); $http -> setCallback ( "/about" , "_http_about" ); $http -> setCallback ( "/err400" , "_http_400" ); $http -> setDefaultCallback ( "_http_default" , "custom data value" ); $http -> bind ( $ip , $port ); $base -> dispatch (); 例10 OpenSSL connection <? ...
https://man.mtool.work/php/8.3/event.examples.html
関数・メソッド | PHP 8.3 7549
関数・メソッド マニュアル内の全関数およびメソッドの一覧 a b c d e f g h i j k l m n o p q r s t u v w x y z _ a abs - 絶対値 acos - 逆余弦(アークコサイン) acosh - 逆双曲線余弦(アークハイパボリックコサイン) addcslashes - C 言語と同様にス ... ccepted by this server, and passed to user callbacks EventHttp::setCallback - Sets a callback for specified URI EventHttp::setDefaultCallback - Sets default callback to handle requests that are not caught by specific callbacks EventHttp::setMaxBodySize - Sets maxi ...
https://man.mtool.work/php/8.3/indexes.functions.html
PREV 1 NEXT