[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/web_spider/src/ -> lmbInnerUriNormalizerObserver.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  /**

  11   * class lmbInnerUriNormalizerObserver.

  12   *

  13   * @package web_spider

  14   * @version $Id: lmbInnerUriNormalizerObserver.class.php 5945 2007-06-06 08:31:43Z pachanga $

  15   */
  16  class lmbInnerUriNormalizerObserver
  17  {
  18    protected $base_uri = null;
  19  
  20    function __construct($base_uri)
  21    {
  22      $this->base_uri = $base_uri;
  23    }
  24  
  25    function notify($reader)
  26    {
  27      $uri = $reader->getUri();
  28      if($uri->getHost() != $this->base_uri->getHost())
  29        return;
  30      if($uri->getPort() != $this->base_uri->getPort())
  31        return;
  32      if($uri->getProtocol() != $this->base_uri->getProtocol())
  33        return;
  34  
  35      $uri->setHost('');
  36      $uri->setPort('');
  37      $uri->setProtocol('');
  38    }
  39  }
  40  
  41  ?>


Generated: Fri Aug 29 04:49:26 2008 Cross-referenced by PHPXref 0.7