Search code examples
phpclassmagic-function

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


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.


Solution

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