"Fossies" - the Fresh Open Source Software Archive

Member "libs/PHPCrawler/PHPCrawlerUrlPartsDescriptor.class.php" (8 Jan 2013, 1051 Bytes) of package /linux/www/SitemapCreator.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 /**
    3  * Describes the single parts of an URL.
    4  *
    5  * @package phpcrawl
    6  * @internal
    7  */
    8 class PHPCrawlerUrlPartsDescriptor
    9 {
   10   public $protocol;
   11   
   12   public $host;
   13   
   14   public $path;
   15   
   16   public $file;
   17   
   18   public $domain;
   19   
   20   public $port;
   21   
   22   public $auth_username;
   23   
   24   public $auth_password;
   25   
   26   /**
   27    * Returns the PHPCrawlerUrlPartsDescriptor-object for the given URL.
   28    *
   29    * @return PHPCrawlerUrlPartsDescriptor
   30    */
   31   public static function fromURL($url)
   32   {
   33     $parts = PHPCrawlerUtils::splitURL($url);
   34     
   35     $tmp = new PHPCrawlerUrlPartsDescriptor();
   36     
   37     $tmp->protocol = $parts["protocol"];
   38     $tmp->host = $parts["host"];
   39     $tmp->path = $parts["path"];
   40     $tmp->file = $parts["file"];
   41     $tmp->domain = $parts["domain"];
   42     $tmp->port = $parts["port"];
   43     $tmp->auth_username = $parts["auth_username"];
   44     $tmp->auth_password = $parts["auth_password"];
   45     
   46     return $tmp;
   47   }
   48   
   49   public function toArray()
   50   {
   51     return get_object_vars($this);
   52   }
   53 }
   54 ?>