Commit 2966f912 authored by Nico Schallehn's avatar Nico Schallehn

test

parent 366f157e
<?php
class Media {
function __construct() {
;
private $Console;
private $configfile;
private $config;
public function __construct($configfile) {
$this->Console = new Console();
$this->configfile = $configfile;
if(file_exists($configfile)){
echo $this->Console->getColoredString("Hinweis:","black", "light_gray")." Configfile: ".$configfile." geladen!";
}
else{
echo $this->Console->getColoredString("Hinweis:","black", "light_gray")." Configfile: ".$configfile." exisitiert nicht! Es werden defaults geladen!";
echo " Zum Anlegen der config bitte config save eingeben!";
$this->config = array("configChangeTime" => time(),
"HDD" => array(1 => array("HDDdir"=>"/media/QNAP/",
"FolderFilme" => "Filme/",
"Folder3D" => "Filme3D/"),
2 => NULL,
3 => NULL,
4 => NULL,
5 => NULL)
);
}
}
public function config_save(){
}
}
\ No newline at end of file
......@@ -4,7 +4,9 @@ include './media.class.php';
$Console = new Console();
$Media = new Media();
$Console->clearscreen();
$Media = new Media("config.json");
......@@ -15,13 +17,15 @@ $exit = false;
do{
$Console->clearscreen();
echo $Console->getColoredString("Benutzung:", "black", "light_gray") .PHP_EOL.PHP_EOL;
echo " filme Filme aus einen Verzeichnis zur DB hinzufügen".PHP_EOL;
echo " exit beendet das Programm".PHP_EOL.PHP_EOL;
echo " filme Filme aus einen Verzeichnis zur DB hinzufügen".PHP_EOL;
echo " config save Speichert die Konfiguration!".PHP_EOL;
echo " exit beendet das Programm".PHP_EOL.PHP_EOL;
echo "Bitte Befehl eingeben: ";
$name = trim(fgets(STDIN));
$Console->clearscreen();
//echo "Hallo $name \n";
switch ($name){
case "exit":
......@@ -34,8 +38,8 @@ do{
break;
}
echo "Weiter mit (ENTER)".PHP_EOL;
trim(fgets(STDIN));
//echo "Weiter mit (ENTER)".PHP_EOL;
//trim(fgets(STDIN));
}while(!$exit);
......
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