Merge branch '1.9.1' into devel

Conflicts:
	airtime_mvc/application/controllers/ScheduleController.php
	airtime_mvc/application/models/Schedule.php
	airtime_mvc/application/models/StoredFile.php
This commit is contained in:
Martin Konecny 2011-10-14 01:38:52 +02:00
commit 5a83c5b81e
7 changed files with 46 additions and 9 deletions

View File

@ -63,8 +63,8 @@ class Config {
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
//$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
//$CC_CONFIG['basePort'] = $values['general']['base_port'];
$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
$CC_CONFIG['basePort'] = $values['general']['base_port'];
// Database config
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];

View File

@ -87,7 +87,7 @@ class LibraryController extends Zend_Controller_Action
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::Recall($file_id);
$url = $file->getRelativeFileUrl($baseUrl).'/api_key/'.$CC_CONFIG["apiKey"][0].'/download/true';
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download');

View File

@ -719,8 +719,9 @@ class ScheduleController extends Zend_Controller_Action
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::Recall($file_id);
$url = $file->getFileURL().'/api_key/'.$CC_CONFIG["apiKey"][0].'/download/true';
$baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download');

View File

@ -489,7 +489,7 @@ class Application_Model_Schedule {
foreach ($items as $item)
{
$storedFile = Application_Model_StoredFile::Recall($item["file_id"]);
$uri = $storedFile->getFileUrl();
$uri = $storedFile->getFileUrlUsingConfigAddress();
$starts = Application_Model_Schedule::AirtimeTimeToPypoTime($item["starts"]);
$medias[$starts] = array(

View File

@ -435,14 +435,32 @@ class Application_Model_StoredFile {
}
/**
* Get the URL to access this file.
* Get the URL to access this file using the server name/address that
* this PHP script was invoked through.
*/
public function getFileUrl()
{
$serverName = $_SERVER['SERVER_NAME'];
$serverPort = $_SERVER['SERVER_PORT'];
return "http://$serverName:$serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
return constructGetFileUrl($serverName, $serverPort);
}
/**
* Get the URL to access this file using the server name/address that
* is specified in the airtime.conf config file.
*/
public function getFileUrlUsingConfigAddress(){
global $CC_CONFIG;
$serverName = $CC_CONFIG['baseUrl'];
$serverPort = $CC_CONFIG['basePort'];
return constructGetFileUrl($serverName, $serverPort);
}
private function constructGetFileUrl($p_serverName, $p_serverPort){
return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
}
/**

View File

@ -15,6 +15,8 @@ vhost = /
api_key = AAA
web_server_user = www-data
airtime_dir = x
base_url = localhost
base_port = 80
[soundcloud]
connection_retries = 3

View File

@ -15,6 +15,22 @@ if [[ "$DEB" = "Status: install ok installed" ]]; then
exit 1
fi
#Check whether version of virtualenv is <= 1.4.5. If so exit install.
BAD_VERSION="1.4.8"
VERSION=$(virtualenv --version)
NEWEST_VERSION=$(echo -e "$BAD_VERSION\n$VERSION\n'" | sort -t '.' -g | tail -n 1)
echo -n "Ensuring python-virtualenv version > $BAD_VERSION..."
if [[ "$NEWEST_VERSION" = "$BAD_VERSION" ]]; then
URL="http://apt.sourcefabric.org/pool/main/p/python-virtualenv/python-virtualenv_1.4.9-3_all.deb"
echo "Failed!"
echo "You have version $BAD_VERSION or older installed. Please install package at $URL first and then try installing Airtime again."
exit 1
else
echo "Success!"
fi
echo -e "\n******************************** Install Begin *********************************"
# Absolute path to this script