php中yar框架實例用法講解
RPC是在TCP協(xié)議上面的網(wǎng)絡傳輸和遠程服務調(diào)用,通過TCP來進行數(shù)據(jù)傳輸。底層都是tcp,更高層的封裝。因此這就是應用間通信間不直接用TCP,而是選用RPC框架的原因,本章教學內(nèi)容就是給大家?guī)韗pc中yar框架的使用,內(nèi)容簡單明了,希望對每一位在學習php道路上的小伙伴都能得到掌握了解。
編譯:
/usr/local/php/bin/phpize
配置:
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/yar.so
使用方法:
Yar_Server {
protected $_executor ;
final public __construct ( Object $obj )
public handle ( void ) : boolean
}
PHP 安裝yar的知識點:
yar全部可用版本見:https://pecl.php.net/package/yar,根據(jù)自己的需要下載編譯安裝即可。
注:yar和PHP版本不一致會導致編譯失敗,如果出現(xiàn)編譯失敗請下載其他版本的yar重新編譯
# wget https://pecl.php.net/get/yar-1.2.3.tgz # tar -xf yar-1.2.3.tgz # cd yar-1.2.3 # ls config.m4 LICENSE tests yar.c yar_exception.c yar_packager.h yar_request.c yar_response.h yar_transport.c config.w32 packagers tools yar_client.c yar_exception.h yar_protocol.c yar_request.h yar_server.c yar_transport.h CREDITS php_yar.h transports yar_client.h yar_packager.c yar_protocol.h yar_response.c yar_server.h # ls /usr/local/php/php7/bin/ pear peardev pecl phar phar.phar php php-cgi php-config phpdbg phpize # /usr/local/php/php7/bin/phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 # ./configure --with-php-config=/usr/local/php/php7/bin/php-config # make && make install ................ ............ Installing shared extensions: /usr/local/php/php7/lib/php/extensions/no-debug-non-zts-20170718/ # ls /usr/local/php/php7/lib/php/extensions/no-debug-non-zts-20170718/ mongodb.so opcache.a opcache.so openssl.so pcntl.so phalcon.so redis.so swoole.so xhprof.so yaf.so yar.so zlib.so
到此這篇關(guān)于php中yar框架實例用法講解的文章就介紹到這了,更多相關(guān)php中yar框架如何使用內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
php數(shù)組函數(shù)序列之a(chǎn)rray_intersect() 返回兩個或多個數(shù)組的交集數(shù)組
array_intersect() 函數(shù)返回兩個或多個數(shù)組的交集數(shù)組。結(jié)果數(shù)組包含了所有在被比較數(shù)組中,也同時出現(xiàn)在所有其他參數(shù)數(shù)組中的值,鍵名保留不變。2011-11-11
php實現(xiàn)快速對二維數(shù)組某一列進行組裝的方法小結(jié)
這篇文章主要介紹了php實現(xiàn)快速對二維數(shù)組某一列進行組裝的方法,涉及PHP數(shù)組遍歷、轉(zhuǎn)換、拆分等相關(guān)操作技巧,需要的朋友可以參考下2019-12-12

