404

[ Avaa Bypassed ]




Upload:

Command:

botdev@13.59.84.174: ~ $
<?php
// use function Google\Cloud\Samples\PubSub\publish_message;
include "tools/simple_html_dom.php";
include "DatabaseHandler.php";
include 'MiniCurl.php';
class PluralDatabase extends DatabaseHandler{
        public $url;
	function __construct(){
		parent::__construct("conjuct");
	}
        public function getPlural($noun){
            $this->url = "https://dict.leo.org/dictQuery/m-vocab/ende/query.xml?lang=de&search=$noun&side=both&order=advanced&sectLenMax=16";
            $pattern ='/<t n="forms_pl_form">Pl\.:<\/t><\/m><\/i> die[\s\S](.*?)<\/small>/';
             $subject = file_get_contents($this->url);
            preg_match($pattern, $subject, $matches);
            return trim($matches[1]); 
        }
	public function fillPluralNouns(){
		$i=0;
		$nouns = $this->getNounsFromDatabse();
		foreach ($nouns as $noun){
			if(!empty($noun)){
				$i++;
                                $pluralForm = $this->getPlural($noun['word']);
				$this->fillPluralInDb($noun['word'], $pluralForm);
				echo $i."-".$noun['word'].":".$pluralForm.PHP_EOL;
			}
			
		}
	}
	public function getNounsFromDatabse(){
		$sql = 'SELECT word FROM `dictionary` WHERE translationrate = 0 AND artikel != "-" GROUP BY word limit 40';
		$this->connection->query ( "SET NAMES utf8" );
		$result = $this->connection->query ( $sql ) or die ( $this->connection->error );
		while ($wordArrayResult[] = mysqli_fetch_assoc($result));
		return $wordArrayResult;
	}
	public function fillPluralInDb($noun, $pluralForm){
			$sql = "UPDATE `".DatabaseHandler::$databaseName."`.`dictionary` SET translationrate = 1, plural = '$pluralForm' where word like '$noun'";
			$this->connection->query ( "SET NAMES utf8" );
			$result = $this->connection->query ( $sql ) or die( $this->connection->error );
			return 1;
	}
	
}
//$pluralWorker = new PluralWorker("buch");
//$pluralWorker->getPlural();
$pluralDb = new PluralDatabase();
$pluralDb->fillPluralNouns();

?>

Filemanager

Name Type Size Permission Actions
FillConjuctions.php File 5.67 KB 0755
FillPlurals.php File 1.94 KB 0755
FillReflexiveVerbs.php File 2.59 KB 0755
MiniCurl.php File 2.47 KB 0755