GFP_Stripe_Loader

Adapted from WP Metadata API UI.

Defined (1)

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

/includes/class-gfp-stripe-loader.php  
  1. class GFP_Stripe_Loader { 
  2.  
  3. private static $_autoload_classes = array( 
  4. 'GFP_Stripe' => 'class-gfp-stripe.php',  
  5. 'GFP_Stripe_Data' => 'class-gfp-stripe-data.php',  
  6. 'GFP_Stripe_List_Table' => 'class-gfp-stripe-list-table.php',  
  7. ); 
  8.  
  9. static function load () { 
  10. spl_autoload_register( array( __CLASS__, '_autoloader' ) ); 
  11.  
  12. /** 
  13. * @param string $class_name 
  14. * @param string $class_filepath 
  15. * @return bool Return true if it was registered, false if not. 
  16. */ 
  17. static function register_autoload_class ( $class_name, $class_filepath ) { 
  18.  
  19. if ( ! isset( self::$_autoload_classes[$class_name] ) ) { 
  20.  
  21. self::$_autoload_classes[$class_name] = $class_filepath; 
  22.  
  23. return true; 
  24.  
  25.  
  26. return false; 
  27.  
  28.  
  29. /** 
  30. * @param string $class_name 
  31. */ 
  32. static function _autoloader ( $class_name ) { 
  33.  
  34. if ( isset( self::$_autoload_classes[$class_name] ) ) { 
  35.  
  36. $filepath = self::$_autoload_classes[$class_name]; 
  37.  
  38. /** 
  39. * @todo This needs to be made to work for Windows... 
  40. */ 
  41. if ( '/' == $filepath[0] ) { 
  42.  
  43. require_once( $filepath ); 
  44.  
  45. else { 
  46.  
  47. require_once( dirname( __FILE__ ) . "/{$filepath}" ); 
  48.  
  49.  
  50.