diff --git a/cmake/FindPHP.cmake b/cmake/FindPHP.cmake index ade865ff1..f81f92668 100644 --- a/cmake/FindPHP.cmake +++ b/cmake/FindPHP.cmake @@ -29,13 +29,16 @@ endif() if(NOT PHP_FOUND) find_program(PHP_CONFIG_EXECUTABLE NAMES + php-config8.1 php-config81 php-config8.0 php-config80 + php-config8 php-config7.4 php-config74 php-config7.3 php-config73 php-config7.2 php-config72 php-config7.1 php-config71 php-config7.0 php-config70 - php-config php-config7 + php-config7 + php-config ) if (PHP_CONFIG_EXECUTABLE) execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --prefix OUTPUT_VARIABLE PHP_LIB_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -44,7 +47,7 @@ if(NOT PHP_FOUND) execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE PHP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) if(${PHP_VERSION} MATCHES "^[78]") find_library(PHP_LIB - NAMES php8.0 php7.4 php7.3 php7.2 php7.1 php7.0 php7 + NAMES php8.1 php8.0 php8 php7.4 php7.3 php7.2 php7.1 php7.0 php7 php HINTS ${PHP_LIB_PREFIX} ${PHP_LIB_PREFIX}/lib ${PHP_LIB_PREFIX}/lib64 ) if(PHP_LIB) @@ -59,9 +62,9 @@ if(NOT PHP_FOUND) endif() if(NOT PHP_FOUND) - message(WARNING "Could not find libphp7. " + message(WARNING "Could not find libphp. " "Ensure PHP >=7.0.0 development libraries are installed and compiled with `--enable-embed`. " "Ensure `php-config` is in `PATH`. " - "You may set `-DCMAKE_LIBRARY_PATH=...` to the directory containing libphp7." + "You may set `-DCMAKE_LIBRARY_PATH=...` to the directory containing libphp." ) endif() diff --git a/configure.ac b/configure.ac index d74ebd097..a6cd9f1f9 100644 --- a/configure.ac +++ b/configure.ac @@ -833,6 +833,7 @@ if test "x$enable_php" = "xyes" ; then PHP_CFLAGS="" PHP_LFLAGS="" + PHP_VERSIONS="8.1 81 8.0 80 8 7.4 74 7.3 73 7.2 72 7.1 71 7.0 70 7 $php_suffix" if test -n "$php_inc"; then CFLAGS="$CFLAGS -I$php_inc" @@ -845,7 +846,7 @@ if test "x$enable_php" = "xyes" ; then if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then AC_MSG_CHECKING(for PHP headers and libraries with pkg-config) echo - for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do + for l in $PHP_VERSIONS "" ; do pkgconfig_php_found=`$PKGCONFIG --exists php$l 2>/dev/null` if test "x$?" = "x0" ; then pkgconfig_php_found=`$PKGCONFIG --atleast-version=7 php$l 2>/dev/null` @@ -862,11 +863,12 @@ if test "x$enable_php" = "xyes" ; then if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then PHPCONFIG="" AC_MSG_CHECKING(for PHP headers and libraries with php-config) - for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do + echo + for l in $PHP_VERSIONS "" ; do AC_CHECK_PROG(PHPCONFIG, "php-config$l", "php-config$l") if test "x$PHPCONFIG" != "x" ; then php_config_version=`$PHPCONFIG --version` - if test "x${php_config_version#7}" != "x${php_config_version}" ; then + if echo "x$php_config_version" | grep -e "^x7" -e "^x8" 1>/dev/null 2>&1 ; then PHP_VERSION=$php_config_version PHP_CFLAGS=`$PHPCONFIG --includes` PHP_LFLAGS="-L$($PHPCONFIG --prefix)/lib/ $($PHPCONFIG --libs) -lphp$l" @@ -883,23 +885,25 @@ if test "x$enable_php" = "xyes" ; then if test "x$ac_found_php_header" = "xyes" ; then PHP_CFLAGS="$CFLAGS" fi - for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do - AC_CHECK_LIB(php$l,php_execute_script,ac_found_php_lib="yes",ac_found_php_lib="no") - if test "x$ac_found_php_lib" = "xyes" ; then - PHP_VERSION=">=7.0.0" + for l in $PHP_VERSIONS "" ; do + for PHP_LIB_SUFFIX in "$l" "$(echo $l | cut -c1)" "" ; do + AC_CHECK_LIB(php$PHP_LIB_SUFFIX,php_execute_script,ac_found_php_lib="yes",ac_found_php_lib="no") + if test "x$ac_found_php_lib" = "xyes" ; then + PHP_VERSION=">=7.0.0" - PHP_LFLAGS="$LDFLAGS -lphp7 -lm" + PHP_LFLAGS="$LDFLAGS -lphp$PHP_LIB_SUFFIX -lm" - ac2_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -lphp7 -lm" + ac2_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -lphp$PHP_LIB_SUFFIX -lm" - if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then - LDFLAGS="$LDFLAGS -ldl" + if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then + LDFLAGS="$LDFLAGS -ldl" + fi + + LDFLAGS="$ac2_save_LDFLAGS" + break 2 fi - - LDFLAGS="$ac2_save_LDFLAGS" - break - fi + done done fi diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c index 76644ef1d..394b306e9 100644 --- a/src/plugins/php/weechat-php-api.c +++ b/src/plugins/php/weechat-php-api.c @@ -43,7 +43,6 @@ #include "../plugin-script-api.h" #include "weechat-php.h" - #define API_FUNC(__name) \ PHP_FUNCTION(weechat_##__name) #define API_INIT_FUNC(__init, __name, __ret) \ diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c index ef1caa2a2..d303367a6 100644 --- a/src/plugins/php/weechat-php.c +++ b/src/plugins/php/weechat-php.c @@ -42,6 +42,11 @@ #include "../plugin-script.h" #include "weechat-php.h" #include "weechat-php-api.h" +#if PHP_VERSION_ID >= 80000 +#include "weechat-php_arginfo.h" +#else +#include "weechat-php_legacy_arginfo.h" +#endif WEECHAT_PLUGIN_NAME(PHP_PLUGIN_NAME); WEECHAT_PLUGIN_DESCRIPTION(N_("Support of PHP scripts")); @@ -98,210 +103,210 @@ char *php_action_remove_list = NULL; char *php_action_autoload_list = NULL; const zend_function_entry weechat_functions[] = { - PHP_FE(weechat_register, NULL) - PHP_FE(weechat_plugin_get_name, NULL) - PHP_FE(weechat_charset_set, NULL) - PHP_FE(weechat_iconv_to_internal, NULL) - PHP_FE(weechat_iconv_from_internal, NULL) - PHP_FE(weechat_gettext, NULL) - PHP_FE(weechat_ngettext, NULL) - PHP_FE(weechat_strlen_screen, NULL) - PHP_FE(weechat_string_match, NULL) - PHP_FE(weechat_string_match_list, NULL) - PHP_FE(weechat_string_has_highlight, NULL) - PHP_FE(weechat_string_has_highlight_regex, NULL) - PHP_FE(weechat_string_mask_to_regex, NULL) - PHP_FE(weechat_string_format_size, NULL) - PHP_FE(weechat_string_color_code_size, NULL) - PHP_FE(weechat_string_remove_color, NULL) - PHP_FE(weechat_string_is_command_char, NULL) - PHP_FE(weechat_string_input_for_buffer, NULL) - PHP_FE(weechat_string_eval_expression, NULL) - PHP_FE(weechat_string_eval_path_home, NULL) - PHP_FE(weechat_mkdir_home, NULL) - PHP_FE(weechat_mkdir, NULL) - PHP_FE(weechat_mkdir_parents, NULL) - PHP_FE(weechat_list_new, NULL) - PHP_FE(weechat_list_add, NULL) - PHP_FE(weechat_list_search, NULL) - PHP_FE(weechat_list_search_pos, NULL) - PHP_FE(weechat_list_casesearch, NULL) - PHP_FE(weechat_list_casesearch_pos, NULL) - PHP_FE(weechat_list_get, NULL) - PHP_FE(weechat_list_set, NULL) - PHP_FE(weechat_list_next, NULL) - PHP_FE(weechat_list_prev, NULL) - PHP_FE(weechat_list_string, NULL) - PHP_FE(weechat_list_size, NULL) - PHP_FE(weechat_list_remove, NULL) - PHP_FE(weechat_list_remove_all, NULL) - PHP_FE(weechat_list_free, NULL) - PHP_FE(weechat_config_new, NULL) - PHP_FE(weechat_config_new_section, NULL) - PHP_FE(weechat_config_search_section, NULL) - PHP_FE(weechat_config_new_option, NULL) - PHP_FE(weechat_config_search_option, NULL) - PHP_FE(weechat_config_string_to_boolean, NULL) - PHP_FE(weechat_config_option_reset, NULL) - PHP_FE(weechat_config_option_set, NULL) - PHP_FE(weechat_config_option_set_null, NULL) - PHP_FE(weechat_config_option_unset, NULL) - PHP_FE(weechat_config_option_rename, NULL) - PHP_FE(weechat_config_option_is_null, NULL) - PHP_FE(weechat_config_option_default_is_null, NULL) - PHP_FE(weechat_config_boolean, NULL) - PHP_FE(weechat_config_boolean_default, NULL) - PHP_FE(weechat_config_integer, NULL) - PHP_FE(weechat_config_integer_default, NULL) - PHP_FE(weechat_config_string, NULL) - PHP_FE(weechat_config_string_default, NULL) - PHP_FE(weechat_config_color, NULL) - PHP_FE(weechat_config_color_default, NULL) - PHP_FE(weechat_config_write_option, NULL) - PHP_FE(weechat_config_write_line, NULL) - PHP_FE(weechat_config_write, NULL) - PHP_FE(weechat_config_read, NULL) - PHP_FE(weechat_config_reload, NULL) - PHP_FE(weechat_config_option_free, NULL) - PHP_FE(weechat_config_section_free_options, NULL) - PHP_FE(weechat_config_section_free, NULL) - PHP_FE(weechat_config_free, NULL) - PHP_FE(weechat_config_get, NULL) - PHP_FE(weechat_config_get_plugin, NULL) - PHP_FE(weechat_config_is_set_plugin, NULL) - PHP_FE(weechat_config_set_plugin, NULL) - PHP_FE(weechat_config_set_desc_plugin, NULL) - PHP_FE(weechat_config_unset_plugin, NULL) - PHP_FE(weechat_key_bind, NULL) - PHP_FE(weechat_key_unbind, NULL) - PHP_FE(weechat_prefix, NULL) - PHP_FE(weechat_color, NULL) - PHP_FE(weechat_print, NULL) - PHP_FE(weechat_print_date_tags, NULL) - PHP_FE(weechat_print_y, NULL) - PHP_FE(weechat_log_print, NULL) - PHP_FE(weechat_hook_command, NULL) - PHP_FE(weechat_hook_completion, NULL) - PHP_FE(weechat_hook_completion_get_string, NULL) - PHP_FE(weechat_hook_completion_list_add, NULL) - PHP_FE(weechat_hook_command_run, NULL) - PHP_FE(weechat_hook_timer, NULL) - PHP_FE(weechat_hook_fd, NULL) - PHP_FE(weechat_hook_process, NULL) - PHP_FE(weechat_hook_process_hashtable, NULL) - PHP_FE(weechat_hook_connect, NULL) - PHP_FE(weechat_hook_line, NULL) - PHP_FE(weechat_hook_print, NULL) - PHP_FE(weechat_hook_signal, NULL) - PHP_FE(weechat_hook_signal_send, NULL) - PHP_FE(weechat_hook_hsignal, NULL) - PHP_FE(weechat_hook_hsignal_send, NULL) - PHP_FE(weechat_hook_config, NULL) - PHP_FE(weechat_hook_modifier, NULL) - PHP_FE(weechat_hook_modifier_exec, NULL) - PHP_FE(weechat_hook_info, NULL) - PHP_FE(weechat_hook_info_hashtable, NULL) - PHP_FE(weechat_hook_infolist, NULL) - PHP_FE(weechat_hook_focus, NULL) - PHP_FE(weechat_hook_set, NULL) - PHP_FE(weechat_unhook, NULL) - PHP_FE(weechat_unhook_all, NULL) - PHP_FE(weechat_buffer_new, NULL) - PHP_FE(weechat_buffer_search, NULL) - PHP_FE(weechat_buffer_search_main, NULL) - PHP_FE(weechat_current_buffer, NULL) - PHP_FE(weechat_buffer_clear, NULL) - PHP_FE(weechat_buffer_close, NULL) - PHP_FE(weechat_buffer_merge, NULL) - PHP_FE(weechat_buffer_unmerge, NULL) - PHP_FE(weechat_buffer_get_integer, NULL) - PHP_FE(weechat_buffer_get_string, NULL) - PHP_FE(weechat_buffer_get_pointer, NULL) - PHP_FE(weechat_buffer_set, NULL) - PHP_FE(weechat_buffer_string_replace_local_var, NULL) - PHP_FE(weechat_buffer_match_list, NULL) - PHP_FE(weechat_current_window, NULL) - PHP_FE(weechat_window_search_with_buffer, NULL) - PHP_FE(weechat_window_get_integer, NULL) - PHP_FE(weechat_window_get_string, NULL) - PHP_FE(weechat_window_get_pointer, NULL) - PHP_FE(weechat_window_set_title, NULL) - PHP_FE(weechat_nicklist_add_group, NULL) - PHP_FE(weechat_nicklist_search_group, NULL) - PHP_FE(weechat_nicklist_add_nick, NULL) - PHP_FE(weechat_nicklist_search_nick, NULL) - PHP_FE(weechat_nicklist_remove_group, NULL) - PHP_FE(weechat_nicklist_remove_nick, NULL) - PHP_FE(weechat_nicklist_remove_all, NULL) - PHP_FE(weechat_nicklist_group_get_integer, NULL) - PHP_FE(weechat_nicklist_group_get_string, NULL) - PHP_FE(weechat_nicklist_group_get_pointer, NULL) - PHP_FE(weechat_nicklist_group_set, NULL) - PHP_FE(weechat_nicklist_nick_get_integer, NULL) - PHP_FE(weechat_nicklist_nick_get_string, NULL) - PHP_FE(weechat_nicklist_nick_get_pointer, NULL) - PHP_FE(weechat_nicklist_nick_set, NULL) - PHP_FE(weechat_bar_item_search, NULL) - PHP_FE(weechat_bar_item_new, NULL) - PHP_FE(weechat_bar_item_update, NULL) - PHP_FE(weechat_bar_item_remove, NULL) - PHP_FE(weechat_bar_search, NULL) - PHP_FE(weechat_bar_new, NULL) - PHP_FE(weechat_bar_set, NULL) - PHP_FE(weechat_bar_update, NULL) - PHP_FE(weechat_bar_remove, NULL) - PHP_FE(weechat_command, NULL) - PHP_FE(weechat_command_options, NULL) - PHP_FE(weechat_completion_new, NULL) - PHP_FE(weechat_completion_search, NULL) - PHP_FE(weechat_completion_get_string, NULL) - PHP_FE(weechat_completion_list_add, NULL) - PHP_FE(weechat_completion_free, NULL) - PHP_FE(weechat_info_get, NULL) - PHP_FE(weechat_info_get_hashtable, NULL) - PHP_FE(weechat_infolist_new, NULL) - PHP_FE(weechat_infolist_new_item, NULL) - PHP_FE(weechat_infolist_new_var_integer, NULL) - PHP_FE(weechat_infolist_new_var_string, NULL) - PHP_FE(weechat_infolist_new_var_pointer, NULL) - PHP_FE(weechat_infolist_new_var_time, NULL) - PHP_FE(weechat_infolist_search_var, NULL) - PHP_FE(weechat_infolist_get, NULL) - PHP_FE(weechat_infolist_next, NULL) - PHP_FE(weechat_infolist_prev, NULL) - PHP_FE(weechat_infolist_reset_item_cursor, NULL) - PHP_FE(weechat_infolist_fields, NULL) - PHP_FE(weechat_infolist_integer, NULL) - PHP_FE(weechat_infolist_string, NULL) - PHP_FE(weechat_infolist_pointer, NULL) - PHP_FE(weechat_infolist_time, NULL) - PHP_FE(weechat_infolist_free, NULL) - PHP_FE(weechat_hdata_get, NULL) - PHP_FE(weechat_hdata_get_var_offset, NULL) - PHP_FE(weechat_hdata_get_var_type_string, NULL) - PHP_FE(weechat_hdata_get_var_array_size, NULL) - PHP_FE(weechat_hdata_get_var_array_size_string, NULL) - PHP_FE(weechat_hdata_get_var_hdata, NULL) - PHP_FE(weechat_hdata_get_list, NULL) - PHP_FE(weechat_hdata_check_pointer, NULL) - PHP_FE(weechat_hdata_move, NULL) - PHP_FE(weechat_hdata_search, NULL) - PHP_FE(weechat_hdata_char, NULL) - PHP_FE(weechat_hdata_integer, NULL) - PHP_FE(weechat_hdata_long, NULL) - PHP_FE(weechat_hdata_string, NULL) - PHP_FE(weechat_hdata_pointer, NULL) - PHP_FE(weechat_hdata_time, NULL) - PHP_FE(weechat_hdata_hashtable, NULL) - PHP_FE(weechat_hdata_compare, NULL) - PHP_FE(weechat_hdata_update, NULL) - PHP_FE(weechat_hdata_get_string, NULL) - PHP_FE(weechat_upgrade_new, NULL) - PHP_FE(weechat_upgrade_write_object, NULL) - PHP_FE(weechat_upgrade_read, NULL) - PHP_FE(weechat_upgrade_close, NULL) - PHP_FE(forget_class, NULL) - PHP_FE(forget_function, NULL) + PHP_FE(weechat_register, arginfo_weechat_register) + PHP_FE(weechat_plugin_get_name, arginfo_weechat_plugin_get_name) + PHP_FE(weechat_charset_set, arginfo_weechat_charset_set) + PHP_FE(weechat_iconv_to_internal, arginfo_weechat_iconv_to_internal) + PHP_FE(weechat_iconv_from_internal, arginfo_weechat_iconv_from_internal) + PHP_FE(weechat_gettext, arginfo_weechat_gettext) + PHP_FE(weechat_ngettext, arginfo_weechat_ngettext) + PHP_FE(weechat_strlen_screen, arginfo_weechat_strlen_screen) + PHP_FE(weechat_string_match, arginfo_weechat_string_match) + PHP_FE(weechat_string_match_list, arginfo_weechat_string_match_list) + PHP_FE(weechat_string_has_highlight, arginfo_weechat_string_has_highlight) + PHP_FE(weechat_string_has_highlight_regex, arginfo_weechat_string_has_highlight_regex) + PHP_FE(weechat_string_mask_to_regex, arginfo_weechat_string_mask_to_regex) + PHP_FE(weechat_string_format_size, arginfo_weechat_string_format_size) + PHP_FE(weechat_string_color_code_size, arginfo_weechat_string_color_code_size) + PHP_FE(weechat_string_remove_color, arginfo_weechat_string_remove_color) + PHP_FE(weechat_string_is_command_char, arginfo_weechat_string_is_command_char) + PHP_FE(weechat_string_input_for_buffer, arginfo_weechat_string_input_for_buffer) + PHP_FE(weechat_string_eval_expression, arginfo_weechat_string_eval_expression) + PHP_FE(weechat_string_eval_path_home, arginfo_weechat_string_eval_path_home) + PHP_FE(weechat_mkdir_home, arginfo_weechat_mkdir_home) + PHP_FE(weechat_mkdir, arginfo_weechat_mkdir) + PHP_FE(weechat_mkdir_parents, arginfo_weechat_mkdir_parents) + PHP_FE(weechat_list_new, arginfo_weechat_list_new) + PHP_FE(weechat_list_add, arginfo_weechat_list_add) + PHP_FE(weechat_list_search, arginfo_weechat_list_search) + PHP_FE(weechat_list_search_pos, arginfo_weechat_list_search_pos) + PHP_FE(weechat_list_casesearch, arginfo_weechat_list_casesearch) + PHP_FE(weechat_list_casesearch_pos, arginfo_weechat_list_casesearch_pos) + PHP_FE(weechat_list_get, arginfo_weechat_list_get) + PHP_FE(weechat_list_set, arginfo_weechat_list_set) + PHP_FE(weechat_list_next, arginfo_weechat_list_next) + PHP_FE(weechat_list_prev, arginfo_weechat_list_prev) + PHP_FE(weechat_list_string, arginfo_weechat_list_string) + PHP_FE(weechat_list_size, arginfo_weechat_list_size) + PHP_FE(weechat_list_remove, arginfo_weechat_list_remove) + PHP_FE(weechat_list_remove_all, arginfo_weechat_list_remove_all) + PHP_FE(weechat_list_free, arginfo_weechat_list_free) + PHP_FE(weechat_config_new, arginfo_weechat_config_new) + PHP_FE(weechat_config_new_section, arginfo_weechat_config_new_section) + PHP_FE(weechat_config_search_section, arginfo_weechat_config_search_section) + PHP_FE(weechat_config_new_option, arginfo_weechat_config_new_option) + PHP_FE(weechat_config_search_option, arginfo_weechat_config_search_option) + PHP_FE(weechat_config_string_to_boolean, arginfo_weechat_config_string_to_boolean) + PHP_FE(weechat_config_option_reset, arginfo_weechat_config_option_reset) + PHP_FE(weechat_config_option_set, arginfo_weechat_config_option_set) + PHP_FE(weechat_config_option_set_null, arginfo_weechat_config_option_set_null) + PHP_FE(weechat_config_option_unset, arginfo_weechat_config_option_unset) + PHP_FE(weechat_config_option_rename, arginfo_weechat_config_option_rename) + PHP_FE(weechat_config_option_is_null, arginfo_weechat_config_option_is_null) + PHP_FE(weechat_config_option_default_is_null, arginfo_weechat_config_option_default_is_null) + PHP_FE(weechat_config_boolean, arginfo_weechat_config_boolean) + PHP_FE(weechat_config_boolean_default, arginfo_weechat_config_boolean_default) + PHP_FE(weechat_config_integer, arginfo_weechat_config_integer) + PHP_FE(weechat_config_integer_default, arginfo_weechat_config_integer_default) + PHP_FE(weechat_config_string, arginfo_weechat_config_string) + PHP_FE(weechat_config_string_default, arginfo_weechat_config_string_default) + PHP_FE(weechat_config_color, arginfo_weechat_config_color) + PHP_FE(weechat_config_color_default, arginfo_weechat_config_color_default) + PHP_FE(weechat_config_write_option, arginfo_weechat_config_write_option) + PHP_FE(weechat_config_write_line, arginfo_weechat_config_write_line) + PHP_FE(weechat_config_write, arginfo_weechat_config_write) + PHP_FE(weechat_config_read, arginfo_weechat_config_read) + PHP_FE(weechat_config_reload, arginfo_weechat_config_reload) + PHP_FE(weechat_config_option_free, arginfo_weechat_config_option_free) + PHP_FE(weechat_config_section_free_options, arginfo_weechat_config_section_free_options) + PHP_FE(weechat_config_section_free, arginfo_weechat_config_section_free) + PHP_FE(weechat_config_free, arginfo_weechat_config_free) + PHP_FE(weechat_config_get, arginfo_weechat_config_get) + PHP_FE(weechat_config_get_plugin, arginfo_weechat_config_get_plugin) + PHP_FE(weechat_config_is_set_plugin, arginfo_weechat_config_is_set_plugin) + PHP_FE(weechat_config_set_plugin, arginfo_weechat_config_set_plugin) + PHP_FE(weechat_config_set_desc_plugin, arginfo_weechat_config_set_desc_plugin) + PHP_FE(weechat_config_unset_plugin, arginfo_weechat_config_unset_plugin) + PHP_FE(weechat_key_bind, arginfo_weechat_key_bind) + PHP_FE(weechat_key_unbind, arginfo_weechat_key_unbind) + PHP_FE(weechat_prefix, arginfo_weechat_prefix) + PHP_FE(weechat_color, arginfo_weechat_color) + PHP_FE(weechat_print, arginfo_weechat_print) + PHP_FE(weechat_print_date_tags, arginfo_weechat_print_date_tags) + PHP_FE(weechat_print_y, arginfo_weechat_print_y) + PHP_FE(weechat_log_print, arginfo_weechat_log_print) + PHP_FE(weechat_hook_command, arginfo_weechat_hook_command) + PHP_FE(weechat_hook_completion, arginfo_weechat_hook_completion) + PHP_FE(weechat_hook_completion_get_string, arginfo_weechat_hook_completion_get_string) + PHP_FE(weechat_hook_completion_list_add, arginfo_weechat_hook_completion_list_add) + PHP_FE(weechat_hook_command_run, arginfo_weechat_hook_command_run) + PHP_FE(weechat_hook_timer, arginfo_weechat_hook_timer) + PHP_FE(weechat_hook_fd, arginfo_weechat_hook_fd) + PHP_FE(weechat_hook_process, arginfo_weechat_hook_process) + PHP_FE(weechat_hook_process_hashtable, arginfo_weechat_hook_process_hashtable) + PHP_FE(weechat_hook_connect, arginfo_weechat_hook_connect) + PHP_FE(weechat_hook_line, arginfo_weechat_hook_line) + PHP_FE(weechat_hook_print, arginfo_weechat_hook_print) + PHP_FE(weechat_hook_signal, arginfo_weechat_hook_signal) + PHP_FE(weechat_hook_signal_send, arginfo_weechat_hook_signal_send) + PHP_FE(weechat_hook_hsignal, arginfo_weechat_hook_hsignal) + PHP_FE(weechat_hook_hsignal_send, arginfo_weechat_hook_hsignal_send) + PHP_FE(weechat_hook_config, arginfo_weechat_hook_config) + PHP_FE(weechat_hook_modifier, arginfo_weechat_hook_modifier) + PHP_FE(weechat_hook_modifier_exec, arginfo_weechat_hook_modifier_exec) + PHP_FE(weechat_hook_info, arginfo_weechat_hook_info) + PHP_FE(weechat_hook_info_hashtable, arginfo_weechat_hook_info_hashtable) + PHP_FE(weechat_hook_infolist, arginfo_weechat_hook_infolist) + PHP_FE(weechat_hook_focus, arginfo_weechat_hook_focus) + PHP_FE(weechat_hook_set, arginfo_weechat_hook_set) + PHP_FE(weechat_unhook, arginfo_weechat_unhook) + PHP_FE(weechat_unhook_all, arginfo_weechat_unhook_all) + PHP_FE(weechat_buffer_new, arginfo_weechat_buffer_new) + PHP_FE(weechat_buffer_search, arginfo_weechat_buffer_search) + PHP_FE(weechat_buffer_search_main, arginfo_weechat_buffer_search_main) + PHP_FE(weechat_current_buffer, arginfo_weechat_current_buffer) + PHP_FE(weechat_buffer_clear, arginfo_weechat_buffer_clear) + PHP_FE(weechat_buffer_close, arginfo_weechat_buffer_close) + PHP_FE(weechat_buffer_merge, arginfo_weechat_buffer_merge) + PHP_FE(weechat_buffer_unmerge, arginfo_weechat_buffer_unmerge) + PHP_FE(weechat_buffer_get_integer, arginfo_weechat_buffer_get_integer) + PHP_FE(weechat_buffer_get_string, arginfo_weechat_buffer_get_string) + PHP_FE(weechat_buffer_get_pointer, arginfo_weechat_buffer_get_pointer) + PHP_FE(weechat_buffer_set, arginfo_weechat_buffer_set) + PHP_FE(weechat_buffer_string_replace_local_var, arginfo_weechat_buffer_string_replace_local_var) + PHP_FE(weechat_buffer_match_list, arginfo_weechat_buffer_match_list) + PHP_FE(weechat_current_window, arginfo_weechat_current_window) + PHP_FE(weechat_window_search_with_buffer, arginfo_weechat_window_search_with_buffer) + PHP_FE(weechat_window_get_integer, arginfo_weechat_window_get_integer) + PHP_FE(weechat_window_get_string, arginfo_weechat_window_get_string) + PHP_FE(weechat_window_get_pointer, arginfo_weechat_window_get_pointer) + PHP_FE(weechat_window_set_title, arginfo_weechat_window_set_title) + PHP_FE(weechat_nicklist_add_group, arginfo_weechat_nicklist_add_group) + PHP_FE(weechat_nicklist_search_group, arginfo_weechat_nicklist_search_group) + PHP_FE(weechat_nicklist_add_nick, arginfo_weechat_nicklist_add_nick) + PHP_FE(weechat_nicklist_search_nick, arginfo_weechat_nicklist_search_nick) + PHP_FE(weechat_nicklist_remove_group, arginfo_weechat_nicklist_remove_group) + PHP_FE(weechat_nicklist_remove_nick, arginfo_weechat_nicklist_remove_nick) + PHP_FE(weechat_nicklist_remove_all, arginfo_weechat_nicklist_remove_all) + PHP_FE(weechat_nicklist_group_get_integer, arginfo_weechat_nicklist_group_get_integer) + PHP_FE(weechat_nicklist_group_get_string, arginfo_weechat_nicklist_group_get_string) + PHP_FE(weechat_nicklist_group_get_pointer, arginfo_weechat_nicklist_group_get_pointer) + PHP_FE(weechat_nicklist_group_set, arginfo_weechat_nicklist_group_set) + PHP_FE(weechat_nicklist_nick_get_integer, arginfo_weechat_nicklist_nick_get_integer) + PHP_FE(weechat_nicklist_nick_get_string, arginfo_weechat_nicklist_nick_get_string) + PHP_FE(weechat_nicklist_nick_get_pointer, arginfo_weechat_nicklist_nick_get_pointer) + PHP_FE(weechat_nicklist_nick_set, arginfo_weechat_nicklist_nick_set) + PHP_FE(weechat_bar_item_search, arginfo_weechat_bar_item_search) + PHP_FE(weechat_bar_item_new, arginfo_weechat_bar_item_new) + PHP_FE(weechat_bar_item_update, arginfo_weechat_bar_item_update) + PHP_FE(weechat_bar_item_remove, arginfo_weechat_bar_item_remove) + PHP_FE(weechat_bar_search, arginfo_weechat_bar_search) + PHP_FE(weechat_bar_new, arginfo_weechat_bar_new) + PHP_FE(weechat_bar_set, arginfo_weechat_bar_set) + PHP_FE(weechat_bar_update, arginfo_weechat_bar_update) + PHP_FE(weechat_bar_remove, arginfo_weechat_bar_remove) + PHP_FE(weechat_command, arginfo_weechat_command) + PHP_FE(weechat_command_options, arginfo_weechat_command_options) + PHP_FE(weechat_completion_new, arginfo_weechat_completion_new) + PHP_FE(weechat_completion_search, arginfo_weechat_completion_search) + PHP_FE(weechat_completion_get_string, arginfo_weechat_completion_get_string) + PHP_FE(weechat_completion_list_add, arginfo_weechat_completion_list_add) + PHP_FE(weechat_completion_free, arginfo_weechat_completion_free) + PHP_FE(weechat_info_get, arginfo_weechat_info_get) + PHP_FE(weechat_info_get_hashtable, arginfo_weechat_info_get_hashtable) + PHP_FE(weechat_infolist_new, arginfo_weechat_infolist_new) + PHP_FE(weechat_infolist_new_item, arginfo_weechat_infolist_new_item) + PHP_FE(weechat_infolist_new_var_integer, arginfo_weechat_infolist_new_var_integer) + PHP_FE(weechat_infolist_new_var_string, arginfo_weechat_infolist_new_var_string) + PHP_FE(weechat_infolist_new_var_pointer, arginfo_weechat_infolist_new_var_pointer) + PHP_FE(weechat_infolist_new_var_time, arginfo_weechat_infolist_new_var_time) + PHP_FE(weechat_infolist_search_var, arginfo_weechat_infolist_search_var) + PHP_FE(weechat_infolist_get, arginfo_weechat_infolist_get) + PHP_FE(weechat_infolist_next, arginfo_weechat_infolist_next) + PHP_FE(weechat_infolist_prev, arginfo_weechat_infolist_prev) + PHP_FE(weechat_infolist_reset_item_cursor, arginfo_weechat_infolist_reset_item_cursor) + PHP_FE(weechat_infolist_fields, arginfo_weechat_infolist_fields) + PHP_FE(weechat_infolist_integer, arginfo_weechat_infolist_integer) + PHP_FE(weechat_infolist_string, arginfo_weechat_infolist_string) + PHP_FE(weechat_infolist_pointer, arginfo_weechat_infolist_pointer) + PHP_FE(weechat_infolist_time, arginfo_weechat_infolist_time) + PHP_FE(weechat_infolist_free, arginfo_weechat_infolist_free) + PHP_FE(weechat_hdata_get, arginfo_weechat_hdata_get) + PHP_FE(weechat_hdata_get_var_offset, arginfo_weechat_hdata_get_var_offset) + PHP_FE(weechat_hdata_get_var_type_string, arginfo_weechat_hdata_get_var_type_string) + PHP_FE(weechat_hdata_get_var_array_size, arginfo_weechat_hdata_get_var_array_size) + PHP_FE(weechat_hdata_get_var_array_size_string, arginfo_weechat_hdata_get_var_array_size_string) + PHP_FE(weechat_hdata_get_var_hdata, arginfo_weechat_hdata_get_var_hdata) + PHP_FE(weechat_hdata_get_list, arginfo_weechat_hdata_get_list) + PHP_FE(weechat_hdata_check_pointer, arginfo_weechat_hdata_check_pointer) + PHP_FE(weechat_hdata_move, arginfo_weechat_hdata_move) + PHP_FE(weechat_hdata_search, arginfo_weechat_hdata_search) + PHP_FE(weechat_hdata_char, arginfo_weechat_hdata_char) + PHP_FE(weechat_hdata_integer, arginfo_weechat_hdata_integer) + PHP_FE(weechat_hdata_long, arginfo_weechat_hdata_long) + PHP_FE(weechat_hdata_string, arginfo_weechat_hdata_string) + PHP_FE(weechat_hdata_pointer, arginfo_weechat_hdata_pointer) + PHP_FE(weechat_hdata_time, arginfo_weechat_hdata_time) + PHP_FE(weechat_hdata_hashtable, arginfo_weechat_hdata_hashtable) + PHP_FE(weechat_hdata_compare, arginfo_weechat_hdata_compare) + PHP_FE(weechat_hdata_update, arginfo_weechat_hdata_update) + PHP_FE(weechat_hdata_get_string, arginfo_weechat_hdata_get_string) + PHP_FE(weechat_upgrade_new, arginfo_weechat_upgrade_new) + PHP_FE(weechat_upgrade_write_object, arginfo_weechat_upgrade_write_object) + PHP_FE(weechat_upgrade_read, arginfo_weechat_upgrade_read) + PHP_FE(weechat_upgrade_close, arginfo_weechat_upgrade_close) + PHP_FE(forget_class, arginfo_forget_class) + PHP_FE(forget_function, arginfo_forget_function) PHP_FE_END }; @@ -695,7 +700,7 @@ weechat_php_load (const char *filename, const char *code) memset (&file_handle, 0, sizeof (file_handle)); file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; + file_handle.filename = zend_string_init(filename, strlen(filename), 0); zend_try { diff --git a/src/plugins/php/weechat-php.stub.php b/src/plugins/php/weechat-php.stub.php new file mode 100644 index 000000000..7ecae6086 --- /dev/null +++ b/src/plugins/php/weechat-php.stub.php @@ -0,0 +1,212 @@ +