0

I am working with action script 3 and often I see server calls that link to php files.

var serverCall:ServerCall = new ServerCall("getDeviceFirmwareLog", getDeviceFirmwareLogResponse, getDeviceFirmwareLogResponse, false);

This line calls some php functions that cannot be searched in my IDE, so I usually go from here and I would try to grep for that string "getDeviceFirmwareLog" and then I run into some php that makes other weird calls that somehow calls some stuff on the embedded hardware we run. In general when I grep for that string I don't even get any results and I'm so confused as to how it might be connected.

I am much more used to regular code calls and includes that are easier to follow. I've asked some people at work but it seems to get glossed over and I don't want to ask the same question a third time until I've exhausted my other options. I am wondering if there are any general debugging / code following tips for this kind of a setup that could help me understand what is going on in my codebase.

Thanks in advance.

Justin
  • 203
  • 1
  • 13
  • Not sure what this has to do with PHP? That code isn't PHP? – Farkie Apr 27 '16 at 16:53
  • Does setting a breakpoint and stepping through the code not reveal the nature of the variables you're asking about? – Atriace Apr 27 '16 at 17:07
  • the rpc is to php files but those php files dont have the same kind of naming schema so its hard to see how/if its connected to the function I am using. I can use a breakpoint but i cant drill deeper into the php section, once I hit the rpc i select 'step into' and the editor just goes past it. – Justin Apr 27 '16 at 17:15
  • Its possible that I just need to have someone with less experience than the people i've been asking to take me through our code specifically so I can develop the understanding of how its connected. They might be more patient around those parts. There might not be a 'general' way to discover this in my kind of situation – Justin Apr 27 '16 at 17:18
  • So what exactly ServerCall do? May be start debugging from there – Sameer Kumar Jain Apr 27 '16 at 19:00

1 Answers1

1

Without intimate knowledge of your environment, I'd say it appears ServerCall is a custom socket class that calls external functions, with n number of arguments.

getDeviceFirmwareLog would therefore be the function being called, and would be a native function to the API of the hardware (not PHP); this is why you wouldn't be able to find it with a grep search.

Consequently, unless it's rigged with event listeners, ServerCall would populate with the requested data asynchronously (which would likely still fire an event when the request completed).

As you're working with both Flash and PHP, it appears as though you might be testing this through a browser. If so, you could always try the native debugging tools in your browser (F12).

The PHP portion is harder as it's server side scripting, however, take a look at the Eclipse Plugin PDT, which offers debugging facilities for PHP code.

Atriace
  • 2,572
  • 1
  • 14
  • 27
  • Yes, this is what it was, ServerCall ended up linking to some php files which interacted with a second set of php files. Thats the reason I couldn't follow it. At the time I didn't know the second set even existed. Basically I would have ServerCall( somePhpCall, blah ) then in that php call there is a $success = (blah, otherPhpCall, blah ) which eventually led me to the functions I cared about. Sorry that this won't be useful to most people =/ Thanks for the help everyone! – Justin Apr 27 '16 at 21:21