/** * create an instance of Pivotal class * @param $_source */ private function getCapInstance(&$_source) { $this->_mark = FALSE; $_Captal = new Pivotal(self::$_Config, $_source); $_tagA = $_Captal->parseUrl(); $this->_mark = TRUE; return $_tagA; }
public function parseUrl() { $this->pregTag(); $_Img_Length = count($this->_tagImg); for ($i = 0; $i < $_Img_Length; $i++) { if (stripos($this->_tagImg[$i], self::$_CapSite['domain_name']) === FALSE) { continue; } do { if (($_file_path = $this->grabImage($this->_tagImg[$i])) == NULL) { break; } echo '正在抓取: ' . $this->_tagImg[$i] . '\\n\\r'; /** * sleep( $second ) * Delays the program execution for the given number of seconds */ sleep(self::$_interval * self::$_markTime); if ($this->_mark === TRUE) { self::$_markTime = self::$_interval; break; } if (@unlink($_file_path) === FALSE) { break; } self::$_markTime *= 2; } while (true); } return $this->_tagA; }