Commit a66d94b0 authored by Nico Schallehn's avatar Nico Schallehn

update init

parent 097e197a
...@@ -78,10 +78,11 @@ class Media { ...@@ -78,10 +78,11 @@ class Media {
break; break;
} }
} }
public function filme(){ public function filme($action = "einlesen"){
$start = time(); $start = time();
if($action == "einlesen"){
//var_dump($this->config); //var_dump($this->config);
echo $this->Console->getColoredString("Filme", "black", "light_gray") .PHP_EOL; echo $this->Console->getColoredString("Filme > einlesen", "black", "light_gray") .PHP_EOL;
echo "In welchen Verzeichnis liegen die einzulesenden Dateien? ( nur Enter = ".$this->config["ReadFromDir"].")" .PHP_EOL; echo "In welchen Verzeichnis liegen die einzulesenden Dateien? ( nur Enter = ".$this->config["ReadFromDir"].")" .PHP_EOL;
$Pfad = trim(fgets(STDIN)); $Pfad = trim(fgets(STDIN));
...@@ -158,6 +159,23 @@ class Media { ...@@ -158,6 +159,23 @@ class Media {
echo PHP_EOL; echo PHP_EOL;
//return ; //return ;
} }
else if($action == "update"){
echo $this->Console->getColoredString("Filme > update", "black", "light_gray") .PHP_EOL;
$mysqli = new mysqli($this->config["DB_Server"],$this->config["DB_Username"],$this->config["DB_Passwort"],$this->config["DB_Database"]);
if($mysqli->connect_error != ""){ echo "Mysql-Fehler: ".$mysqli->connect_error.PHP_EOL; return false;}
$Query = "SELECT * FROM Filme ;";
//echo $Query.PHP_EOL;
$result = $mysqli->query($Query); //TODO 3D überprüfung!!!
if($mysqli->error != ""){ echo "Mysql-Fehler: ".$mysqli->error.PHP_EOL; return false;}
while ($Film = $result->fetch_assoc()){
echo $Film->imdbID.PHP_EOL;
}
}
}
private function parseMovie($Pfad, $Filename){ private function parseMovie($Pfad, $Filename){
$PfadOrg = $Pfad; $PfadOrg = $Pfad;
$Pfad = $this->PfadzumEinlesen.'/'.$Pfad; $Pfad = $this->PfadzumEinlesen.'/'.$Pfad;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment