Merge commit '08864f79347e912e990f5ce0e86e5a8e739dc29d'
Conflicts: VERSION airtime_mvc/application/configs/conf.php airtime_mvc/application/models/Shows.php
This commit is contained in:
commit
d14dc6cbe3
2 changed files with 15 additions and 6 deletions
|
@ -1170,10 +1170,7 @@ class StoredFile {
|
|||
return TRUE;
|
||||
}
|
||||
else {
|
||||
return PEAR::raiseError(
|
||||
"StoredFile::deleteFile: unlink failed ({$this->filepath})",
|
||||
GBERR_FILEIO
|
||||
);
|
||||
return PEAR::raiseError("StoredFile::deleteFile: unlink failed ({$this->filepath})");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1233,7 +1230,10 @@ class StoredFile {
|
|||
$files = StoredFile::getAll();
|
||||
foreach ($files as $file) {
|
||||
$media = StoredFile::Recall($file["id"]);
|
||||
$media->delete();
|
||||
$result = $media->delete();
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,10 @@ function airtime_empty_db($db)
|
|||
Playlist::deleteAll();
|
||||
|
||||
echo " * Clearing files table...".PHP_EOL;
|
||||
StoredFile::deleteAll();
|
||||
$result = StoredFile::deleteAll();
|
||||
if (PEAR::isError($result)) {
|
||||
echo $result->getMessage().PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,6 +92,12 @@ if (isset($opts->h)) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Need to check that we are superuser before running this.
|
||||
if (exec("whoami") != "root") {
|
||||
echo PHP_EOL."You must be root to use this script.".PHP_EOL.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE);
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue