diff --git a/sky-php7ext/README.md b/sky-php7ext/README.md index b813786d343763fd4407fd758badcd47c24ea6d5..3ad96ce0e1d8ab031662efbb4640f2fad880a3ab 100644 --- a/sky-php7ext/README.md +++ b/sky-php7ext/README.md @@ -11,41 +11,44 @@ ### Installation -To install PHP SkyWalking Class, simply: - - +To install PHP SkyWalking extend, simply: +copy ini to php.ini +commands:: + + git clone https://github.com/SkywalkingContrib/skywalking-php-sdk.git + cd skywalking-php-sdk/sky-php7ext + phpize + .configure + make -j [number_of_processor_cores] # eg. make -j 4 + make install ### Requirements -PHP Curl Class works with PHP 5.0,5.3, 5.4, 5.5, 5.6, 7.0, and HHVM. +the current phpext works with PHP 7.0-7.9.99 。 +this extension references something external, use with: pphcurl、phpjson and phpstandard + +### Documentation +- https://github.com/OpenSkywalking/skywalking/wiki ### Quick Start and Examples - + set php.ini skywalking.auto_open = On OR skywalking.auto_open = OFF As below: + // must put these code at the beginning !!! - // that would auto register shutdown function !!! - - include_once ("./SkyWalking.php");// or use composer - - //LOG_PATH is skywalking's logfile path - SkyWalking::getInstance("mapi")->setLogPath(LOG_PATH)->setSamplingRate(5); .... .... - + + $ch = curl_init(); curl_setopt($ch); - .... - .... - - SkyWalking::getInstance()->startSpanOfCurl("www.dangdang.com", $headers); - + SkyWalking::getInstance()->startSpanOfCurl("www.api.com", $headers); .... .... curl_setopt($ch); $rs = curl_exec($ch); - SkyWalking::getInstance()->endSpanOfcurl($curl); + SkyWalking::getInstance()->endSpanOfcurl($ch); .... .... \ No newline at end of file diff --git a/sky-php7ext/skywalking.c b/sky-php7ext/skywalking.c index c8273e35627245bdf9b1d840be96a03a85dd6437..d085a230b92a0e95aa2191f3b8e0ccb9cf18a361 100644 --- a/sky-php7ext/skywalking.c +++ b/sky-php7ext/skywalking.c @@ -925,8 +925,6 @@ static void _init(const char *appCode, zval *this_ptr){ add_assoc_null(&allparts_property, SKYWALKING_ENDTIME); SKY_ADD_ASSOC_ZVAL(&allparts_property, SKYWALKING_FATHER_NODE_DATA); SKY_ADD_ASSOC_ZVAL(&allparts_property, SKYWALKING_SPANS_NODE_DATA); - //add_assoc_zval(&allparts_property, SKYWALKING_FATHER_NODE_DATA, &null_array); - //add_assoc_zval(&allparts_property, SKYWALKING_SPANS_NODE_DATA, &null_array); add_assoc_null(&allparts_property, SKYWALKING_APP_CODE); add_assoc_null(&allparts_property, SKYWALKING_DISTRIBUTED_TRACEIDS); zend_update_property(skywalking_ce_entry, this_ptr, ZEND_STRL("_allPartsNodesStruct"), &allparts_property); @@ -975,7 +973,7 @@ static void _init(const char *appCode, zval *this_ptr){ zend_update_property_string(skywalking_ce_entry, this_ptr, ZEND_STRL("_appCode"), appCode); - //对节点数据进行结构初始化 + //对节点数据进行结构初始化 zval *all_parts_nodes_struct, all_node_data; all_parts_nodes_struct = zend_read_property(skywalking_ce_entry, this_ptr, ZEND_STRL("_allPartsNodesStruct"), 1, NULL); array_init(&all_node_data);