swagger_autoloader

The Membership 2 swagger autoloader function.

Description

swagger_autoloader( (string) $className ); 

Parameters (1)

0. $classname (string)
The class to attempt to load

Usage

  1. if ( !function_exists( 'swagger_autoloader' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/lib/taxamo/Taxamo/Swagger.php'; 
  3.  
  4. // the class to attempt to load 
  5. $classname = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = swagger_autoloader($classname); 
  9.  

Defined (1)

The function is defined in the following location(s).

/lib/taxamo/Taxamo/Swagger.php  
  1. function swagger_autoloader($className) { 
  2. $currentDir = dirname(__FILE__); 
  3. if (file_exists($currentDir . '/models/' . lcfirst($className) . '.php')) { 
  4. include $currentDir . '/models/' . lcfirst($className) . '.php'; 
  5. } elseif (file_exists($currentDir . '/' . lcfirst($className) . '.php')) { 
  6. include $currentDir . '/' . lcfirst($className) . '.php'; 
  7. } elseif (file_exists($currentDir . '/' . $className . '.php')) { 
  8. include $currentDir . '/' . $className . '.php'; 
  9. } elseif (file_exists($currentDir . '/models/' . $className . '.php')) { 
  10. include $currentDir . '/models/' . $className . '.php';