Yoast_Api_Libs

Include this class to use the Yoast_Api_Libs, you can include this as a submodule in your project and you just have to autoload this class.

Defined (1)

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

/vendor/yoast/api-libs/class-api-libs.php  
  1. class Yoast_Api_Libs { 
  2.  
  3. /** 
  4. * Current version number of the API-libs 
  5. */ 
  6. const version = '2.0'; 
  7.  
  8. /** 
  9. * Check if minimal required version is met. 
  10. * @param string $minimal_required_version 
  11. * @throws Exception 
  12. */ 
  13. public function __construct( $minimal_required_version ) { 
  14. $this->load_google(); 
  15.  
  16. if ( ! version_compare( self::version, $minimal_required_version, '>=' )) { 
  17. throw new Exception( 'required_version' ); 
  18.  
  19. /** 
  20. * Loading the google api library which will set the autoloader 
  21. */ 
  22. private function load_google() { 
  23. if ( ! class_exists('Yoast_Api_Google', false) ) { 
  24. // Require the file 
  25. require_once dirname( __FILE__ ) . '/' . 'class-api-google.php'; 
  26.  
  27. // Initialize the Google API Class to set the autoloader 
  28. new Yoast_Api_Google(); 
  29.