kevinlekiller / simple_php_yenc_decode

Basic yEnc decoder extension for PHP5 written in c++ using swig.
GNU General Public License v3.0
4 stars 4 forks source link

Doesn't Compile Against PHP7 #3

Open Enverex opened 8 years ago

Enverex commented 8 years ago

I believe you're already aware of it but now it's logged. Trying to compile against PHP 7.0.2 results in the following:

warning: gcc-5.3.0-3 is up to date -- skipping
warning: boost-1.60.0-1 is up to date -- skipping
 there is nothing to do
source/yenc_decode_wrap.cpp:876:105: error: macro "zend_hash_update" passed 6 arguments, but takes just 3
       zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL);
                                                                                                         ^
source/yenc_decode_wrap.cpp:1152:88: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
   ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
                                                                                        ^
source/yenc_decode_wrap.cpp: In function 'void SWIG_landfill(zend_resource*)':
source/yenc_decode_wrap.cpp:813:51: error: 'rsrc' was not declared in this scope
 static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; }
                                                   ^
source/yenc_decode_wrap.cpp: In function 'void SWIG_ZTS_SetPointerZval(zval*, void*, swig_type_info*, int)':
source/yenc_decode_wrap.cpp:836:66: error: 'ZEND_REGISTER_RESOURCE' was not declared in this scope
       ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
                                                                  ^
source/yenc_decode_wrap.cpp:857:29: error: 'MAKE_STD_ZVAL' was not declared in this scope
       MAKE_STD_ZVAL(resource);
                             ^
source/yenc_decode_wrap.cpp:858:73: error: 'ZEND_REGISTER_RESOURCE' was not declared in this scope
       ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata));
                                                                         ^
source/yenc_decode_wrap.cpp:863:93: error: cannot convert 'char*' to 'zend_string* {aka _zend_string*}' for argument '1' to 'zend_class_entry* zend_lookup_class(zend_string*)'
         result = zend_lookup_class(classname, SWIG_PREFIX_LEN + type_name_len, &ce TSRMLS_CC);
                                                                                             ^
source/yenc_decode_wrap.cpp:866:83: error: cannot convert 'char*' to 'zend_string* {aka _zend_string*}' for argument '1' to 'zend_class_entry* zend_lookup_class(zend_string*)'
         result = zend_lookup_class((char *)type_name, type_name_len, &ce TSRMLS_CC);
                                                                                   ^
source/yenc_decode_wrap.cpp:749:32: error: 'zval {aka struct _zval_struct}' has no member named 'is_ref'
 # define Z_SET_ISREF_P(z) (z)->is_ref = 1
                                ^
source/yenc_decode_wrap.cpp:875:7: note: in expansion of macro 'Z_SET_ISREF_P'
       Z_SET_ISREF_P(z);
       ^
source/yenc_decode_wrap.cpp:876:7: error: 'zend_hash_update' was not declared in this scope
       zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL);
       ^
source/yenc_decode_wrap.cpp: In function 'void* SWIG_ZTS_ConvertResourcePtr(zval*, swig_type_info*, int)':
source/yenc_decode_wrap.cpp:931:70: error: 'zend_list_find' was not declared in this scope
   value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
                                                                      ^
source/yenc_decode_wrap.cpp:938:51: error: invalid conversion from 'zend_long {aka long int}' to 'zend_resource* {aka _zend_resource*}' [-fpermissive]
   type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
                                                   ^
In file included from /usr/include/php/Zend/zend_API.h:28:0,
                 from source/yenc_decode_wrap.cpp:731:
/usr/include/php/Zend/zend_list.h:68:22: note:   initializing argument 1 of 'const char* zend_rsrc_list_get_rsrc_type(zend_resource*)'
 ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
                      ^
source/yenc_decode_wrap.cpp: In function 'int SWIG_ZTS_ConvertPtr(zval*, void**, swig_type_info*, int)':
source/yenc_decode_wrap.cpp:952:14: error: 'zval {aka struct _zval_struct}' has no member named 'type'
   switch (z->type) {
              ^
source/yenc_decode_wrap.cpp:955:82: error: cannot convert 'char*' to 'zend_string* {aka _zend_string*}' for argument '2' to 'zval* zend_hash_find(const HashTable*, zend_string*)'
       if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) {
                                                                                  ^
source/yenc_decode_wrap.cpp:956:16: error: 'zval {aka struct _zval_struct}' has no member named 'type'
  if ((*_cPtr)->type==IS_RESOURCE) {
                ^
source/yenc_decode_wrap.cpp: In function 'swig_module_info* SWIG_Php_GetModule(void*)':
source/yenc_decode_wrap.cpp:979:24: error: 'MAKE_STD_ZVAL' was not declared in this scope
   MAKE_STD_ZVAL(pointer);
                        ^
source/yenc_decode_wrap.cpp:983:78: error: cannot convert 'char*' to 'zend_string* {aka _zend_string*}' for argument '1' to 'zval* zend_get_constant(zend_string*)'
   if (zend_get_constant(const_name, sizeof(const_name) - 1, pointer TSRMLS_CC)) {
                                                                              ^
source/yenc_decode_wrap.cpp:984:18: error: 'zval {aka struct _zval_struct}' has no member named 'type'
     if (pointer->type == IS_LONG) {
                  ^
source/yenc_decode_wrap.cpp:988:20: error: 'FREE_ZVAL' was not declared in this scope
   FREE_ZVAL(pointer);
                    ^
In file included from source/yenc_decode_wrap.cpp:731:0:
source/yenc_decode_wrap.cpp: In function 'void _wrap_swig_simple_php_yenc_decode_alter_newobject(zend_execute_data*, zval*)':
/usr/include/php/Zend/zend_API.h:258:59: error: cannot convert 'zval*** {aka _zval_struct***}' to 'zval* {aka _zval_struct*}' for argument '2' to 'int _zend_get_parameters_array_ex(int, zval*)'
  _zend_get_parameters_array_ex(param_count, argument_array)
                                                           ^
source/yenc_decode_wrap.cpp:1067:30: note: in expansion of macro 'zend_get_parameters_array_ex'
   if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
                              ^
source/yenc_decode_wrap.cpp:1071:79: error: 'zend_list_find' was not declared in this scope
   value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
                                                                               ^
In file included from source/yenc_decode_wrap.cpp:731:0:
source/yenc_decode_wrap.cpp: In function 'void _wrap_swig_simple_php_yenc_decode_get_newobject(zend_execute_data*, zval*)':
/usr/include/php/Zend/zend_API.h:258:59: error: cannot convert 'zval*** {aka _zval_struct***}' to 'zval* {aka _zval_struct*}' for argument '2' to 'int _zend_get_parameters_array_ex(int, zval*)'
  _zend_get_parameters_array_ex(param_count, argument_array)
                                                           ^
source/yenc_decode_wrap.cpp:1082:30: note: in expansion of macro 'zend_get_parameters_array_ex'
   if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
                              ^
source/yenc_decode_wrap.cpp:1086:79: error: 'zend_list_find' was not declared in this scope
   value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
                                                                               ^
In file included from source/yenc_decode_wrap.cpp:731:0:
source/yenc_decode_wrap.cpp: In function 'void _wrap_simple_yenc_decode(zend_execute_data*, zval*)':
/usr/include/php/Zend/zend_API.h:258:59: error: cannot convert 'zval*** {aka _zval_struct***}' to 'zval* {aka _zval_struct*}' for argument '2' to 'int _zend_get_parameters_array_ex(int, zval*)'
  _zend_get_parameters_array_ex(param_count, argument_array)
                                                           ^
source/yenc_decode_wrap.cpp:1142:30: note: in expansion of macro 'zend_get_parameters_array_ex'
   if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
                              ^
In file included from /usr/include/php/Zend/zend.h:31:0,
                 from source/yenc_decode_wrap.cpp:730:
/usr/include/php/Zend/zend_types.h:336:46: error: cannot convert 'zval** {aka _zval_struct**}' to 'const zval* {aka const _zval_struct*}' for argument '1' to 'zend_uchar zval_get_type(const zval*)'
 #define Z_TYPE(zval)    zval_get_type(&(zval))
                                              ^
/usr/include/php/Zend/zend_types.h:337:28: note: in expansion of macro 'Z_TYPE'
 #define Z_TYPE_P(zval_p)   Z_TYPE(*(zval_p))
                            ^
/usr/include/php/Zend/zend_operators.h:368:6: note: in expansion of macro 'Z_TYPE_P'
  if (Z_TYPE_P(pzv)!=upper_type) {     \
      ^
/usr/include/php/Zend/zend_operators.h:410:35: note: in expansion of macro 'convert_to_ex_master'
 #define convert_to_string_ex(pzv) convert_to_ex_master(pzv, string, IS_STRING)
                                   ^
source/yenc_decode_wrap.cpp:1147:3: note: in expansion of macro 'convert_to_string_ex'
   convert_to_string_ex(args[0]);
   ^
/usr/include/php/Zend/zend_types.h:336:46: error: cannot convert 'zval** {aka _zval_struct**}' to 'const zval* {aka const _zval_struct*}' for argument '1' to 'zend_uchar zval_get_type(const zval*)'
 #define Z_TYPE(zval)    zval_get_type(&(zval))
                                              ^
/usr/include/php/Zend/zend_types.h:337:28: note: in expansion of macro 'Z_TYPE'
 #define Z_TYPE_P(zval_p)   Z_TYPE(*(zval_p))
                            ^
/usr/include/php/Zend/zend_operators.h:274:35: note: in expansion of macro 'Z_TYPE_P'
 #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
                                   ^
/usr/include/php/Zend/zend_operators.h:369:3: note: in expansion of macro 'convert_to_string'
   convert_to_##lower_type(pzv);      \
   ^
/usr/include/php/Zend/zend_operators.h:410:35: note: in expansion of macro 'convert_to_ex_master'
 #define convert_to_string_ex(pzv) convert_to_ex_master(pzv, string, IS_STRING)
                                   ^
source/yenc_decode_wrap.cpp:1147:3: note: in expansion of macro 'convert_to_string_ex'
   convert_to_string_ex(args[0]);
   ^
In file included from /usr/include/php/Zend/zend.h:341:0,
                 from source/yenc_decode_wrap.cpp:730:
/usr/include/php/Zend/zend_operators.h:274:105: error: cannot convert 'zval** {aka _zval_struct**}' to 'zval* {aka _zval_struct*}' for argument '1' to 'void _convert_to_string(zval*)'
 #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
                                                                                                         ^
/usr/include/php/Zend/zend_operators.h:369:3: note: in expansion of macro 'convert_to_string'
   convert_to_##lower_type(pzv);      \
   ^
/usr/include/php/Zend/zend_operators.h:410:35: note: in expansion of macro 'convert_to_ex_master'
 #define convert_to_string_ex(pzv) convert_to_ex_master(pzv, string, IS_STRING)
                                   ^
source/yenc_decode_wrap.cpp:1147:3: note: in expansion of macro 'convert_to_string_ex'
   convert_to_string_ex(args[0]);
   ^
source/yenc_decode_wrap.cpp:1148:38: error: 'Z_STRVAL_PP' was not declared in this scope
   (&arg1)->assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
                                      ^
source/yenc_decode_wrap.cpp:1148:60: error: 'Z_STRLEN_PP' was not declared in this scope
   (&arg1)->assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
                                                            ^
source/yenc_decode_wrap.cpp:1152:3: error: 'ZVAL_STRINGL' was not declared in this scope
   ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
   ^
Error creating yenc_decode_wrap.o!
mpadilla2 commented 8 years ago

Can confirm I get this problem as well with php 7 on Arch Linux.

HittingSmoke commented 8 years ago

Same error on Ubuntu 16.04 with PHP 7

phirestalker commented 8 years ago

same error here Ubuntu 16.04 PHP 7

phirestalker commented 8 years ago

he hasn't touched this in 2 years, I doubt there is still interest. Does anyone know of any forks?

HittingSmoke commented 8 years ago

Is has to do with new syntax for Zend relates commands. Theoretically if that's all that's wrong it should be a simple fix but I don't have time to dig into it. I only discovered it because I was setting this up for a friend's personal tracker.

On Tue, Apr 26, 2016, 9:17 PM phirestalker notifications@github.com wrote:

he hasn't touched this in 2 years, I doubt there is still interest. Does anyone know of any forks?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/kevinlekiller/simple_php_yenc_decode/issues/3#issuecomment-214965796

ghost commented 8 years ago

You can supposedly compile this with PHP 5.6 and then use it with 7.

ghost commented 8 years ago

Okay I just compiled it with php5.6 but I cannot load the module with php7. So no clue how this is supposed to work.

phirestalker commented 8 years ago

can you please provide us with the swig commandline you used to generate the wrapper?

phirestalker commented 8 years ago

also everyone else, it seems that the problem is in swig code not this code, https://github.com/swig/swig/issues/571

so anyone working on a fix with some coding experience check there

EasternPA commented 8 years ago

I still need help on ubuntu.sh in here since it specifically calls php-config5 and /etc/php5/cli. I'm trying do this in docker and really don't want to dig into sed and awk to edit the script prior to executing it. I really don't know git yet, but perhaps I can just clone it to my own repo and edit that copy of it.

kevinlekiller commented 8 years ago

Fyi @niel is working is working on a replacement for this https://github.com/niel/nzedb_utils

https://github.com/niel/nzedb_utils/blob/master/nzedb/utils/yenc.zep

https://github.com/nZEDb/nZEDb/tree/dev-yenc-abstraction

phirestalker commented 7 years ago

swig has added php7 support, has anyone got it working yet?

@kevinlekiller, will this be merged in to nzedb and be the new built in, or will I need to compile it separately?

ghost commented 7 years ago

There's https://github.com/niel/php-yenc now for 7.

niel commented 7 years ago

@phirestalker It will not be merged in, it never was before. Same applies to my extension.

If Composer or the replacement to PEAR finally get the ability to install extensions sorted out we will look at adding one of them to the Composer config to be automatically installed, or add instructions on how to do it manually.

Does SWIG also support 7.1?

DariusIII commented 7 years ago

As far as i see, swig supports PHP7 with -php7 flag, does not specifically state .0 or .1, but i doubt it does.