国内图片下载网站,做免费看电影的网站不违法吗,网站添加新闻,泸州市住房与城乡建设局网站运行原理 http://www.phpchina.com/article-40203-1.htmlPHP底层开发 可以理解为就是C的开发#xff0c;那么简单地说如果我们要查看某个PHP函数的底层实现怎么看呢#xff1f;需要PHP源码包#xff1a;http://www.php.net/downloads.php主要目录是Zend 和ext(写扩展的目录…运行原理 http://www.phpchina.com/article-40203-1.html PHP底层开发 可以理解为就是C的开发那么简单地说如果我们要查看某个PHP函数的底层实现怎么看呢 需要PHP源码包http://www.php.net/downloads.php 主要目录是Zend 和ext(写扩展的目录) 举个栗子如果需要查看curl_exec()如何查看。 我们知道curl_exec 是CURl扩展中的函数那么源码目录大概是src/ext/crul/ 然后我们发现 interface.c 下实现了 这个PHP方法 部分源码如下 PHP_FUNCTION(curl_exec) { CURLcode error; zval *zid; php_curl *ch; if (zend_parse_parameters(ZEND_NUM_ARGS(), r, zid) FAILURE) { return; } if ((ch (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) NULL) { RETURN_FALSE; } _php_curl_verify_handlers(ch, 1); _php_curl_cleanup_handle(ch); error curl_easy_perform(ch-cp); SAVE_CURL_ERROR(ch, error); if (error ! CURLE_OK error ! CURLE_PARTIAL_FILE) { smart_str_free(ch-handlers-write-buf); RETURN_FALSE; } if (!Z_ISUNDEF(ch-handlers-std_err)) { php_stream *stream; stream (php_stream*)zend_fetch_resource2_ex(ch-handlers-std_err, NULL, php_file_le_stream(), php_file_le_pstream()); if (stream) { php_stream_flush(stream); } } if (ch-handlers-write-method PHP_CURL_RETURN ch-handlers-write-buf.s) { smart_str_0(ch-handlers-write-buf); RETURN_STR_COPY(ch-handlers-write-buf.s); } if (ch-handlers-write-method PHP_CURL_FILE ch-handlers-write-fp) { fflush(ch-handlers-write-fp); } if (ch-handlers-write_header-method PHP_CURL_FILE ch-handlers-write_header-fp) { fflush(ch-handlers-write_header-fp); } if (ch-handlers-write-method PHP_CURL_RETURN) { RETURN_EMPTY_STRING(); } else { RETURN_TRUE; } } 这就是底层源码 了但是我疑问的是 如果开发完扩展如何加入PHP包中生效毕竟查看PHP Module包的时候只发现了一堆.dll文件而且是非可读的码呵呵那是因为那是C被编译之后的文件。 那么来看一组干货 windows下开发PHP扩展dll http://www.360doc.com/content/14/0509/16/12091178_376141791.shtml http://blog.csdn.net/evkj2013/article/details/52346792 这下就全部清晰了。转载于:https://www.cnblogs.com/linewman/p/9918807.html