Example #1
0
 /**
  * Validate a pair of application name and API key. The method
  * will return a boolean value to indicate whether the data is
  * a valid combination or not.
  */
 public static function validate($appName, $apiKey)
 {
     // Request credentials from database
     $database = new Database();
     $credentials = $database->getAuthenticationData($appName, $apiKey);
     // Empty result means invalid name/key
     return count($credentials) > 0;
 }