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
5114c866
Commit
5114c866
authored
Jan 29, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
20cc0e21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
media.class.php
media.class.php
+9
-5
No files found.
media.class.php
View file @
5114c866
...
...
@@ -186,6 +186,7 @@ class Media {
$array
[
"Schauspieler"
]
=
$imdb
->
getCastAsOwn
(
0
,
false
);
}
else
{
echo
$this
->
Console
->
error
(
"imdbID nicht bei imdb gefunden!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"Keine Infos auf imdbID gefunden: "
.
$Pfad
.
$FilenameOrg
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
echo
" done!"
.
PHP_EOL
;
...
...
@@ -220,6 +221,7 @@ class Media {
$array
[
"channelsger"
]
=
substr
(
$array
[
"channelsger"
],
strripos
(
$array
[
"channelsger"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
echo
$this
->
Console
->
error
(
"channelsger ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelsger ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -232,6 +234,7 @@ class Media {
$array
[
"channelseng"
]
=
substr
(
$array
[
"channelseng"
],
strripos
(
$array
[
"channelseng"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
echo
$this
->
Console
->
error
(
"channelseng ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelseng ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -257,16 +260,17 @@ class Media {
file_put_contents
(
"./phpTestout/"
.
$array
[
'imdbID'
]
.
".txt"
,
$copy
.
PHP_EOL
,
FILE_APPEND
);
echo
$copy
.
"done!"
.
PHP_EOL
;
}
shell_exec
(
"mv './phpTestout/"
.
$array
[
"imdbID"
]
.
".txt' './phpTestout/OK_"
.
$array
[
"imdbID"
]
.
".txt'"
);
return
true
;
}
else
{
echo
$this
->
Console
->
error
(
"Fehler beim Eintragen in die DB!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"Fehler beim Eintragen in die DB"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
/*foreach ($array as $key => $value) {
echo " ".$key." => '".$value."'".PHP_EOL;
}*/
}
else
{
echo
$this
->
Console
->
error
(
"Datei Existiert nicht!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/default.txt"
,
"Datei existiert nicht: "
.
$Pfad
.
$Filename
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -282,8 +286,8 @@ class Media {
}
// Jetzt noch MD5 berechnen
echo
"Berechne MD5... "
;
//$array
["md5"] = md5_file($Pfad.$FilenameOrg); //TODO Einkommentieren für md5
$DataArr
[
"md5"
]
=
substr
(
shell_exec
(
'md5sum -b "'
.
$File
.
'"'
),
0
,
32
);
$DataArr
[
"md5"
]
=
md5_file
(
$Pfad
.
$FilenameOrg
);
//TODO Einkommentieren für md5
//
$DataArr["md5"] = substr(shell_exec('md5sum -b "'.$File.'"'),0,32);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"md5 = "
.
$DataArr
[
"md5"
]
.
PHP_EOL
,
FILE_APPEND
);
//$array["md5"] = substr(shell_exec('md5sum -b "'."/tmp/".$DataArr["imdbID"].".xml".'"'),0,32);
echo
" done!"
.
PHP_EOL
;
...
...
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