summaryrefslogtreecommitdiff
path: root/ext/ftp/php_ftp.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-03-11 23:58:59 +0100
committerAnatol Belski <ab@php.net>2015-03-11 23:58:59 +0100
commitd2ee0840d214de5b9df98d3cf65d798100c78328 (patch)
tree9d23e0d9f4c91d92fe984113658f6ec4363f7d80 /ext/ftp/php_ftp.c
parent4ee0395a4ab230fb5b3274ee9476cbcc00ccb872 (diff)
downloadphp-git-d2ee0840d214de5b9df98d3cf65d798100c78328.tar.gz
don't depend on ext/openssl for ftp ssl support
instead just link against the openssl and init manually, that's more flexible
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r--ext/ftp/php_ftp.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 1a6304672d..2701891cfc 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -281,22 +281,10 @@ const zend_function_entry php_ftp_functions[] = {
PHP_FE_END
};
-#ifdef HAVE_FTP_SSL
-/* {{{ ftp_deps */
-static const zend_module_dep ftp_deps[] = {
- ZEND_MOD_REQUIRED("openssl")
- {NULL, NULL, NULL}
-};/*}}}*/
-#endif
-
zend_module_entry php_ftp_module_entry = {
STANDARD_MODULE_HEADER_EX,
NULL,
-#ifdef HAVE_FTP_SSL
- ftp_deps,
-#else
NULL,
-#endif
"ftp",
php_ftp_functions,
PHP_MINIT(ftp),
@@ -321,6 +309,15 @@ static void ftp_destructor_ftpbuf(zend_resource *rsrc)
PHP_MINIT_FUNCTION(ftp)
{
+#ifdef HAVE_FTP_SSL
+ SSL_library_init();
+ OpenSSL_add_all_ciphers();
+ OpenSSL_add_all_digests();
+ OpenSSL_add_all_algorithms();
+
+ SSL_load_error_strings();
+#endif
+
le_ftpbuf = zend_register_list_destructors_ex(ftp_destructor_ftpbuf, NULL, le_ftpbuf_name, module_number);
REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS);