PHP: unable to locate functions being used (seemingly not defined)

107 Views Asked by At

I'm looking at someone else's code. There's class that calls functions like GetSku(), WriteOrder($order), etc., but I unable to find where these are located. I've checked for …

  • Other script or class inclusions: no explicit or magic functions (__call) defined
  • grep -rHn "n *GetSku" /path/to/codebase: returns nothing
  • Sublime's cTags: nothing found
  • Original developer's knowledge base: he returned an error when I made an email request

These mysterious function are called literally like…

$sku = GetSku();
WriteOrder($order);

What could possibly define and them them work? Custom magic functions somehow? Some kind of dynamic functions? I'm scratching my head like a monkey with an iPhone.

2

There are 2 best solutions below

1
On BEST ANSWER

Maybe the class was included in a php file that is including some external libraries? The functions might be taken from these libraries.

0
On

Could you check on the actual server if this attribute is set in php.ini?

auto_prepend_file 

Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require function, so include_path is used.

The special value none disables auto-prepending.

This could be the method how non-existing functions could be loaded from external files outside the project scope.