Yoast_Api_Google

The Yoast SEO Yoast Api Google class.

Defined (1)

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

/vendor/yoast/api-libs/class-api-google.php  
  1. class Yoast_Api_Google { 
  2.  
  3. /** 
  4. * This class will be loaded when someone calls the API library with the Google analytics module 
  5. */ 
  6. public function __construct() { 
  7. spl_autoload_register( array( $this, 'autoload_api_google_files' ) ); 
  8.  
  9. /** 
  10. * Autoload the API Google class 
  11. * @param string $class_name - The class that should be loaded 
  12. */ 
  13. private function autoload_api_google_files( $class_name ) { 
  14. $path = dirname( __FILE__ ); 
  15. $class_name = strtolower( $class_name ); 
  16. $oauth_files = array( 
  17. // Main requires 
  18. 'yoast_google_client' => 'google/Google_Client',  
  19. 'yoast_api_google_client' => 'class-api-google-client',  
  20.  
  21. // Requires in classes 
  22. 'yoast_google_auth' => 'google/auth/Google_Auth',  
  23. 'yoast_google_assertion' => 'google/auth/Google_AssertionCredentials',  
  24. 'yoast_google_signer' => 'google/auth/Google_Signer',  
  25. 'yoast_google_p12signer' => 'google/auth/Google_P12Signer',  
  26. 'yoast_google_authnone' => 'google/auth/Google_AuthNone',  
  27. 'yoast_google_oauth2' => 'google/auth/Google_OAuth2',  
  28. 'yoast_google_verifier' => 'google/auth/Google_Verifier',  
  29. 'yoast_google_loginticket' => 'google/auth/Google_LoginTicket',  
  30. 'yoast_google_pemverifier' => 'google/auth/Google_PemVerifier',  
  31. 'yoast_google_model' => 'google/service/Google_Model',  
  32. 'yoast_google_service' => 'google/service/Google_Service',  
  33. 'yoast_google_serviceresource' => 'google/service/Google_ServiceResource',  
  34. 'yoast_google_utils' => 'google/service/Google_Utils',  
  35. 'yoast_google_batchrequest' => 'google/service/Google_BatchRequest',  
  36. 'yoast_google_mediafileupload' => 'google/service/Google_MediaFileUpload',  
  37. 'yoast_google_uritemplate' => 'google/external/URITemplateParser',  
  38. 'yoast_google_cache' => 'google/cache/Google_Cache',  
  39.  
  40. // Requests 
  41. 'yoast_google_cacheparser' => 'google/io/Google_CacheParser',  
  42. 'yoast_google_io' => 'google/io/Google_IO',  
  43. 'yoast_google_httprequest' => 'google/io/Google_HttpRequest',  
  44. 'yoast_google_rest' => 'google/io/Google_REST',  
  45.  
  46. // Wordpress 
  47. 'yoast_google_wpio' => 'google/io/Google_WPIO',  
  48. 'yoast_google_wpcache' => 'google/cache/Google_WPCache',  
  49. ); 
  50.  
  51. if ( ! empty( $oauth_files[$class_name] ) ) { 
  52. if ( file_exists( $path . '/' . $oauth_files[$class_name] . '.php' ) ) { 
  53. require_once( $path . '/' . $oauth_files[$class_name] . '.php' ); 
  54.  
  55.  
  56.