duck7000 / imdbGraphQLPHP

5 stars 0 forks source link

Parse error #65

Closed GeorgeFive closed 3 days ago

GeorgeFive commented 1 week ago

Hey! Just updated to the newest version (didn't notice the new commits), and now I get this:

PHP Parse error: syntax error, unexpected '"', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /imdb6/src/Imdb/Name.php on line 614

Also

PHP Parse error: syntax error, unexpected ']', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /imdb6/src/Imdb/TitleSearch.php on line 99

duck7000 commented 1 week ago

I didn't change anything in Name.php for a long time and can't spot any problems?

I'will test it of course

duck7000 commented 1 week ago

I tested both and no issues, so i don't understand there is a issue?

GeorgeFive commented 6 days ago

I downloaded the zip file to just get everything (minus the config file) and overwrote everything on my end. I didn't spot any problems in the code myself either, but I was wondering if I just missed something. I reuploaded numerous times just to make sure I didn't miss something, but always had the same result. Will try again tonight when I get home.

I'm not sure what's going on with downloading from here / uploading to my server lately.... this and the cache stuff on musicbrainz... I mean, I've been doing FTP stuff for thirty years now, I think I know what I'm doing, haha.

GeorgeFive commented 6 days ago

I'm at a loss.... maybe I'm too stoned for this tonight!? haha, I don't know what I'm missing.

A) This version works fine: https://github.com/duck7000/imdbGraphQLPHP/blob/d29bc54555f2e24c3888ed7f370ec1c567747746/src/Imdb/Name.php

B) The next released version does not work: https://github.com/duck7000/imdbGraphQLPHP/blob/22ba18304bb8d095817deeffa4b446449fcd2e2e/src/Imdb/Name.php In this version, I get error: PHP Parse error: syntax error, unexpected end of file in /imdb6/src/Imdb/Name.php on line 1456

The only difference is the spacing in checkRedirect. The end of the file is fine, the spacing is the only issue. I change that in version B back to the way it was in A, and it works fine.

I use the latest release version and change the spacing in checkRedirect to the way it is in A... and it's still broken. So I'm wondering if the spacing in other functions has something to do with it?

duck7000 commented 6 days ago

Mm this is weird.

Do you mean latest commit version or the latest release version? This can be different

If i check those files there are differences but on my server it all works fine. those errors doesn't make any sense as at those lines there is nothing wrong.

I'll investigate further

duck7000 commented 6 days ago

I used version A and added all latest commits to it, so in theory it should work, although i still don't understand what is going on as all versions work fine at my server.

can you test this version: Name.php.tar.gz

duck7000 commented 6 days ago

In latest commit i changed back TitleSearch class to before i changed the layout of the query so this should now work.

GeorgeFive commented 5 days ago

Your test version worked just fine. So I guess it's another spacing issue!? Weird. And I meant the latest commit from here, I grabbed that and changed the spacing in checkRedirect to version A to see if it was just an issue with that function... and it's not, something else was bitching in there.

Have not checked titlesearch yet, I'm about to walk out the door and struggling for time, haha.

duck7000 commented 5 days ago

Jep i guess I reverted all changes i made to the query parts.

Weird is that i made the same changes in Title class and you have no issues there

GeorgeFive commented 5 days ago

Spoke too soon, hah.

PHP Parse error: syntax error, unexpected ']', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /imdb6/src/Imdb/Title.php on line 591

I guess it was dying on name.php and not throwing this one.

duck7000 commented 5 days ago

Pffff what the fuck is going on here it all works fine here on my server, every version.

I'm reverting all query adjustments that i made, although i absolutely don't understand what is going on.

duck7000 commented 5 days ago

@GeorgeFive can you test with a older version if that works? So i can check the differences, just like you did with Name class.

That error on line 591 doesn't make any sense as the same kind of line is used earlier in the script and is no problem.

I am beginning to seriously doubt you hoster, as nobody else, including me, does have this kind of very weird issues

duck7000 commented 4 days ago

@GeorgeFive All query changes are reverted in Title class and are just the way they are in Name class so it should finally work i hope.

duck7000 commented 4 days ago

I will revert query changes in Title Search Advanced class as well, Title Search class is already done

GeorgeFive commented 4 days ago

Everything looks good now. I really have no idea why this happens. I use a pretty standard AlmaLinux setup, everything is up to date except for PHP (7.2), no additional firewall / security stuff that could interfere, and it's a reliable, well-known company hosting it. It doesn't make sense....

GeorgeFive commented 4 days ago

Maybe this is a clue?

https://stackoverflow.com/questions/53469321/correct-format-for-multiline-data-in-curl-query-to-graphql-endpoint

duck7000 commented 4 days ago

It might have something to do with your stackoverflow link but i don't see exactly what.

It might also be the specific place of EOF You mentioned php 7.2.... PHP doc mentions this: Prior to PHP 7.3.0, the closing identifier must begin in the first column of the line. That must be the culprit. I assumed that you use PHP 8 or higher by now (i thought you mentioned that somewhere?) PHP 7.2 is EOL so if you can upgrade to at least php 8.1

GeorgeFive commented 3 days ago

Upgrading past 7.2 is one of the (many) things on my todo list. Right now, my templating system is barely compatible with this version (I had to do some tweaks to get it going), and it's completely incompatible with anything past 7.2. They have a newer version that works with modern PHP, but I had a hell of a time trying to get it running, so I threw it on the backburner.

Currently swamped with stuff, I hit a roadblock with the music stuff due to utf-8 issues, so now I'm finally buckling down and doing the conversion on THAT. It just never ends, haha.

duck7000 commented 3 days ago

Well i understand your issues, so good luck with fixing them.

Coding never ends indeed haha