- Timestamp:
- 10/05/08 02:35:59 (2 months ago)
- Location:
- lang/php/Scraper
- Files:
-
- 4 modified
-
library/Diggin/Scraper/Adapter/Htmlscraping.php (modified) (4 diffs)
-
library/Diggin/Scraper/Process.php (modified) (1 diff)
-
library/Diggin/Uri/Http.php (modified) (1 diff)
-
tests/Diggin/Uri/HttpTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/Scraper/library/Diggin/Scraper/Adapter/Htmlscraping.php
r20204 r20745 24 24 */ 25 25 26 /** 27 * @see Diggin_Scraper_Adapter_Interface 28 */ 26 29 require_once 'Diggin/Scraper/Adapter/Interface.php'; 27 30 … … 46 49 $xhtml = $this->getXhtml($response); 47 50 } catch (Exception $e) { 48 throw $e; 51 require_once 'Diggin/Scraper/Adapter/Exception.php'; 52 throw new Diggin_Scraper_Adapter_Exception($e); 49 53 } 50 54 … … 66 70 $responseBody = str_replace('&', '&', $responseBody); 67 71 try { 68 $xml_object = @new SimpleXMLElement($responseBody); 72 //@see http://php.net/libxml.constants 73 if (isset($this->config['libxmloptions'])) { 74 $xml_object = @new SimpleXMLElement($responseBody, $this->config['libxmloptions']); 75 } else { 76 $xml_object = @new SimpleXMLElement($responseBody); 77 } 69 78 } catch (Exception $e) { 70 throw $e; 79 require_once 'Diggin/Scraper/Adapter/Exception.php'; 80 throw new Diggin_Scraper_Adapter_Exception($e); 71 81 } 72 82 … … 280 290 $declarations .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '; 281 291 $declarations .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; 282 $responseBody = "$declarations$responseBody"; 283 284 return $responseBody; 292 293 return "$declarations$responseBody"; 285 294 } 286 295 -
lang/php/Scraper/library/Diggin/Scraper/Process.php
r17673 r20745 24 24 public $processes; 25 25 26 /** 27 * 28 * 29 * @return UnTokenize process 30 */ 26 31 public function __toString() 27 32 { 28 return '\''.$this->expression.'\' , '. 29 $this->name.' => '. $this->type. '"'; 33 if ($this->processes instanceof Diggin_Scraper_Process) { 34 return '\''.$this->expression.'\', '. 35 "'".$this->name.' => " (Diggin_Scraper_Process)"'; 36 } 37 38 if ($this->filters !== false) { 39 return '\''.$this->expression.'\', '. 40 "'".$this->name.' => ["'. $this->type. '", "'.$this->filters.'"]\''; 41 } 42 43 return '\''.$this->expression.'\', '. 44 "'".$this->name.' => "'. $this->type. '"\''; 30 45 } 31 46 -
lang/php/Scraper/library/Diggin/Uri/Http.php
r20656 r20745 45 45 } 46 46 } 47 /* 48 } else if(class_exists('Rhaco')) { 49 Rhaco::import('network.Url'); 50 return Url::parseAbsolute($base_url, $url); 51 */ 47 52 //Net_URL2 ver 0.2.0 48 53 } else { -
lang/php/Scraper/tests/Diggin/Uri/HttpTest.php
r20533 r20745 1 1 <?php 2 //$rhacopath = '/media/disk-1/work/rhaco2/2_0'; 3 //set_include_path(get_include_path().PATH_SEPARATOR.$rhacopath); 4 //require_once 'Rhaco.php'; 5 //Rhaco::import('network.Url'); 6 //var_dump(Url::parseAbsolute('http://yahoo.com/test/test.cgi?hoge=bar', '?param=foo')); 7 //var_dump(Url::parseAbsolute('http://yahoo.com/test/', '../index.html')); 8 //var_dump(get_include_path());exit; 9 2 10 require_once 'PHPUnit/Framework.php'; 3 11 … … 43 51 public function testGetAbsoluteUrl() 44 52 { 53 54 45 55 //if 46 56 $this->assertEquals('http://yahoo.com/test/',
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)