diff OnlineURIValidator.inc @ 94:2370f4450983

Document functions and move a few functions to more appropriate places.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Thu, 18 Oct 2012 17:33:34 +0200
parents 8aadd7a23b68
children
line wrap: on
line diff
--- a/OnlineURIValidator.inc	Thu Oct 18 16:44:48 2012 +0200
+++ b/OnlineURIValidator.inc	Thu Oct 18 17:33:34 2012 +0200
@@ -8,24 +8,19 @@
 $cache->includeOnce('OnlineValidator.inc', $baseDir);
 /// @endcond
 
-
+/**
+ * Defines a validator which uses an online validator and a URI to the
+ * content
+ */
 class OnlineURIValidator extends OnlineValidator
 {
   private $uri;
 
-  static function get_url_contents($url)
-  {
-    $crl = curl_init();
-    $timeout = 5;
-
-    curl_setopt ($crl, CURLOPT_URL, $url);
-    curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
-    curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
-    $ret = curl_exec($crl);
-    curl_close($crl);
-    return $ret;
-  }
-
+  /**
+   * Constructs an OnlineURIValidator
+   *
+   * @param $uri The uri to validate
+   */
   function __construct($uri)
   {
     $this->uri = $uri;
@@ -40,6 +35,11 @@
     return $headers['X-W3C-Validator-Status'] === "Valid";
   }
 
+  /**
+   * Gets the URI for this validator
+   *
+   * @return string with the URI
+   */
   function getUri()
   {
     return $this->uri;