Merge branch 'master' of dev.sourcefabric.org:airtime
Conflicts: VERSION airtime_mvc/application/configs/conf.php airtime_mvc/application/models/Playlist.php airtime_mvc/application/models/Schedule.php airtime_mvc/application/models/Shows.php airtime_mvc/application/models/StoredFile.php airtime_mvc/application/views/scripts/form/preferences_general.phtml airtime_mvc/application/views/scripts/user/remove-user.phtml airtime_mvc/public/js/airtime/schedule/add-show.js airtime_mvc/public/js/airtime/schedule/schedule.js install/airtime-upgrade.php install/include/AirtimeInstall.php python_apps/api_clients/api_client.py utils/airtime-clean-storage utils/airtime-clean-storage.php utils/airtime-import utils/airtime-import.php
This commit is contained in:
commit
eb76bbe7f0
17 changed files with 254 additions and 129 deletions
|
@ -14,13 +14,16 @@ require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
|||
AirtimeInstall::ExitIfNotRoot();
|
||||
AirtimeInstall::DbConnect(true);
|
||||
|
||||
if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) {
|
||||
$version = "1.7.0";
|
||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
||||
}
|
||||
else {
|
||||
$version = "1.6";
|
||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
||||
$version = AirtimeInstall::GetAirtimeVersion();
|
||||
if (!$version){
|
||||
if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) {
|
||||
$version = "1.7.0";
|
||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
||||
}
|
||||
else {
|
||||
$version = "1.6";
|
||||
echo "Airtime Version: ".$version." ".PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
echo "******************************** Update Begin *********************************".PHP_EOL;
|
||||
|
@ -31,6 +34,9 @@ if(strcmp($version, "1.7.0") < 0) {
|
|||
if(strcmp($version, "1.8.0") < 0) {
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.9.0") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
|
||||
}
|
||||
|
||||
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
||||
|
||||
|
|
|
@ -124,9 +124,9 @@ class AirtimeInstall
|
|||
|
||||
echo "* Creating Airtime database user".PHP_EOL;
|
||||
|
||||
// Create the database user
|
||||
$command = "sudo -u postgres psql postgres --command \"CREATE USER {$CC_CONFIG['dsn']['username']} "
|
||||
." ENCRYPTED PASSWORD '{$CC_CONFIG['dsn']['password']}' LOGIN CREATEDB NOCREATEUSER;\" 2>/dev/null";
|
||||
$username = $CC_CONFIG['dsn']['username'];
|
||||
$password = $CC_CONFIG['dsn']['password'];
|
||||
$command = "echo \"CREATE USER $username ENCRYPTED PASSWORD '$password' LOGIN CREATEDB NOCREATEUSER;\" | sudo -u postgres psql";
|
||||
|
||||
@exec($command, $output, $results);
|
||||
if ($results == 0) {
|
||||
|
@ -148,7 +148,9 @@ class AirtimeInstall
|
|||
|
||||
echo "* Creating Airtime database".PHP_EOL;
|
||||
|
||||
$command = "sudo -u postgres createdb {$CC_CONFIG['dsn']['database']} --owner {$CC_CONFIG['dsn']['username']} 2> /dev/null";
|
||||
$database = $CC_CONFIG['dsn']['database'];
|
||||
$username = $CC_CONFIG['dsn']['username'];
|
||||
$command = "echo \"CREATE DATABASE $database OWNER $username\" | sudo -u postgres psql";
|
||||
@exec($command, $output, $results);
|
||||
if ($results == 0) {
|
||||
echo "* Database '{$CC_CONFIG['dsn']['database']}' created.".PHP_EOL;
|
||||
|
@ -324,13 +326,13 @@ class AirtimeInstall
|
|||
global $CC_CONFIG;
|
||||
|
||||
echo "* Creating logs directory ".AirtimeInstall::CONF_DIR_LOG.PHP_EOL;
|
||||
|
||||
|
||||
$path = AirtimeInstall::CONF_DIR_LOG;
|
||||
$file = $path.'/zendphp.log';
|
||||
if (!file_exists($path)){
|
||||
mkdir($path, 0755, true);
|
||||
}
|
||||
|
||||
|
||||
touch($file);
|
||||
chmod($file, 0755);
|
||||
chown($file, $CC_CONFIG['webServerUser']);
|
||||
|
@ -340,7 +342,7 @@ class AirtimeInstall
|
|||
public static function RemoveLogDirectories(){
|
||||
$path = AirtimeInstall::CONF_DIR_LOG;
|
||||
echo "* Removing logs directory ".$path.PHP_EOL;
|
||||
|
||||
|
||||
exec("rm -rf $path");
|
||||
}
|
||||
}
|
||||
|
|
14
install/upgrades/airtime-1.9/airtime-upgrade.php
Normal file
14
install/upgrades/airtime-1.9/airtime-upgrade.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Airtime
|
||||
* @subpackage StorageServer
|
||||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
|
||||
set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once __DIR__.'/../../../airtime_mvc/application/configs/conf.php';
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
|
||||
|
||||
AirtimeInstall::CreateZendPhpLogFile();
|
Loading…
Add table
Add a link
Reference in a new issue