Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatability with old PHP Package #68

Closed
karljakober opened this issue Mar 15, 2017 · 2 comments
Closed

Compatability with old PHP Package #68

karljakober opened this issue Mar 15, 2017 · 2 comments

Comments

@karljakober
Copy link

Hello! Im trying to decode a buffer encoded by and old old version of php msgpack

https://github.com/onlinecity/msgpack-php

���type��data��follows���name�ActionBa5tard�variation��isTestãnsp�/��rooms��6557A74B19C2EBCA0B2A�flags�

receiving the error

/home/vagrant/io/node_modules/msgpack-lite/lib/read-core.js:24
    if (!func) throw new Error("Invalid type: " + (type ? ("0x" + type.toString(16)) : type));
                     ^
Error: Invalid type: 0x�

The end goal would be to eventually use php-webpack, but I can nither update to msgpack-lite nor update php-webpack official package without downtime in connectivity between my IO server and my PHP emits

My hope is to get msgpack-lite working with my old php-webpack emits, and then update php-webpack with no downtime

Any ideas on how I can accomplish this?

@dchenk
Copy link

dchenk commented Feb 1, 2018

That PHP library seems so old and out of date since nobody is maintaining it that you probably shouldn't be using it in the first place. @kawanet I recommend closing this issue.

@kawanet
Copy link
Owner

kawanet commented Feb 3, 2018

@karljakober I just guess the problem may exist not on the PHP library but on the JavaScript application. The error message below looks that the type value is not a number but a string. The application might read the input octets as a string instead of an ArrayBuffer or a Buffer.

/home/vagrant/io/node_modules/msgpack-lite/lib/read-core.js:24
    if (!func) throw new Error("Invalid type: " + (type ? ("0x" + type.toString(16)) : type));
                     ^
Error: Invalid type: 0x�

Put your input octets (of hex representation) encoded by the PHP library at http://kawanet.github.io/msgpack-lite/ demo page. If you got the same or another error, please open the issue again.

Thanks @dchenk

@kawanet kawanet closed this as completed Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants