Code Duplication    Length = 24-24 lines in 2 locations

admin/sxd/index.php 2 locations

@@ 594-617 (lines=24) @@
591
		$time_old = time();
592
		$exit_time = $time_old + $this->CFG['time_web'] - 1;
593
		while($q = sxd_read_sql($this->fh_tmp, $seek, $ei)){	
594
			if($time_old < time()) {
595
				if(file_exists($this->JOB['file_stp'])){
596
					$type = file_get_contents($this->JOB['file_stp']);
597
					$this->rtl[9] = !empty($type) ? $type : 2;
598
					fseek($this->fh_rtl, 0);
599
					$this->rtl[1] = time();
600
					fwrite($this->fh_rtl, implode("\t", $this->rtl));
601
					/*if($type == 1) {
602
						
603
					}*/
604
					unset($this->rtl);
605
					exit;
606
				}
607
				$time_old = time();
608
				if($time_old >= $exit_time){
609
					$this->rtl[9] = 3;
610
					fseek($this->fh_rtl, 0);
611
					$this->rtl[1] = time();
612
					fwrite($this->fh_rtl, implode("\t", $this->rtl));
613
					unset($this->rtl);
614
					exit;
615
				}
616
				clearstatcache(); 
617
			}
618
			switch($q{0}){
619
				case '(':
620
					if($continue) {
@@ 774-797 (lines=24) @@
771
		while($q = sxd_read_sql($this->fh_tmp, $seek, $ei, $delimiter, $this->JOB['eol'])){
772
			$q = ltrim($q);
773
			if(empty($q)) break;
774
			if($time_old < time()) {
775
				if(file_exists($this->JOB['file_stp'])){
776
					$type = file_get_contents($this->JOB['file_stp']);
777
					$this->rtl[9] = !empty($type) ? $type : 2;
778
					fseek($this->fh_rtl, 0);
779
					$this->rtl[1] = time();
780
					fwrite($this->fh_rtl, implode("\t", $this->rtl));
781
					/*if($type == 1) {
782
						
783
					}*/
784
					unset($this->rtl);
785
					exit;
786
				}
787
				$time_old = time();
788
				if($time_old >= $exit_time){
789
					$this->rtl[9] = 3;
790
					fseek($this->fh_rtl, 0);
791
					$this->rtl[1] = time();
792
					fwrite($this->fh_rtl, implode("\t", $this->rtl));
793
					unset($this->rtl);
794
					exit;
795
				}
796
				clearstatcache(); 
797
			}
798
			do {
799
				$repeat = false;
800
				//error_log("-----------------\n[{$q}]\n", 3, "q.log");