Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBPythonScripte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBPythonScripte
Commits
15cfa454
Commit
15cfa454
authored
Jan 26, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
33a7003f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
25 deletions
+36
-25
media.class.php
media.class.php
+30
-12
media.php
media.php
+6
-13
No files found.
media.class.php
View file @
15cfa454
...
@@ -45,6 +45,11 @@ class Media {
...
@@ -45,6 +45,11 @@ class Media {
}
}
}
}
public
function
config_show
(){
public
function
config_show
(){
}
public
function
config
(
$Action
){
switch
(
$Action
){
case
"show"
:
//var_dump($this->config);
//var_dump($this->config);
echo
$this
->
Console
->
getColoredString
(
"Folgende Config ist geladen:"
,
"black"
,
"light_gray"
)
.
PHP_EOL
.
PHP_EOL
;
echo
$this
->
Console
->
getColoredString
(
"Folgende Config ist geladen:"
,
"black"
,
"light_gray"
)
.
PHP_EOL
.
PHP_EOL
;
echo
"Config erstellt: "
.
date
(
"H:i:s d.m.Y "
,
$this
->
config
[
"configChangeTime"
])
.
PHP_EOL
;
echo
"Config erstellt: "
.
date
(
"H:i:s d.m.Y "
,
$this
->
config
[
"configChangeTime"
])
.
PHP_EOL
;
...
@@ -52,21 +57,34 @@ class Media {
...
@@ -52,21 +57,34 @@ class Media {
if
(
$value
[
"HDDdir"
]
!=
NULL
){
if
(
$value
[
"HDDdir"
]
!=
NULL
){
echo
"HDD "
.
$key
.
": Mount: "
.
$value
[
"HDDdir"
]
.
PHP_EOL
;
echo
"HDD "
.
$key
.
": Mount: "
.
$value
[
"HDDdir"
]
.
PHP_EOL
;
echo
" FolderFilme: "
.
$value
[
"FolderFilme"
]
.
PHP_EOL
;
echo
" FolderFilme: "
.
$value
[
"FolderFilme"
]
.
PHP_EOL
;
echo
" Folder3D : "
.
$value
[
"Folder3D"
]
.
PHP_EOL
.
PHP_EOL
;
echo
" Folder3D : "
.
$value
[
"Folder3D"
]
.
PHP_EOL
;
}
}
}
}
echo
PHP_EOL
;
echo
PHP_EOL
;
return
0
;
return
0
;
}
break
;
public
function
config_save
(){
case
"save"
:
$dateihandle
=
fopen
(
$this
->
configfile
,
"w"
);
$dateihandle
=
fopen
(
$this
->
configfile
,
"w"
);
fwrite
(
$dateihandle
,
json_encode
(
$this
->
config
,
JSON_PRETTY_PRINT
));
fwrite
(
$dateihandle
,
json_encode
(
$this
->
config
,
JSON_PRETTY_PRINT
));
fclose
(
$dateihandle
);
fclose
(
$dateihandle
);
break
;
}
}
public
function
filme
(){
//var_dump($this->config);
echo
$this
->
Console
->
getColoredString
(
"Folgende Config ist geladen:"
,
"black"
,
"light_gray"
)
.
PHP_EOL
.
PHP_EOL
;
echo
"Config erstellt: "
.
date
(
"H:i:s d.m.Y "
,
$this
->
config
[
"configChangeTime"
])
.
PHP_EOL
;
foreach
(
$this
->
config
[
"HDD"
]
as
$key
=>
$value
)
{
if
(
$value
[
"HDDdir"
]
!=
NULL
){
echo
"HDD "
.
$key
.
": Mount: "
.
$value
[
"HDDdir"
]
.
PHP_EOL
;
echo
" FolderFilme: "
.
$value
[
"FolderFilme"
]
.
PHP_EOL
;
echo
" Folder3D : "
.
$value
[
"Folder3D"
]
.
PHP_EOL
;
}
}
echo
PHP_EOL
;
return
0
;
}
}
...
...
media.php
View file @
15cfa454
...
@@ -8,14 +8,8 @@ $Console->clearscreen();
...
@@ -8,14 +8,8 @@ $Console->clearscreen();
$Media
=
new
Media
(
"config.json"
);
$Media
=
new
Media
(
"config.json"
);
$exit
=
false
;
$exit
=
false
;
do
{
do
{
echo
$Console
->
getColoredString
(
"Benutzung:"
,
"black"
,
"light_gray"
)
.
PHP_EOL
.
PHP_EOL
;
echo
$Console
->
getColoredString
(
"Benutzung:"
,
"black"
,
"light_gray"
)
.
PHP_EOL
.
PHP_EOL
;
...
@@ -29,16 +23,15 @@ do{
...
@@ -29,16 +23,15 @@ do{
$name
=
trim
(
fgets
(
STDIN
));
$name
=
trim
(
fgets
(
STDIN
));
$Console
->
clearscreen
();
$Console
->
clearscreen
();
//echo "Hallo $name \n";
//echo "Hallo $name \n";
switch
(
$name
){
$nameArr
=
explode
(
" "
,
$name
);
switch
(
$name
[
0
]){
case
"filme"
:
case
"filme"
:
echo
$Console
->
getColoredString
(
"Filme"
,
"black"
,
"light_gray"
)
.
PHP_EOL
;
echo
$Console
->
getColoredString
(
"Filme"
,
"black"
,
"light_gray"
)
.
PHP_EOL
;
break
;
break
;
case
"config save"
:
case
"config"
:
$Media
->
config_save
();
$Media
->
config
(
$name
[
1
]);
break
;
case
"config show"
:
$Media
->
config_show
();
break
;
break
;
case
"exit"
:
case
"exit"
:
$exit
=
true
;
$exit
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment