Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
db0f619eb0
2
CREDITS
2
CREDITS
|
@ -25,7 +25,7 @@ Martin Konecny (martin.konecny@sourcefabric.org)
|
|||
Role:Software Developer
|
||||
Highlights:
|
||||
- New User Interface
|
||||
- Scheduler
|
||||
- Scheduler/Backend
|
||||
|
||||
Daniel James
|
||||
Role: Documentor & QA
|
||||
|
|
28
INSTALL
28
INSTALL
|
@ -1,29 +1,23 @@
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
Copyright (c) 2010-2011 Sourcefabric O.P.S.
|
||||
|
||||
This file is part of the Airtime project.
|
||||
http://airtime.sourcefabric.org/
|
||||
To report bugs, send an e-mail to contact@sourcefabric.org
|
||||
|
||||
To report bugs, visit our bug tracker at:
|
||||
http://dev.sourcefabric.org/browse/CC
|
||||
|
||||
Airtime is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Airtime is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Airtime; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Visit our community support forum here:
|
||||
http://forum.sourcefabric.org/index.php/f/14/
|
||||
|
||||
For commercial support, see http://sourcefabric.org/en/services/about/347/Support.htm
|
||||
or send an e-mail to contact@sourcefabric.org
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Please see this page for a typical user install:
|
||||
http://en.flossmanuals.net/Airtime
|
||||
Please see this page for install instructions:
|
||||
http://wiki.sourcefabric.org/display/CC/Installing+Airtime+%28v1.6%29
|
||||
|
||||
If you are a developer, see this page:
|
||||
http://wiki.sourcefabric.org/display/CC
|
||||
|
|
|
@ -1,27 +1,72 @@
|
|||
This application uses the following 3rd Party software:
|
||||
* Zend Framework (New BSD license, compatible with GPL)
|
||||
* Liquidsoap (GPLv2, we only call this as an executable)
|
||||
* PEAR (Ok to ship with GPLed code, see: http://pear.php.net/manual/en/faq.devs.php, see note [1])
|
||||
* poc-streamer (mp3cut)
|
||||
* PHP
|
||||
|
||||
------------
|
||||
Linked code:
|
||||
------------
|
||||
* Zend Framework 1.10.3
|
||||
- Web site: http://framework.zend.com/
|
||||
- License: New BSD license
|
||||
- Compatible with GPLv3: Yes
|
||||
|
||||
* PEAR
|
||||
- Notes: We only use the PEAR base class PEAR_Error, in the "PEAR" PEAR library.
|
||||
- License: New BSD License
|
||||
- Compatible with GPLv3? Yes.
|
||||
|
||||
* GetID3
|
||||
- Web site: http://getid3.sourceforge.net/
|
||||
- License: GPLv2
|
||||
- Compatible with GPLv3? Yes
|
||||
|
||||
* Propel ORM
|
||||
- Web site: http://www.propelorm.org/
|
||||
- License: MIT/Expat License
|
||||
- Compatible with the GPL: Yes. See http://www.gnu.org/licenses/license-list.html
|
||||
|
||||
* Phing
|
||||
- Web site: http://phing.info/trac/
|
||||
- Note: Only used for development, not needed to run Airtime.
|
||||
- License: LGPLv3
|
||||
|
||||
----------------
|
||||
Non-linked code:
|
||||
----------------
|
||||
* Linux
|
||||
|
||||
* Apache Web Server 2.2
|
||||
- Web site: http://httpd.apache.org/
|
||||
|
||||
* PostgreSQL 8.4
|
||||
- Web site: http://www.postgresql.org/
|
||||
- License: The PostgreSQL License. See http://www.opensource.org/licenses/postgresql
|
||||
|
||||
* PHP 5.3
|
||||
- Web site: http://www.php.net/
|
||||
- License: The PHP License. See http://www.php.net/license/3_01.txt
|
||||
|
||||
* Python 2.6
|
||||
- Web site: http://www.python.org/
|
||||
- License: PSF License. See http://docs.python.org/license.html
|
||||
|
||||
* Liquidsoap (pre-release of 1.0)
|
||||
- Web site: http://savonet.sourceforge.net/
|
||||
- License: GPLv2
|
||||
|
||||
* mp3cut from the package poc-streamer
|
||||
|
||||
* jQuery
|
||||
- Web site: http://jquery.com/
|
||||
- License: MIT and GPL. See http://jquery.org/license
|
||||
|
||||
- jQuery components used:
|
||||
* Full Calendar
|
||||
- Web site: http://arshaw.com/fullcalendar/
|
||||
- License: Dual licensed under MIT and GPLv2
|
||||
|
||||
* Colorpicker
|
||||
- Web site: http://www.eyecon.ro/colorpicker/
|
||||
- License: Dual licensed under the MIT and GPL licenses.
|
||||
|
||||
|
||||
[1] PEAR Note (from http://pear.php.net/manual/en/faq.devs.php):
|
||||
"""
|
||||
From time to time people raise concerns of using PEAR packages licensed under the PHP license in GPL'ed code. In a discussion about this topic, the creator of PHP, Rasmus Lerdorf, issued the following statement:
|
||||
|
||||
It all comes down to semantics of what linking means. The PHP license is pretty much identical to the Apache license and you could indeed make a case for not allowing any GPL'ed software to be "linked to" from Apache either.
|
||||
|
||||
See http://www.apache.org/licenses/LICENSE-1.1.
|
||||
|
||||
The PHP license was chosen to match the Apache license because Apache and PHP are tied so closely to each other.
|
||||
|
||||
This hair splitting over linking, derivation and aggregation has been going on since the beginning of time. My stance is that you can indeed ship PHP licensed PEAR components on the same cd or in the same tarball as GPL'ed code because I see it as an aggregate work. This changes if you take PEAR code, modify it and copy-paste it directly into your own work. Then it moves from aggregate to derived. But the intent of the PEAR components is to be used in aggregate form. The PHP license allows you to use it in derived form as well, of course, but then you should be choosing a license other than the GPL for the derived work.
|
||||
|
||||
The FSF has a FAQ on aggregation here: http://www.fsf.org/licensing/licenses/gpl-faq.html#MereAggregation
|
||||
|
||||
That text is heavily biased towards compiled software and they talk about executables and memory spaces which don't really apply in this case. If you don't consider using a PEAR component as aggregation then it logically follows that you also cannot have Apache call your code so you will have to stipulate that nobody can use your code from Apache. I think this is an extreme interpretation that pretty much nobody out there shares.
|
||||
|
||||
In short, I don't see an issue here. Move along.
|
||||
"""
|
||||
|
||||
|
|
13
README
13
README
|
@ -9,15 +9,8 @@ Major features:
|
|||
program material, create playlists, and schedule programming all via
|
||||
a web interface.
|
||||
* Automation. Airtime has a scheduler function that enables users to
|
||||
set playlists for playback at a date and time of their choosing.
|
||||
set shows with playlists for playback at a date and time of their choosing.
|
||||
Playlists can be played back multiple times.
|
||||
* Playlists. Airtime allows users to create playlists that can be
|
||||
either played on-demand in the Studio or in automated mode. Playlists
|
||||
can be nested inside each other, so for example, a playlist with a
|
||||
block of ads can be inside of a playlist with a music program.
|
||||
* Centralized archives of station program material. Station personnel
|
||||
have a searchable, browseable central archive that is accessible both
|
||||
in the office and via the web.
|
||||
* Solid, fast playback. Airtime uses the open source Liquidsoap
|
||||
multimedia framework for clean, reliable, fast playback.
|
||||
* Open, extensible architecture. Stations are free to extend and alter
|
||||
|
@ -27,14 +20,14 @@ Major features:
|
|||
INSTALLATION
|
||||
------------
|
||||
Please see this page for a typical user installation:
|
||||
http://en.flossmanuals.net/Airtime
|
||||
http://www.sourcefabric.org/en/products/airtime_manuals/
|
||||
|
||||
If you are a developer, please see this page:
|
||||
http://wiki.sourcefabric.org/display/CC/Airtime+Dev+Site
|
||||
|
||||
Quick links to our resources
|
||||
----------------------------
|
||||
User Manual: http://en.flossmanuals.net/Airtime/Introduction
|
||||
User Manual: http://www.sourcefabric.org/en/products/airtime_manuals/
|
||||
Forums and mailing lists: http://forum.sourcefabric.org
|
||||
Bug Tracking: http://dev.sourcefabric.org
|
||||
Code view/review: http://code.sourcefabric.org
|
||||
|
|
|
@ -5,9 +5,11 @@ define('CAMPCASTER_COPYRIGHT_DATE', '2010');
|
|||
// These are the default values for the config.
|
||||
global $CC_CONFIG;
|
||||
|
||||
$values = load_airtime_config();
|
||||
|
||||
$CC_CONFIG = array(
|
||||
// Database config
|
||||
'dsn' => load_db_config(),
|
||||
'dsn' => $values['database'],
|
||||
|
||||
// Name of the web server user
|
||||
'webServerUser' => 'www-data',
|
||||
|
@ -17,7 +19,7 @@ $CC_CONFIG = array(
|
|||
|
||||
/* ================================================ storage configuration */
|
||||
|
||||
'apiKey' => array('AAA'),
|
||||
'apiKey' => $values['api_key'],
|
||||
|
||||
'apiPath' => "/api/",
|
||||
|
||||
|
@ -162,22 +164,16 @@ set_include_path('.'.PATH_SEPARATOR.$CC_CONFIG['pearPath']
|
|||
.PATH_SEPARATOR.$CC_CONFIG['zendPath']
|
||||
.PATH_SEPARATOR.$old_include_path);
|
||||
|
||||
//$dsn = $CC_CONFIG['dsn'];
|
||||
//$CC_DBC = DB::connect($dsn, TRUE);
|
||||
//if (PEAR::isError($CC_DBC)) {
|
||||
// echo "ERROR: ".$CC_DBC->getMessage()." ".$CC_DBC->getUserInfo()."\n";
|
||||
// exit(1);
|
||||
//}
|
||||
//$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
function load_db_config(){
|
||||
$ini_array = parse_ini_file(dirname(__FILE__).'/../../build/database.conf', true);
|
||||
function load_airtime_config(){
|
||||
$ini_array = parse_ini_file(dirname(__FILE__).'/../../build/airtime.conf', true);
|
||||
|
||||
return array(
|
||||
'username' => $ini_array['database']['dbuser'],
|
||||
'password' => $ini_array['database']['dbpass'],
|
||||
'hostspec' => $ini_array['database']['host'],
|
||||
'phptype' => 'pgsql',
|
||||
'database' => $ini_array['database']['dbname']);
|
||||
return array(
|
||||
'database' => array(
|
||||
'username' => $ini_array['database']['dbuser'],
|
||||
'password' => $ini_array['database']['dbpass'],
|
||||
'hostspec' => $ini_array['database']['host'],
|
||||
'phptype' => 'pgsql',
|
||||
'database' => $ini_array['database']['dbname']),
|
||||
'api_key' => array($ini_array['general']['api_key'])
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -16,11 +16,11 @@ $pages = array(
|
|||
'resource' => 'nowplaying'
|
||||
),
|
||||
array(
|
||||
'label' => 'Schedule',
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
'label' => 'Add Audio',
|
||||
'module' => 'default',
|
||||
'controller' => 'Plupload',
|
||||
'action' => 'plupload',
|
||||
'resource' => 'plupload'
|
||||
),
|
||||
array(
|
||||
'label' => 'Playlist Builder',
|
||||
|
@ -30,15 +30,15 @@ $pages = array(
|
|||
'resource' => 'library'
|
||||
),
|
||||
array(
|
||||
'label' => 'Add Audio',
|
||||
'module' => 'default',
|
||||
'controller' => 'Plupload',
|
||||
'action' => 'plupload',
|
||||
'resource' => 'plupload'
|
||||
'label' => 'Calendar',
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
),
|
||||
array(
|
||||
'label' => 'Configure',
|
||||
'uri' => 'javascript:void(null)',
|
||||
'uri' => '#',
|
||||
'resource' => 'preference',
|
||||
'pages' => array(
|
||||
array(
|
||||
|
|
|
@ -83,7 +83,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
//header("Content-Type: $mtype");
|
||||
*/
|
||||
|
||||
|
||||
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
if ($ext == "ogg")
|
||||
header("Content-Type: audio/ogg");
|
||||
|
@ -212,4 +212,3 @@ class ApiController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -112,7 +112,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
return;
|
||||
}
|
||||
|
||||
$res = $file->delete();
|
||||
$res = $file->deleteFile();
|
||||
|
||||
if (PEAR::isError($res)) {
|
||||
$this->view->message = $res->getMessage();
|
||||
|
|
|
@ -146,24 +146,23 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$params = '/format/json/id/#id#';
|
||||
|
||||
if(strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
||||
|
||||
if($user->isAdmin()) {
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete');
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Cancel Show');
|
||||
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
||||
if ($user->isHost($show->getShowId()) || $user->isAdmin()) {
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Add Content');
|
||||
}
|
||||
if($user->isHost($show->getShowId()) || $user->isAdmin()) {
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Clear');
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Schedule');
|
||||
}
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'),
|
||||
'title' => 'Show Content');
|
||||
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
||||
if ($user->isAdmin()) {
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance');
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance and All Following');
|
||||
}
|
||||
if ($user->isHost($show->getShowId()) || $user->isAdmin()) {
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Remove All Content');
|
||||
}
|
||||
}
|
||||
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'),
|
||||
'title' => 'Show Contents');
|
||||
|
||||
//returns format jjmenu is looking for.
|
||||
die(json_encode($menu));
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div id="Panel">
|
||||
<div class="logo"></div>
|
||||
<?= $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
|
||||
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
|
||||
|
||||
<?php $partial = array('menu.phtml', 'default');
|
||||
$this->navigation()->menu()->setPartial($partial); ?>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div id="Panel">
|
||||
<div class="logo"></div>
|
||||
<?= $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
|
||||
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
|
||||
|
||||
<?php $partial = array('menu.phtml', 'default');
|
||||
$this->navigation()->menu()->setPartial($partial); ?>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<?php echo $this->headLink() ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="nowplayingbar"><?= $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?></div>
|
||||
<div id="nowplayingbar"><?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?></div>
|
||||
<div id="nav"><?php echo $this->navigation()->menu()->setRenderInvisible(true) ?></div>
|
||||
|
||||
<div class="wrapper">
|
||||
|
|
|
@ -181,4 +181,3 @@ class AccessRecur {
|
|||
}
|
||||
|
||||
} // class AccessRecur
|
||||
?>
|
||||
|
|
|
@ -619,4 +619,3 @@ class Alib {
|
|||
} // fn test
|
||||
|
||||
} // class Alib
|
||||
?>
|
||||
|
|
|
@ -484,4 +484,3 @@ class Backup
|
|||
}
|
||||
|
||||
} // classs Backup
|
||||
?>
|
||||
|
|
|
@ -2182,5 +2182,5 @@ class BasicStor {
|
|||
fclose($fp);
|
||||
}
|
||||
|
||||
} // class BasicStor
|
||||
?>
|
||||
} // class BasicStor
|
||||
|
||||
|
|
|
@ -1723,4 +1723,3 @@ class GreenBox extends BasicStor {
|
|||
} // fn removePerm
|
||||
|
||||
} // class GreenBox
|
||||
?>
|
||||
|
|
|
@ -1746,4 +1746,3 @@ class LocStor extends BasicStor {
|
|||
/* ==================================================== auxiliary methods */
|
||||
|
||||
} // class LocStor
|
||||
?>
|
||||
|
|
|
@ -349,4 +349,3 @@ class M3uPlaylistAnimateElement {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -75,23 +75,27 @@ class Application_Model_Nowplaying
|
|||
|
||||
foreach ($previous as $item){
|
||||
array_push($rows, array("p", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
|
||||
}
|
||||
|
||||
foreach ($current as $item){
|
||||
array_push($rows, array("c", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
|
||||
}
|
||||
|
||||
foreach ($next as $item){
|
||||
array_push($rows, array("n", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
|
||||
$item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$rows = Application_Model_Nowplaying::FindGaps($rows);
|
||||
$data = array("rows"=>$rows);
|
||||
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getDate();
|
||||
|
||||
$data = array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$rows);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ class Playlist {
|
|||
$storedPlaylist->currentlyaccessing = $pl->getDbCurrentlyaccessing();
|
||||
$storedPlaylist->editedby = $pl->getDbEditedby();
|
||||
$storedPlaylist->mtime = $pl->getDbMtime();
|
||||
|
||||
|
||||
return $storedPlaylist;
|
||||
}
|
||||
|
||||
|
@ -931,17 +931,17 @@ class Playlist {
|
|||
|
||||
if(is_null($fadeIn)) {
|
||||
if($defaultFade != "")
|
||||
$fadeIn = $defaultFade;
|
||||
$fadeIn = $defaultFade;
|
||||
else
|
||||
$fadeIn = '00:00:00.000';
|
||||
}
|
||||
if(is_null($fadeOut)) {
|
||||
if($defaultFade != "")
|
||||
$fadeOut = $defaultFade;
|
||||
$fadeOut = $defaultFade;
|
||||
else
|
||||
$fadeOut = '00:00:00.000';
|
||||
}
|
||||
|
||||
|
||||
$row = new CcPlaylistcontents();
|
||||
$row->setDbPlaylistId($plId);
|
||||
$row->setDbFileId($fileId);
|
||||
|
@ -1386,4 +1386,3 @@ class PlaylistMetadataExport
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -439,4 +439,4 @@ class Prefs {
|
|||
}
|
||||
|
||||
} // class Prefs
|
||||
?>
|
||||
|
||||
|
|
|
@ -287,4 +287,3 @@ class Renderer
|
|||
|
||||
} // class Renderer
|
||||
|
||||
?>
|
||||
|
|
|
@ -433,4 +433,4 @@ class Restore {
|
|||
}
|
||||
|
||||
} // class Restore
|
||||
?>
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ class ScheduleGroup {
|
|||
// Get the end time for the given entry
|
||||
$sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"]
|
||||
." WHERE group_id=$p_groupId";
|
||||
|
||||
|
||||
$startTime = $CC_DBC->GetOne($sql);
|
||||
return $this->add($show_instance, $startTime, null, $p_playlistId);
|
||||
}
|
||||
|
@ -281,8 +281,8 @@ class Schedule {
|
|||
public static function getTimeUnScheduledInRange($s_datetime, $e_datetime) {
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
|
||||
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
|
||||
WHERE (starts >= '{$s_datetime}')
|
||||
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
|
||||
WHERE (starts >= '{$s_datetime}')
|
||||
AND (ends <= '{$e_datetime}')";
|
||||
|
||||
$time = $CC_DBC->GetOne($sql);
|
||||
|
@ -302,12 +302,12 @@ class Schedule {
|
|||
public static function getTimeScheduledInRange($s_datetime, $e_datetime) {
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
|
||||
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
|
||||
WHERE (starts >= '{$s_datetime}')
|
||||
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
|
||||
WHERE (starts >= '{$s_datetime}')
|
||||
AND (ends <= '{$e_datetime}')";
|
||||
|
||||
$res = $CC_DBC->GetOne($sql);
|
||||
|
||||
|
||||
if(is_null($res))
|
||||
return 0;
|
||||
|
||||
|
@ -315,9 +315,9 @@ class Schedule {
|
|||
}
|
||||
|
||||
public static function getPercentScheduledInRange($s_datetime, $e_datetime) {
|
||||
|
||||
|
||||
$time = Schedule::getTimeScheduledInRange($s_datetime, $e_datetime);
|
||||
|
||||
|
||||
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
||||
|
||||
$sql = "SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '{$s_datetime}')";
|
||||
|
@ -333,11 +333,11 @@ class Schedule {
|
|||
$i_epoch = $r->fetchColumn(0);
|
||||
|
||||
$percent = ceil(($i_epoch / ($e_epoch - $s_epoch)) * 100);
|
||||
|
||||
|
||||
return $percent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return TRUE if file is going to be played in the future.
|
||||
*
|
||||
|
@ -432,6 +432,8 @@ class Schedule {
|
|||
return array();
|
||||
}
|
||||
|
||||
global $CC_CONFIG;
|
||||
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getDate();
|
||||
return array("env"=>APPLICATION_ENV,
|
||||
|
@ -442,59 +444,61 @@ class Schedule {
|
|||
"currentShow"=>Show_DAL::GetCurrentShow($timeNow),
|
||||
"nextShow"=>Show_DAL::GetNextShow($timeNow),
|
||||
"timezone"=> date("T"),
|
||||
"timezoneOffset"=> date("Z"));
|
||||
"timezoneOffset"=> date("Z"),
|
||||
"apiKey"=>$CC_CONFIG['apiKey'][0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds an SQL Query for accessing scheduled item information from
|
||||
* the database.
|
||||
* the database.
|
||||
*
|
||||
* @param int $timeNow
|
||||
* @param int $timePeriod
|
||||
* @param int $count
|
||||
* @param String $interval
|
||||
* @return date
|
||||
*
|
||||
* $timeNow is the the currentTime in the format "Y-m-d H:i:s".
|
||||
*
|
||||
* $timeNow is the the currentTime in the format "Y-m-d H:i:s".
|
||||
* For example: 2011-02-02 22:00:54
|
||||
*
|
||||
*
|
||||
* $timePeriod can be either negative, zero or positive. This is used
|
||||
* to indicate whether we want items from the past, present or future.
|
||||
*
|
||||
*
|
||||
* $count indicates how many results we want to limit ourselves to.
|
||||
*
|
||||
*
|
||||
* $interval is used to indicate how far into the past or future we
|
||||
* want to search the database. For example "5 days", "18 hours", "60 minutes",
|
||||
* "30 seconds" etc.
|
||||
*/
|
||||
public static function Get_Scheduled_Item_Data($timeNow, $timePeriod=0, $count = 0, $interval="0 hours"){
|
||||
public static function Get_Scheduled_Item_Data($timeStamp, $timePeriod=0, $count = 0, $interval="0 hours"){
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
$sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, (si.starts <= TIMESTAMP '$timeNow' AND si.ends > TIMESTAMP '$timeNow') as current_show"
|
||||
|
||||
$sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, st.instance_id"
|
||||
." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show"
|
||||
." WHERE st.playlist_id = pt.id"
|
||||
." AND st.file_id = ft.id"
|
||||
." AND st.instance_id = si.id"
|
||||
." AND si.show_id = show.id";
|
||||
|
||||
|
||||
if ($timePeriod < 0){
|
||||
$sql .= " AND st.ends < TIMESTAMP '$timeNow'"
|
||||
." AND st.ends > (TIMESTAMP '$timeNow' - INTERVAL '$interval')"
|
||||
$sql .= " AND st.ends < TIMESTAMP '$timeStamp'"
|
||||
." AND st.ends > (TIMESTAMP '$timeStamp' - INTERVAL '$interval')"
|
||||
." ORDER BY st.starts DESC"
|
||||
." LIMIT $count";
|
||||
." LIMIT $count";
|
||||
} else if ($timePeriod == 0){
|
||||
$sql .= " AND st.starts < TIMESTAMP '$timeNow'"
|
||||
." AND st.ends > TIMESTAMP '$timeNow'";
|
||||
$sql .= " AND st.starts <= TIMESTAMP '$timeStamp'"
|
||||
." AND st.ends >= TIMESTAMP '$timeStamp'";
|
||||
} else if ($timePeriod > 0){
|
||||
$sql .= " AND st.starts > TIMESTAMP '$timeNow'"
|
||||
." AND st.starts < (TIMESTAMP '$timeNow' + INTERVAL '$interval')"
|
||||
$sql .= " AND st.starts > TIMESTAMP '$timeStamp'"
|
||||
." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')"
|
||||
." ORDER BY st.starts"
|
||||
." LIMIT $count";
|
||||
." LIMIT $count";
|
||||
}
|
||||
|
||||
$rows = $CC_DBC->GetAll($sql);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convert a time string in the format "YYYY-MM-DD HH:mm:SS"
|
||||
|
@ -700,4 +704,3 @@ class Schedule {
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -733,7 +733,7 @@ class Show_DAL{
|
|||
$date = $timestamp[0];
|
||||
$time = $timestamp[1];
|
||||
|
||||
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id"
|
||||
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id, si.id as instance_id"
|
||||
." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
|
||||
." WHERE si.show_id = s.id"
|
||||
." AND si.starts <= TIMESTAMP '$timeNow'"
|
||||
|
@ -749,7 +749,7 @@ class Show_DAL{
|
|||
$sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM "
|
||||
." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
|
||||
." WHERE si.show_id = s.id"
|
||||
." AND si.starts > TIMESTAMP '$timeNow'"
|
||||
." AND si.starts >= TIMESTAMP '$timeNow'"
|
||||
." AND si.starts < TIMESTAMP '$timeNow' + INTERVAL '48 hours'"
|
||||
." ORDER BY si.starts"
|
||||
." LIMIT 1";
|
||||
|
|
|
@ -310,4 +310,3 @@ class SmilPlaylistAnimateElement {
|
|||
}
|
||||
} // class SmilPlaylistAnimateElement
|
||||
|
||||
?>
|
||||
|
|
|
@ -492,9 +492,9 @@ class StoredFile {
|
|||
$escapedValue = pg_escape_string($this->gunid);
|
||||
$sql = "SELECT * FROM ".$CC_CONFIG["filesTable"]
|
||||
." WHERE gunid='$escapedValue'";
|
||||
|
||||
|
||||
$this->md = $CC_DBC->getRow($sql);
|
||||
|
||||
|
||||
if (PEAR::isError($this->md)) {
|
||||
$error = $this->md;
|
||||
$this->md = null;
|
||||
|
@ -511,7 +511,7 @@ class StoredFile {
|
|||
$compatibilityData[$xmlName] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//$this->md = array_merge($this->md, $compatibilityData);
|
||||
$this->md = $compatibilityData;
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ class StoredFile {
|
|||
$sql = "SELECT *"
|
||||
." FROM ".$CC_CONFIG['filesTable']
|
||||
." WHERE $cond";
|
||||
|
||||
|
||||
$row = $CC_DBC->getRow($sql);
|
||||
if (PEAR::isError($row) || is_null($row)) {
|
||||
return $row;
|
||||
|
@ -1784,7 +1784,7 @@ class StoredFile {
|
|||
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES)) AS RESULTS";
|
||||
|
||||
return StoredFile::searchFiles($fromTable, $datatables);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function searchPlaylistsForSchedule($p_length, $datatables) {
|
||||
|
@ -1793,9 +1793,9 @@ class StoredFile {
|
|||
|
||||
$datatables["optWhere"][] = "plt.length <= INTERVAL '{$p_length}'";
|
||||
$datatables["optWhere"][] = "plt.length > INTERVAL '00:00:00'";
|
||||
|
||||
|
||||
return StoredFile::searchFiles($fromTable, $datatables);
|
||||
}
|
||||
}
|
||||
|
||||
public static function searchFiles($fromTable, $data)
|
||||
{
|
||||
|
@ -1814,8 +1814,8 @@ class StoredFile {
|
|||
|
||||
// Where clause
|
||||
if(isset($data["optWhere"])) {
|
||||
|
||||
$where[] = join(" AND ", $data["optWhere"]);
|
||||
|
||||
$where[] = join(" AND ", $data["optWhere"]);
|
||||
}
|
||||
|
||||
if(isset($searchTerms)) {
|
||||
|
@ -1823,7 +1823,7 @@ class StoredFile {
|
|||
$searchCols = array();
|
||||
|
||||
for($i=0; $i<$data["iColumns"]; $i++) {
|
||||
|
||||
|
||||
if($data["bSearchable_".$i] == "true") {
|
||||
$searchCols[] = $columnsDisplayed[$i];
|
||||
}
|
||||
|
@ -1832,14 +1832,14 @@ class StoredFile {
|
|||
$outerCond = array();
|
||||
|
||||
foreach($searchTerms as $term) {
|
||||
|
||||
|
||||
$innerCond = array();
|
||||
|
||||
foreach($searchCols as $col) {
|
||||
|
||||
$innerCond[] = "{$col}::text ILIKE '%{$term}%'";
|
||||
$escapedTerm = pg_escape_string($term);
|
||||
$innerCond[] = "{$col}::text ILIKE '%{$escapedTerm}%'";
|
||||
}
|
||||
$outerCond[] = "(".join(" OR ", $innerCond).")";
|
||||
$outerCond[] = "(".join(" OR ", $innerCond).")";
|
||||
}
|
||||
$where[] = "(".join(" AND ", $outerCond).")";
|
||||
}
|
||||
|
@ -1869,12 +1869,12 @@ class StoredFile {
|
|||
else {
|
||||
$sql = $selectorRows." FROM ".$fromTable." ORDER BY ".$orderby." OFFSET ".$data["iDisplayStart"]." LIMIT ".$data["iDisplayLength"];
|
||||
}
|
||||
|
||||
|
||||
$results = $CC_DBC->getAll($sql);
|
||||
//echo $results;
|
||||
//echo $sql;
|
||||
|
||||
//put back to default fetch mode.
|
||||
//put back to default fetch mode.
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
if(!isset($totalDisplayRows)) {
|
||||
|
@ -1883,8 +1883,8 @@ class StoredFile {
|
|||
|
||||
return array("sEcho" => intval($data["sEcho"]), "iTotalDisplayRecords" => $totalDisplayRows, "iTotalRecords" => $totalRows, "aaData" => $results);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
@ -1921,7 +1921,7 @@ class StoredFile {
|
|||
|
||||
$and_cond[] = $string;
|
||||
}
|
||||
|
||||
|
||||
if(count($and_cond) > 0) {
|
||||
$or_cond[] = "(".join(" ".$inner." ", $and_cond).")";
|
||||
}
|
||||
|
@ -1958,4 +1958,4 @@ class StoredFile {
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -680,4 +680,4 @@ class Subjects {
|
|||
} // fn test
|
||||
|
||||
} // class Subjects
|
||||
?>
|
||||
|
||||
|
|
|
@ -1830,4 +1830,4 @@ class Transport
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -416,4 +416,4 @@ class TransportRecord
|
|||
}
|
||||
|
||||
} // class TransportRecord
|
||||
?>
|
||||
|
||||
|
|
|
@ -171,5 +171,14 @@ class User {
|
|||
|
||||
return $CC_DBC->GetRow($sql);
|
||||
}
|
||||
|
||||
public static function GetUserID($login){
|
||||
$user = CcSubjsQuery::create()->findOneByDbLogin($login);
|
||||
if (is_null($user)){
|
||||
return -1;
|
||||
} else {
|
||||
return $user->getDbId();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -382,4 +382,4 @@ class Validator {
|
|||
|
||||
} // class Validator
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -395,4 +395,4 @@ class XmlParser {
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -324,5 +324,3 @@ $audioClipFormat = array(
|
|||
// 'regexp'=>'^\d{4}(-\d{2}(-\d{2}(T\d{2}:\d{2}(:\d{2}\.\d+)?(Z)|([\+\-]?\d{2}:\d{2}))?)?)?$',
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
|
@ -211,4 +211,4 @@ class Cron {
|
|||
return $this->cronfile.' "'.str_replace('"','\"',serialize($this->params)).'"';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@ class CronJob
|
|||
{
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -281,4 +281,4 @@ class Crontab
|
|||
return $returnar;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/php
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
chdir(dirname(__FILE__));
|
||||
$p = unserialize($argv[1]);
|
||||
|
@ -6,4 +6,3 @@ require_once (dirname(__FILE__).'/'.$p['class'].'.php');
|
|||
$cronjob = new $p['class']();
|
||||
$ret = $cronjob->execute($p['params']);
|
||||
exit(0);
|
||||
?>
|
|
@ -18,4 +18,3 @@ if (!$r) {
|
|||
}
|
||||
|
||||
exit(0);
|
||||
?>
|
|
@ -39,4 +39,3 @@ if (TR_LOG_LEVEL>1) {
|
|||
$tr->trLog("transportCronJob($pid) end ($trtok)");
|
||||
}
|
||||
exit(0);
|
||||
?>
|
|
@ -1,17 +1,3 @@
|
|||
<?php
|
||||
header ("location: html/");
|
||||
exit;
|
||||
/*
|
||||
?>
|
||||
<html><head>
|
||||
<title>StorageServer module</title>
|
||||
</head><body>
|
||||
<h3>StorageServer module</h3>
|
||||
<br>
|
||||
<a href="../html/" accesskey="H"><b>H</b>TML client</a><br>
|
||||
<a href="../xmlrpc/" accesskey="X"><b>X</b>mlRpc test</a><br>
|
||||
<a href="../tests/" accesskey="T"><b>T</b>est</a><br>
|
||||
</body></html>
|
||||
<?
|
||||
*/
|
||||
?>
|
|
@ -110,8 +110,3 @@ $playlistFormat = array(
|
|||
*/
|
||||
);
|
||||
|
||||
/*
|
||||
?
|
||||
ls:filename Text auto
|
||||
*/
|
||||
?>
|
||||
|
|
|
@ -21,4 +21,4 @@ $result = PHPUnit::run($suite);
|
|||
|
||||
echo $result->toString();
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -178,4 +178,4 @@ class PlaylistTests extends PHPUnit_TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -39,4 +39,3 @@ class SchedulerExportTests extends PHPUnit_TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -125,4 +125,3 @@ class SchedulerTests extends PHPUnit_TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -84,4 +84,3 @@ class StoredFileTest extends PHPUnit_TestCase {
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
|
@ -22,4 +22,3 @@ if (is_array($r)) {
|
|||
print_r($r);
|
||||
}
|
||||
echo"\n";
|
||||
?>
|
|
@ -1,4 +1,3 @@
|
|||
<?php
|
||||
header ("location: ../");
|
||||
exit;
|
||||
?>
|
|
@ -22,4 +22,4 @@ $sql3 = "SELECT TIMESTAMP '2011-01-01 00:00:00.000' + INTERVAL '01:00:00.123456'
|
|||
$result3 = $con->query($sql3);
|
||||
var_dump($result3->fetchAll());
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -140,4 +140,3 @@ $comm = "ls -l ".$CC_CONFIG['storageDir']."/a23"; echo `$comm`;
|
|||
if(file_exists("../trans/log")) echo `tail -n 25 ../trans/log`;
|
||||
echo "#Transport test: OK.\n\n";
|
||||
*/
|
||||
?>
|
|
@ -59,4 +59,3 @@ echo "$r\n";
|
|||
|
||||
echo "#storeWebstream test: OK.\n\n"
|
||||
*/
|
||||
?>
|
|
@ -338,8 +338,3 @@ $webstreamFormat = array(
|
|||
*/
|
||||
);
|
||||
|
||||
/*
|
||||
?
|
||||
ls:filename Text auto
|
||||
*/
|
||||
?>
|
|
@ -3830,4 +3830,4 @@ class XR_LocStor extends LocStor {
|
|||
|
||||
} // class XR_LocStor
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
<?php
|
||||
header ("location: xrLocStor.php");
|
||||
exit;
|
||||
?>
|
|
@ -96,4 +96,4 @@ fclose($fp);
|
|||
fclose($putdata);
|
||||
|
||||
header("HTTP/1.1 200");
|
||||
?>
|
||||
|
||||
|
|
|
@ -508,4 +508,3 @@ $r = $spc->DisplayScheduleMethod($this->Base->sessid, '20040101T00:00:00', '2005
|
|||
#$r = $spc->GetSchedulerTimeMethod(); var_dump($r);
|
||||
================= */
|
||||
|
||||
?>
|
|
@ -125,4 +125,3 @@ switch ($ftype) {
|
|||
// var_dump($ftype);
|
||||
http_error(500, "500 Unknown ftype ($ftype)");
|
||||
}
|
||||
?>
|
|
@ -169,4 +169,4 @@ foreach ($methods as $method => $description) {
|
|||
|
||||
$s = new XML_RPC_Server($defs);
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -365,4 +365,3 @@ if (isset($infos[$method]['r'])) {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -3,24 +3,23 @@
|
|||
class Application_Validate_UserNameValidate extends Zend_Validate_Abstract
|
||||
{
|
||||
const LOGIN = 'login';
|
||||
|
||||
|
||||
protected $_messageTemplates = array(
|
||||
self::LOGIN => "'%value%' is already taken"
|
||||
);
|
||||
|
||||
|
||||
public function isValid($value)
|
||||
{
|
||||
$this->_setValue($value);
|
||||
|
||||
|
||||
$count = CcSubjsQuery::create()->filterByDbLogin($value)->count();
|
||||
|
||||
|
||||
if ($count != 0) {
|
||||
$this->_error(self::LOGIN);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Airtime_View_Helper_LoggedInAs extends Zend_View_Helper_Abstract
|
||||
class Airtime_View_Helper_LoggedInAs extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function loggedInAs ()
|
||||
{
|
||||
|
@ -10,8 +10,7 @@ class Airtime_View_Helper_LoggedInAs extends Zend_View_Helper_Abstract
|
|||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->login;
|
||||
}
|
||||
return $username;
|
||||
return $username;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
<ol>
|
||||
<li>Add your files to the library using the "Add Audio" button. You can drag and drop your files to this window too. </li>
|
||||
<li>Create a show by going to "Schedule" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins can add shows.</li>
|
||||
<li>Create a playlist in the Playlist Builder menu using your audio files. </li>
|
||||
<li>Add the playlist to the show by going to your show in the Schedule calendar, right-clicking on it and selecting "Schedule." </li>
|
||||
<li>Create a show by going to "Calendar" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins can add shows.</li>
|
||||
<li>Add the playlist to the show by going to your show in the Schedule calendar, right-clicking on it and selecting "Add Content." </li>
|
||||
<li>Select your playlist and drag and drop it to the "Items in this show" area.</li>
|
||||
</ol>
|
||||
<p><strong>Then you're good to go!</strong><br />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ul>
|
||||
<li><a href="#simpleSearch">Search</a></li>
|
||||
<li><a href="#advancedSearch">Advanced Search</a></li>
|
||||
<!--<li><a href="#advancedSearch">Advanced Search</a></li>-->
|
||||
</ul>
|
||||
<div id="simpleSearch">
|
||||
<table id="library_display" cellpadding="0" cellspacing="0" class="datatable">
|
||||
|
@ -18,9 +18,11 @@
|
|||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--
|
||||
<div id="advancedSearch">
|
||||
<div id="search">
|
||||
<?php //echo $this->form; ?>
|
||||
</div>
|
||||
<div><?php //echo var_dump($this->md); ?></div>
|
||||
</div>
|
||||
-->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="button-bar-top">
|
||||
<a href="javascript:void(0)" class="toggle-button end-button" id="now_view">Now View</a><a href="javascript:void(0)" class="toggle-button-active" id="day_view">Day View</a><input type="text" id="datepicker" class="input_text">
|
||||
<span class="toggle-button end-button" id="now_view">Now View</span><span class="toggle-button-active" id="day_view">Day View</span><input type="text" id="datepicker" class="input_text">
|
||||
</div>
|
||||
<div id='demo'></div>
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="datatable" id="nowplayingtable"></table>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="button-bar-top">
|
||||
<a href="javascript:void(0)" class="toggle-button-active end-button" id="now_view">Now View</a><a href="javascript:void(0)" class="toggle-button" id="day_view">Day View</a>
|
||||
<span class="toggle-button-active end-button" id="now_view">Now View</span><span class="toggle-button" id="day_view">Day View</span>
|
||||
</div>
|
||||
<div id='demo'></div>
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="datatable" id="nowplayingtable"></table>
|
||||
|
|
|
@ -4,3 +4,6 @@ dbname = airtime
|
|||
dbuser = airtime
|
||||
dbpass = airtime
|
||||
|
||||
[general]
|
||||
api_key = AAA
|
||||
|
|
@ -11,7 +11,7 @@ from xml.dom.minidom import Node
|
|||
|
||||
#Read the universal values
|
||||
parser = ConfigParser.SafeConfigParser()
|
||||
parser.read('database.conf')
|
||||
parser.read('airtime.conf')
|
||||
section_names = parser.sections();
|
||||
items_in_section = parser.items(section_names[0])
|
||||
|
||||
|
|
|
@ -15,33 +15,54 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
createAPIKey();
|
||||
|
||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/GreenBox.php');
|
||||
require_once(dirname(__FILE__).'/installInit.php');
|
||||
|
||||
|
||||
function rand_string($len=20, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
|
||||
{
|
||||
$string = '';
|
||||
for ($i = 0; $i < $len; $i++)
|
||||
{
|
||||
$pos = mt_rand(0, strlen($chars)-1);
|
||||
$string .= $chars{$pos};
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
function createAPIKey(){
|
||||
|
||||
$api_key = rand_string();
|
||||
updateINIKeyValues('../build/airtime.conf', 'api_key', $api_key);
|
||||
updateINIKeyValues('../pypo/config.cfg', 'api_key', "'$api_key'");
|
||||
}
|
||||
|
||||
function checkIfRoot(){
|
||||
// Need to check that we are superuser before running this.
|
||||
if(exec("whoami") != "root"){
|
||||
echo "Must be root user.\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Need to check if build.properties project home is set correctly.
|
||||
function setBuildPropertiesPath(){
|
||||
$property = 'project.home';
|
||||
$lines = file('../build/build.properties');
|
||||
foreach ($lines as $key => &$line) {
|
||||
if ($property == substr($line, 0, strlen($property))){
|
||||
$line = $property." = ".realpath(__dir__.'/../')."\n";
|
||||
}
|
||||
function updateINIKeyValues($filename, $property, $value){
|
||||
$lines = file($filename);
|
||||
$n=count($lines);
|
||||
for ($i=0; $i<$n; $i++) {
|
||||
if (strlen($lines[$i]) > strlen($property))
|
||||
if ($property == substr($lines[$i], 0, strlen($property))){
|
||||
$lines[$i] = "$property = $value\n";
|
||||
}
|
||||
}
|
||||
|
||||
$fp=fopen('../build/build.properties', 'w');
|
||||
foreach($lines as $key => $line){
|
||||
fwrite($fp, $line);
|
||||
$fp=fopen($filename, 'w');
|
||||
for($i=0; $i<$n; $i++){
|
||||
fwrite($fp, $lines[$i]);
|
||||
}
|
||||
fclose($fp);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
function directorySetup($CC_CONFIG){
|
||||
|
@ -69,13 +90,13 @@ echo " *** Directory Setup ***\n";
|
|||
//exit(1);
|
||||
}
|
||||
$CC_CONFIG[$d] = $rp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
checkIfRoot();
|
||||
setBuildPropertiesPath();
|
||||
updateINIKeyValues('../build/build.properties', 'project.home', realpath(__dir__.'/../'));
|
||||
|
||||
echo "******************************** Install Begin *********************************\n";
|
||||
|
||||
|
@ -132,4 +153,4 @@ $command = __DIR__."/../utils/airtime-import --copy ../audio_samples/ > /dev/nul
|
|||
$command = "python ".__DIR__."/../pypo/install/pypo-install.py";
|
||||
system($command);
|
||||
echo "******************************* Install Complete *******************************\n";
|
||||
?>
|
||||
|
||||
|
|
|
@ -227,4 +227,4 @@ airtime_uninstall_delete_files($CC_CONFIG['storageDir']);
|
|||
$command = "python ".__DIR__."/../pypo/install/pypo-uninstall.py";
|
||||
system($command);
|
||||
echo "****************************** Uninstall Complete ******************************\n";
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/../conf.php');
|
||||
require_once(dirname(__FILE__).'/../Subjects.php');
|
||||
|
||||
set_include_path('../application/models' . PATH_SEPARATOR . get_include_path());
|
||||
require_once(__DIR__.'/../library/propel/runtime/lib/Propel.php');
|
||||
Propel::init(__DIR__.'/../application/configs/airtime-conf.php');
|
||||
|
||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/Users.php');
|
||||
require_once('DB.php');
|
||||
require_once('Console/Getopt.php');
|
||||
|
||||
|
@ -22,52 +27,37 @@ function printUsage()
|
|||
echo " This program allows you to manage Airtime users.\n";
|
||||
echo "\n";
|
||||
echo "OPTIONS:\n";
|
||||
echo " --addupdate <username> <password>\n";
|
||||
echo " Add the user or update the password for the user.\n";
|
||||
echo " --addupdate <username>\n";
|
||||
echo " Add the user or update user information.\n";
|
||||
echo " --delete <username>\n";
|
||||
echo " Remove the user.\n";
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
$parsedCommandLine = Console_Getopt::getopt($argv, null, array("addupdate", "delete"));
|
||||
|
||||
if (PEAR::isError($parsedCommandLine)) {
|
||||
printUsage();
|
||||
exit(1);
|
||||
}
|
||||
$cmdLineOptions = $parsedCommandLine[0];
|
||||
if (count($parsedCommandLine[1]) == 0) {
|
||||
if (count($argv) != 3) {
|
||||
printUsage();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$action = null;
|
||||
foreach ($cmdLineOptions as $tmpValue) {
|
||||
$optionName = $tmpValue[0];
|
||||
$optionValue = $tmpValue[1];
|
||||
switch ($optionName) {
|
||||
case '--addupdate':
|
||||
$action = "addupdate";
|
||||
break 2;
|
||||
case "--delete":
|
||||
$action = "delete";
|
||||
break 2;
|
||||
}
|
||||
switch ($argv[1]) {
|
||||
case '--addupdate':
|
||||
$action = "addupdate";
|
||||
break;
|
||||
case '--delete':
|
||||
$action = "delete";
|
||||
break;
|
||||
}
|
||||
|
||||
$username = $argv[2];
|
||||
|
||||
if (is_null($action)) {
|
||||
printUsage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (count($parsedCommandLine) < 1) {
|
||||
printUsage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$username = $parsedCommandLine[1][0];
|
||||
$password = $parsedCommandLine[1][1];
|
||||
|
||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE);
|
||||
if (PEAR::isError($CC_DBC)) {
|
||||
|
@ -75,28 +65,53 @@ if (PEAR::isError($CC_DBC)) {
|
|||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
|
||||
// Check if the user exists
|
||||
$user = Subjects::GetSubject($username);
|
||||
$id = User::GetUserID($username);
|
||||
|
||||
if ($action == "addupdate") {
|
||||
if (empty($password)) {
|
||||
printUsage();
|
||||
exit;
|
||||
}
|
||||
if (empty($user)) {
|
||||
// Add the user.
|
||||
$r = Subjects::AddSubj($username, $password);
|
||||
} else {
|
||||
// Update the password
|
||||
$r = Subjects::Passwd($username, NULL, $password);
|
||||
}
|
||||
} elseif (($action == "delete") && (is_array($user))) {
|
||||
// Delete the user
|
||||
$r = Subjects::RemoveSubj($username);
|
||||
}
|
||||
|
||||
if (PEAR::isError($r)) {
|
||||
die($r->getMessage());
|
||||
if ($id < 0) {
|
||||
echo "Creating user\n";
|
||||
$user = new User("");
|
||||
$user->setLogin($username);
|
||||
} else {
|
||||
echo "Updating user\n";
|
||||
$user = new User($id);
|
||||
}
|
||||
|
||||
do{
|
||||
echo "Enter password (min 6 characters): ";
|
||||
$line = trim(fgets(fopen("php://stdin","r")));
|
||||
}while(strlen($line) < 6);
|
||||
$user->setPassword($line);
|
||||
|
||||
do{
|
||||
echo "Enter first name: ";
|
||||
$line = trim(fgets(fopen("php://stdin","r")));
|
||||
}while(strlen($line) < 1);
|
||||
$user->setFirstName($line);
|
||||
|
||||
do{
|
||||
echo "Enter last name: ";
|
||||
$line = trim(fgets(fopen("php://stdin","r")));
|
||||
}while(strlen($line) < 1);
|
||||
$user->setLastName($line);
|
||||
|
||||
do{
|
||||
echo "Enter user type [(A)dmin|(H)ost|(G)uest]: ";
|
||||
$line = trim(fgets(fopen("php://stdin","r")));
|
||||
} while($line != "A" && $line != "H" && $line != "G");
|
||||
$user->setType($line);
|
||||
$user->save();
|
||||
|
||||
} elseif ($action == "delete") {
|
||||
if ($id < 0){
|
||||
echo "Username not found!\n";
|
||||
exit;
|
||||
} else {
|
||||
echo "Deleting user\n";
|
||||
$user = new User($id);
|
||||
$user->delete();
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
<?php
|
||||
header ("location: ../");
|
||||
exit;
|
||||
?>
|
|
@ -84,4 +84,4 @@ function install_setDirPermissions($filePath) {
|
|||
// }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -8,12 +8,7 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Install twitter Cron job
|
||||
//------------------------------------------------------------------------
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/../../../storageServer/var/cron/Cron.php');
|
||||
$m = '*';
|
||||
$h ='*';
|
||||
|
@ -41,4 +36,4 @@ echo " adding new entry\n";
|
|||
$cron->ct->addCron($m, $h, $dom, $mon, $dow, $command);
|
||||
$cron->closeCrontab();
|
||||
echo "Done.\n";
|
||||
?>
|
||||
|
||||
|
|
|
@ -8,12 +8,7 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Uninstall twitter Cron job
|
||||
//------------------------------------------------------------------------
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/../../../storageServer/var/cron/Cron.php');
|
||||
$old_regex = '/ui_twitterCron\.php/';
|
||||
|
||||
|
@ -34,4 +29,3 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) {
|
|||
|
||||
$cron->closeCrontab();
|
||||
echo "Done.\n";
|
||||
?>
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
|
@ -1169,6 +1169,7 @@ button, input {
|
|||
text-decoration:none;
|
||||
text-shadow: #343434 0px -1px;
|
||||
border-width:1px 0 1px 1px;
|
||||
cursor:pointer;
|
||||
}
|
||||
.toggle-button:hover {
|
||||
background-color: #292929;
|
||||
|
|
|
@ -157,7 +157,7 @@ function audioPreview(filename, elemID){
|
|||
}
|
||||
|
||||
var ext = getFileExt(filename);
|
||||
var uri = "/api/get-media/api_key/AAA/file/" + filename;
|
||||
var uri = "/api/get-media/api_key/" + apiKey + "/file/" + filename;
|
||||
|
||||
var media;
|
||||
var supplied;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var registered = false;
|
||||
var datagridData;
|
||||
var datagridData = null;
|
||||
var currentShowInstanceID = -1;
|
||||
|
||||
function getDateText(obj){
|
||||
var str = obj.aData[ obj.iDataColumn ].toString();
|
||||
|
@ -32,7 +32,7 @@ function changeTimePrecision(str){
|
|||
return str;
|
||||
}
|
||||
|
||||
function notifySongEnd(){
|
||||
function notifySongStart(){
|
||||
for (var i=0; i<datagridData.rows.length; i++){
|
||||
if (datagridData.rows[i][0] == "c")
|
||||
datagridData.rows[i][0] = "p";
|
||||
|
@ -42,53 +42,27 @@ function notifySongEnd(){
|
|||
}
|
||||
}
|
||||
|
||||
createDataGrid();
|
||||
updateDataTable();
|
||||
}
|
||||
|
||||
var columns = [{"sTitle": "type", "bVisible":false},
|
||||
{"sTitle":"Date"},
|
||||
{"sTitle":"Start"},
|
||||
{"sTitle":"End"},
|
||||
{"sTitle":"Duration"},
|
||||
{"sTitle":"Song"},
|
||||
{"sTitle":"Artist"},
|
||||
{"sTitle":"Album"},
|
||||
{"sTitle":"Playlist"},
|
||||
{"sTitle":"Show"},
|
||||
{"sTitle":"bgcolor", "bVisible":false},
|
||||
{"sTitle":"group_id", "bVisible":false}];
|
||||
|
||||
function createDataGrid(){
|
||||
|
||||
columns[1]["fnRender"] = getDateText;
|
||||
columns[2]["fnRender"] = getTimeText;
|
||||
columns[3]["fnRender"] = getTimeText;
|
||||
columns[4]["fnRender"] = changeTimePrecisionInit;
|
||||
|
||||
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="datatable" id="nowplayingtable"></table>' );
|
||||
$('#nowplayingtable').dataTable( {
|
||||
"bSort" : false,
|
||||
"bJQueryUI": true,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
"bLengthChange": false,
|
||||
"bPaginate": false,
|
||||
"aoColumns": columns,
|
||||
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
if (aData[aData.length-2] == "t")
|
||||
$(nRow).attr("class", "playing-list");
|
||||
if (aData[0] == "c")
|
||||
$(nRow).attr("class", "playing-song");
|
||||
else if (aData[0] == "b")
|
||||
$(nRow).attr("class", "gap");
|
||||
return nRow;
|
||||
},
|
||||
"bAutoWidth":false
|
||||
} );
|
||||
|
||||
|
||||
function notifyShowStart(show){
|
||||
currentShowInstanceID = show.instance_id;
|
||||
updateDataTable();
|
||||
}
|
||||
|
||||
var columns = [{"sTitle": "type", "bVisible":false},
|
||||
{"sTitle":"Date"},
|
||||
{"sTitle":"Start"},
|
||||
{"sTitle":"End"},
|
||||
{"sTitle":"Duration"},
|
||||
{"sTitle":"Song"},
|
||||
{"sTitle":"Artist"},
|
||||
{"sTitle":"Album"},
|
||||
{"sTitle":"Playlist"},
|
||||
{"sTitle":"Show"},
|
||||
{"sTitle":"bgcolor", "bVisible":false},
|
||||
{"sTitle":"group_id", "bVisible":false}];
|
||||
|
||||
function getDateString(){
|
||||
var date0 = $("#datepicker").datepicker("getDate");
|
||||
return (date0.getFullYear() + "-" + (parseInt(date0.getMonth())+1) + "-" + date0.getDate());
|
||||
|
@ -106,16 +80,21 @@ function getAJAXURL(){
|
|||
|
||||
function updateDataTable(){
|
||||
var table = $('#nowplayingtable').dataTable();
|
||||
|
||||
table.fnClearTable(false);
|
||||
table.fnAddData(datagridData.rows, false);
|
||||
table.fnDraw(true);
|
||||
|
||||
|
||||
//Check if datagridData has been initialized since this update
|
||||
//function can be called before ajax call has been returned.
|
||||
if (datagridData != null){
|
||||
table.fnClearTable(false);
|
||||
table.fnAddData(datagridData.rows, false);
|
||||
table.fnDraw(true);
|
||||
}
|
||||
}
|
||||
|
||||
function getData(){
|
||||
$.ajax({ url: getAJAXURL(), dataType:"json", success:function(data){
|
||||
datagridData = data.entries;
|
||||
if (datagridData.currentShow.length > 0)
|
||||
currentShowInstanceID = datagridData.currentShow[0].instance_id;
|
||||
updateDataTable();
|
||||
}});
|
||||
}
|
||||
|
@ -123,19 +102,41 @@ function getData(){
|
|||
function init2(){
|
||||
getData();
|
||||
|
||||
if (typeof registerSongEndListener == 'function' && !registered){
|
||||
registered = true;
|
||||
registerSongEndListener(notifySongEnd);
|
||||
}
|
||||
|
||||
setTimeout(init2, 5000);
|
||||
|
||||
}
|
||||
|
||||
function redirect(url){
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
function createDataGrid(){
|
||||
|
||||
columns[1]["fnRender"] = getDateText;
|
||||
columns[2]["fnRender"] = getTimeText;
|
||||
columns[3]["fnRender"] = getTimeText;
|
||||
columns[4]["fnRender"] = changeTimePrecisionInit;
|
||||
|
||||
$('#nowplayingtable').dataTable( {
|
||||
"bSort" : false,
|
||||
"bJQueryUI": true,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
"bLengthChange": false,
|
||||
"bPaginate": false,
|
||||
"aoColumns": columns,
|
||||
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
if (aData[aData.length-2] == currentShowInstanceID)
|
||||
$(nRow).addClass("playing-list");
|
||||
if (aData[0] == "c")
|
||||
$(nRow).attr("class", "playing-song");
|
||||
else if (aData[0] == "b")
|
||||
$(nRow).attr("class", "gap");
|
||||
return nRow;
|
||||
},
|
||||
"bAutoWidth":false
|
||||
} );
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
createDataGrid();
|
||||
|
|
|
@ -13,8 +13,6 @@ var currentElem;
|
|||
var serverUpdateInterval = 5000;
|
||||
var uiUpdateInterval = 200;
|
||||
|
||||
var songEndFunc;
|
||||
|
||||
//set to "development" if we are developing :). Useful to disable alerts
|
||||
//when entering production mode.
|
||||
var APPLICATION_ENV = "";
|
||||
|
@ -25,19 +23,7 @@ var APPLICATION_ENV = "";
|
|||
var nextSongPrepare = true;
|
||||
var nextShowPrepare = true;
|
||||
|
||||
/* Another script can register its function here
|
||||
* when it wishes to know when a song ends. */
|
||||
function registerSongEndListener(func){
|
||||
songEndFunc = func;
|
||||
}
|
||||
|
||||
function notifySongEndListener(){
|
||||
if (typeof songEndFunc == "function"){
|
||||
//create a slight pause in execution to allow the browser
|
||||
//to update the display.
|
||||
setTimeout(songEndFunc, 50);
|
||||
}
|
||||
}
|
||||
var apiKey = "";
|
||||
|
||||
function getTrackInfo(song){
|
||||
var str = "";
|
||||
|
@ -57,6 +43,7 @@ function secondsTimer(){
|
|||
var date = new Date();
|
||||
estimatedSchedulePosixTime = date.getTime() - localRemoteTimeOffset;
|
||||
updateProgressBarValue();
|
||||
updatePlaybar();
|
||||
}
|
||||
setTimeout(secondsTimer, uiUpdateInterval);
|
||||
}
|
||||
|
@ -64,15 +51,16 @@ function secondsTimer(){
|
|||
function newSongStart(){
|
||||
nextSongPrepare = true;
|
||||
currentSong[0] = nextSongs.shift();
|
||||
updatePlaybar();
|
||||
|
||||
notifySongEndListener();
|
||||
notifySongStart();
|
||||
}
|
||||
|
||||
function nextShowStart(){
|
||||
nextShowPrepare = true;
|
||||
currentShow[0] = nextShow.shift();
|
||||
updatePlaybar();
|
||||
|
||||
//call function in nowplayingdatagrid.js
|
||||
notifyShowStart(currentShow[0]);
|
||||
}
|
||||
|
||||
/* Called every "uiUpdateInterval" mseconds. */
|
||||
|
@ -129,8 +117,6 @@ function updateProgressBarValue(){
|
|||
setTimeout(nextShowStart, diff);
|
||||
}
|
||||
}
|
||||
|
||||
updatePlaybar();
|
||||
}
|
||||
|
||||
function updatePlaybar(){
|
||||
|
@ -203,6 +189,7 @@ function calcAdditionalShowData(show){
|
|||
|
||||
function parseItems(obj){
|
||||
APPLICATION_ENV = obj.env;
|
||||
apiKey = obj.apiKey;
|
||||
|
||||
$('#time-zone').text(obj.timezone);
|
||||
|
||||
|
@ -230,7 +217,7 @@ function parseItems(obj){
|
|||
function getScheduleFromServer(){
|
||||
$.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
|
||||
parseItems(data.entries);
|
||||
}});
|
||||
}, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
setTimeout(getScheduleFromServer, serverUpdateInterval);
|
||||
}
|
||||
|
||||
|
@ -241,27 +228,31 @@ function init() {
|
|||
|
||||
//begin consumer "thread"
|
||||
secondsTimer();
|
||||
|
||||
$('#about-link').qtip({
|
||||
content: $('#about-txt').html(),
|
||||
show: 'mouseover',
|
||||
hide: { when: 'mouseout', fixed: true },
|
||||
position: {
|
||||
corner: {
|
||||
target: 'center',
|
||||
tooltip: 'topRight'
|
||||
}
|
||||
},
|
||||
style: {
|
||||
border: {
|
||||
width: 0,
|
||||
radius: 4
|
||||
|
||||
var qtipElem = $('#about-link');
|
||||
|
||||
if (qtipElem.length > 0)
|
||||
qtipElem.qtip({
|
||||
content: $('#about-txt').html(),
|
||||
show: 'mouseover',
|
||||
hide: { when: 'mouseout', fixed: true },
|
||||
position: {
|
||||
corner: {
|
||||
target: 'center',
|
||||
tooltip: 'topRight'
|
||||
}
|
||||
},
|
||||
name: 'light', // Use the default light style
|
||||
}
|
||||
});
|
||||
style: {
|
||||
border: {
|
||||
width: 0,
|
||||
radius: 4
|
||||
},
|
||||
name: 'light', // Use the default light style
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
init();
|
||||
if ($('#master-panel').length > 0)
|
||||
init();
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ import sys
|
|||
import time
|
||||
import urllib
|
||||
import logging
|
||||
from util import json
|
||||
import json
|
||||
import os
|
||||
from urlparse import urlparse
|
||||
|
||||
|
@ -118,7 +118,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
response = urllib.urlopen(url)
|
||||
data = response.read()
|
||||
logger.debug("Data: %s", data)
|
||||
response_json = json.read(data)
|
||||
response_json = json.loads(data)
|
||||
version = response_json['version']
|
||||
logger.debug("Airtime Version %s detected", version)
|
||||
except Exception, e:
|
||||
|
@ -223,7 +223,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
try:
|
||||
response_json = urllib.urlopen(export_url).read()
|
||||
#logger.debug("%s", response_json)
|
||||
response = json.read(response_json)
|
||||
response = json.loads(response_json)
|
||||
#logger.info("export status %s", response['check'])
|
||||
status = response['check']
|
||||
except Exception, e:
|
||||
|
@ -281,7 +281,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
|
||||
try:
|
||||
response = urllib.urlopen(url)
|
||||
response = json.read(response.read())
|
||||
response = json.loads(response.read())
|
||||
logger.info("API-Status %s", response['status'])
|
||||
logger.info("API-Message %s", response['message'])
|
||||
|
||||
|
@ -302,7 +302,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
if (data[0] != '{'):
|
||||
return response
|
||||
try:
|
||||
data = json.read(data)
|
||||
data = json.loads(data)
|
||||
logger.debug(str(data))
|
||||
schedule_id = data["schedule_id"]
|
||||
url = self.config["base_url"] + self.config["api_base"] + self.config["update_start_playing_url"]
|
||||
|
@ -311,7 +311,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
logger.debug(url)
|
||||
response = urllib.urlopen(url)
|
||||
response = json.read(response.read())
|
||||
response = json.loads(response.read())
|
||||
logger.info("API-Status %s", response['status'])
|
||||
logger.info("API-Message %s", response['message'])
|
||||
|
||||
|
@ -329,7 +329,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
#
|
||||
#try:
|
||||
# response = urllib.urlopen(url, self.api_auth)
|
||||
# response = json.read(response.read())
|
||||
# response = json.loads(response.read())
|
||||
# logger.debug("Trying to contact %s", url)
|
||||
# logger.info("API-Status %s", response['status'])
|
||||
# logger.info("API-Message %s", response['message'])
|
||||
|
@ -349,7 +349,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
data["schedule_id"] = playlist['id']
|
||||
except Exception, e:
|
||||
data["schedule_id"] = 0
|
||||
data = json.write(data)
|
||||
data = json.dumps(data)
|
||||
return data
|
||||
|
||||
|
||||
|
@ -404,7 +404,7 @@ class ObpApiClient():
|
|||
try:
|
||||
logger.debug("Trying to contact %s", url)
|
||||
response = urllib.urlopen(url, self.api_auth)
|
||||
response_json = json.read(response.read())
|
||||
response_json = json.loads(response.read())
|
||||
obp_version = int(response_json['version'])
|
||||
logger.debug("OBP Version %s detected", obp_version)
|
||||
|
||||
|
@ -471,7 +471,7 @@ class ObpApiClient():
|
|||
try:
|
||||
response_json = urllib.urlopen(export_url).read()
|
||||
logger.debug("%s", response_json)
|
||||
response = json.read(response_json)
|
||||
response = json.loads(response_json)
|
||||
logger.info("export status %s", response['check'])
|
||||
status = response['check']
|
||||
except Exception, e:
|
||||
|
@ -502,7 +502,7 @@ class ObpApiClient():
|
|||
|
||||
try:
|
||||
response = urllib.urlopen(url, self.api_auth)
|
||||
response = json.read(response.read())
|
||||
response = json.loads(response.read())
|
||||
logger.info("API-Status %s", response['status'])
|
||||
logger.info("API-Message %s", response['message'])
|
||||
|
||||
|
@ -536,7 +536,7 @@ class ObpApiClient():
|
|||
|
||||
try:
|
||||
response = urllib.urlopen(url, self.api_auth)
|
||||
response = json.read(response.read())
|
||||
response = json.loads(response.read())
|
||||
logger.info("API-Status %s", response['status'])
|
||||
logger.info("API-Message %s", response['message'])
|
||||
logger.info("TXT %s", response['str_dls'])
|
||||
|
@ -556,7 +556,7 @@ class ObpApiClient():
|
|||
|
||||
try:
|
||||
response = urllib.urlopen(url, self.api_auth)
|
||||
response = json.read(response.read())
|
||||
response = json.loads(response.read())
|
||||
logger.debug("Trying to contact %s", url)
|
||||
logger.info("API-Status %s", response['status'])
|
||||
logger.info("API-Message %s", response['message'])
|
||||
|
@ -580,6 +580,6 @@ class ObpApiClient():
|
|||
data["playlist_id"] = 0
|
||||
data["user_id"] = 0
|
||||
data["transmission_id"] = 0
|
||||
data = json.write(data)
|
||||
data = json.dumps(data)
|
||||
return data
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ import time
|
|||
|
||||
import logging
|
||||
|
||||
from util import json
|
||||
|
||||
import os
|
||||
import socket
|
||||
|
||||
|
@ -87,4 +85,4 @@ class DlsClient():
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ def get_current_script_dir():
|
|||
|
||||
try:
|
||||
current_script_dir = get_current_script_dir()
|
||||
print "Terminating any existing pypo processes"
|
||||
os.system("python %s/pypo-stop.py"% current_script_dir)
|
||||
print "Checking and removing any existing pypo processes"
|
||||
os.system("python %s/pypo-uninstall.py 2>&1 1>/dev/null"% current_script_dir)
|
||||
time.sleep(5)
|
||||
|
||||
# Create users
|
||||
|
|
Binary file not shown.
Binary file not shown.
2053
pypo/ls_script.log
2053
pypo/ls_script.log
File diff suppressed because it is too large
Load Diff
|
@ -19,12 +19,6 @@ Attention & ToDos
|
|||
- liquidsoap does not like mono files! So we have to make sure that only files with
|
||||
2 channels are fed to LiquidSoap
|
||||
(solved: current = audio_to_stereo(current) - maybe not with ultimate performance)
|
||||
|
||||
|
||||
made for python version 2.5!!
|
||||
should work with 2.6 as well with a bit of adaption. for
|
||||
sure the json parsing has to be changed
|
||||
(2.6 has an parser, pypo brings it's own -> util/json.py)
|
||||
"""
|
||||
|
||||
# python defaults (debian default)
|
||||
|
@ -296,17 +290,7 @@ class Playout:
|
|||
|
||||
elif int(playlist['subtype']) > 0 and int(playlist['subtype']) < 5:
|
||||
ls_playlist = self.handle_media_file(playlist, pkey, ls_playlist)
|
||||
|
||||
"""
|
||||
This is kind of hackish. We add a bunch of "silence" tracks to the end of each playlist.
|
||||
So we can make sure the list does not get repeated just before a new one is called.
|
||||
(or in case nothing is in the scheduler afterwards)
|
||||
20 x silence = 10 hours
|
||||
"""
|
||||
for i in range (0, 1):
|
||||
ls_playlist += self.silence_file + "\n"
|
||||
print '',
|
||||
|
||||
|
||||
# write playlist file
|
||||
plfile = open(self.cache_dir + str(pkey) + '/list.lsp', "w")
|
||||
plfile.write(ls_playlist)
|
||||
|
@ -679,29 +663,12 @@ class Playout:
|
|||
logger.debug('OK - Can read playlist file')
|
||||
|
||||
pl_file = open(src, "r")
|
||||
|
||||
"""
|
||||
i know this could be wrapped, maybe later..
|
||||
"""
|
||||
tn = telnetlib.Telnet(LS_HOST, 1234)
|
||||
|
||||
for line in pl_file.readlines():
|
||||
line = line.strip()
|
||||
logger.debug(line)
|
||||
tn.write(self.export_source + '.push %s' % (line))
|
||||
tn.write("\n")
|
||||
|
||||
tn.write("exit\n")
|
||||
logger.debug(tn.read_all())
|
||||
|
||||
pattern = '%Y-%m-%d-%H-%M-%S'
|
||||
|
||||
|
||||
#strptime returns struct_time in local time
|
||||
#mktime takes a time_struct and returns a floating point
|
||||
#gmtime Convert a time expressed in seconds since the epoch to a struct_time in UTC
|
||||
|
||||
#gmtime Convert a time expressed in seconds since the epoch to a struct_time in UTC
|
||||
#mktime: expresses the time in local time, not UTC. It returns a floating point number, for compatibility with time().
|
||||
epoch_start = calendar.timegm(time.gmtime(time.mktime(time.strptime(pkey, pattern))))
|
||||
epoch_start = calendar.timegm(time.gmtime(time.mktime(time.strptime(pkey, '%Y-%m-%d-%H-%M-%S'))))
|
||||
|
||||
#Return the time as a floating point number expressed in seconds since the epoch, in UTC.
|
||||
epoch_now = time.time()
|
||||
|
@ -717,8 +684,19 @@ class Playout:
|
|||
|
||||
logger.debug('sleeping for %s s' % (sleep_time))
|
||||
time.sleep(sleep_time)
|
||||
|
||||
tn = telnetlib.Telnet(LS_HOST, 1234)
|
||||
|
||||
for line in pl_file.readlines():
|
||||
line = line.strip()
|
||||
logger.debug(line)
|
||||
tn.write('queue.push %s' % (line))
|
||||
tn.write("\n")
|
||||
|
||||
tn.write("exit\n")
|
||||
logger.debug(tn.read_all())
|
||||
|
||||
logger.debug('sending "flip"')
|
||||
"""
|
||||
tn = telnetlib.Telnet(LS_HOST, 1234)
|
||||
|
||||
# Get any extra information for liquidsoap (which will be sent back to us)
|
||||
|
@ -733,6 +711,7 @@ class Playout:
|
|||
tn.write("exit\n")
|
||||
|
||||
tn.read_all()
|
||||
"""
|
||||
status = 1
|
||||
except Exception, e:
|
||||
logger.error('%s', e)
|
||||
|
|
|
@ -29,6 +29,7 @@ import logging.config
|
|||
import urllib
|
||||
import urllib2
|
||||
import string
|
||||
import json
|
||||
|
||||
# additional modules (should be checked)
|
||||
from configobj import ConfigObj
|
||||
|
@ -50,13 +51,7 @@ parser = OptionParser(usage=usage)
|
|||
|
||||
# Options
|
||||
parser.add_option("-d", "--data", help="Pass JSON data from liquidsoap into this script.", metavar="data")
|
||||
#parser.add_option("-p", "--playing", help="Tell server what is playing right now.", default=False, action="store_true", dest="playing")
|
||||
#parser.add_option("-t", "--playlist-type", help="", metavar="playlist_type")
|
||||
parser.add_option("-m", "--media-id", help="ID of the file that is currently playing.", metavar="media_id")
|
||||
#parser.add_option("-U", "--user-id", help="", metavar="user_id")
|
||||
#parser.add_option("-P", "--playlist-id", help="", metavar="playlist_id")
|
||||
#parser.add_option("-T", "--transmission-id", help="", metavar="transmission_id")
|
||||
#parser.add_option("-E", "--export-source", help="", metavar="export_source")
|
||||
|
||||
# parse options
|
||||
(options, args) = parser.parse_args()
|
||||
|
@ -72,135 +67,21 @@ except Exception, e:
|
|||
print 'error: ', e
|
||||
sys.exit()
|
||||
|
||||
|
||||
class Global:
|
||||
def __init__(self):
|
||||
print
|
||||
|
||||
def selfcheck(self):
|
||||
pass
|
||||
#self.api_client = api_client.api_client_factory(config)
|
||||
#self.api_client.check_version()
|
||||
|
||||
class Notify:
|
||||
def __init__(self):
|
||||
self.api_client = api_client.api_client_factory(config)
|
||||
#self.dls_client = DlsClient('127.0.0.128', 50008, 'myusername', 'mypass')
|
||||
|
||||
|
||||
def notify_media_start_playing(self, data, media_id):
|
||||
logger = logging.getLogger()
|
||||
#tnow = time.localtime(time.time())
|
||||
|
||||
logger.debug('#################################################')
|
||||
logger.debug('# Calling server to update about what\'s playing #')
|
||||
logger.debug('#################################################')
|
||||
logger.debug('data = '+ str(data))
|
||||
#print 'options.data = '+ options.data
|
||||
#data = json.read(options.data)
|
||||
response = self.api_client.notify_media_item_start_playing(data, media_id)
|
||||
logger.debug("Response: "+str(response))
|
||||
|
||||
#def start_playing(self, options):
|
||||
# logger = logging.getLogger("start_playing")
|
||||
# tnow = time.localtime(time.time())
|
||||
#
|
||||
# #print options
|
||||
#
|
||||
# logger.debug('#################################################')
|
||||
# logger.debug('# Calling server to update about what\'s playing #')
|
||||
# logger.debug('#################################################')
|
||||
#
|
||||
# if int(options.playlist_type) < 5:
|
||||
# logger.debug('seems to be a playlist')
|
||||
#
|
||||
# try:
|
||||
# media_id = int(options.media_id)
|
||||
# except Exception, e:
|
||||
# media_id = 0
|
||||
#
|
||||
# response = self.api_client.update_start_playing(options.playlist_type, options.export_source, media_id, options.playlist_id, options.transmission_id)
|
||||
#
|
||||
# logger.debug(response)
|
||||
#
|
||||
# if int(options.playlist_type) == 6:
|
||||
# logger.debug('seems to be a couchcast')
|
||||
#
|
||||
# try:
|
||||
# media_id = int(options.media_id)
|
||||
# except Exception, e:
|
||||
# media_id = 0
|
||||
#
|
||||
# response = self.api_client.update_start_playing(options.playlist_type, options.export_source, media_id, options.playlist_id, options.transmission_id)
|
||||
#
|
||||
# logger.debug(response)
|
||||
#
|
||||
# sys.exit()
|
||||
|
||||
#def start_playing_legacy(self, options):
|
||||
# logger = logging.getLogger("start_playing")
|
||||
# tnow = time.localtime(time.time())
|
||||
#
|
||||
# print '#################################################'
|
||||
# print '# Calling server to update about what\'s playing #'
|
||||
# print '#################################################'
|
||||
#
|
||||
# path = options
|
||||
#
|
||||
# print
|
||||
# print path
|
||||
# print
|
||||
#
|
||||
# if 'pl_id' in path:
|
||||
# print 'seems to be a playlist'
|
||||
# type = 'playlist'
|
||||
# id = path[5:]
|
||||
#
|
||||
# elif 'text' in path:
|
||||
# print 'seems to be a playlist'
|
||||
# type = 'text'
|
||||
# id = path[4:]
|
||||
# print id
|
||||
#
|
||||
# else:
|
||||
# print 'seems to be a single track (media)'
|
||||
# type = 'media'
|
||||
# try:
|
||||
# file = path.split("/")[-1:][0]
|
||||
# if file.find('_cue_') > 0:
|
||||
# id = file.split("_cue_")[0]
|
||||
# else:
|
||||
# id = file.split(".")[-2:][0]
|
||||
#
|
||||
# except Exception, e:
|
||||
# #print e
|
||||
# id = False
|
||||
#
|
||||
# try:
|
||||
# id = id
|
||||
# except Exception, e:
|
||||
# #print e
|
||||
# id = False
|
||||
#
|
||||
# print
|
||||
# print type + " id: ",
|
||||
# print id
|
||||
#
|
||||
#
|
||||
# response = self.api_client.update_start_playing(type, id, self.export_source, path)
|
||||
#
|
||||
# print 'DONE'
|
||||
#
|
||||
# try:
|
||||
# txt = response['txt']
|
||||
# print '#######################################'
|
||||
# print txt
|
||||
# print '#######################################'
|
||||
# #self.dls_client.set_txt(txt)
|
||||
#
|
||||
# except Exception, e:
|
||||
# print e
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print
|
||||
|
@ -210,13 +91,8 @@ if __name__ == '__main__':
|
|||
print '#########################################'
|
||||
|
||||
# initialize
|
||||
g = Global()
|
||||
logger = logging.getLogger()
|
||||
#if options.playing:
|
||||
# try: n.start_playing(options)
|
||||
# except Exception, e:
|
||||
# print e
|
||||
# sys.exit()
|
||||
|
||||
if not options.data:
|
||||
print "NOTICE: 'data' command-line argument not given."
|
||||
sys.exit()
|
||||
|
@ -226,7 +102,6 @@ if __name__ == '__main__':
|
|||
sys.exit()
|
||||
|
||||
try:
|
||||
g.selfcheck()
|
||||
n = Notify()
|
||||
n.notify_media_start_playing(options.data, options.media_id)
|
||||
except Exception, e:
|
||||
|
|
|
@ -28,7 +28,8 @@ icecast_port = 8000
|
|||
icecast_pass = "hackme"
|
||||
|
||||
# mountpoints
|
||||
mount_scheduler = "airtime.mp3"
|
||||
mount_point_mp3 = "airtime.mp3"
|
||||
mount_point_vorbis = "airtime.ogg"
|
||||
|
||||
# mount intra is used for scheduler >>> fallback stream
|
||||
mount_intra = "pypo_intra"
|
||||
|
@ -38,3 +39,10 @@ intra_host = "127.0.0.1"
|
|||
intra_port = 9000
|
||||
intra_pass = "hackme"
|
||||
|
||||
icecast_url = "http://airtime.sourcefabric.org"
|
||||
icecast_description = "Airtime Radio!"
|
||||
icecast_genre = "genre"
|
||||
|
||||
output_sound_device = true
|
||||
output_icecast_vorbis = true
|
||||
output_icecast_mp3 = true
|
||||
|
|
|
@ -5,42 +5,14 @@ set("log.file.path", log_file)
|
|||
set("log.stdout", true)
|
||||
set("server.telnet", true)
|
||||
|
||||
active_queue = ref 0
|
||||
|
||||
scheduler_q0 = request.queue(conservative=true,length=600.,id="scheduler_q0")
|
||||
scheduler_q1 = request.queue(conservative=true,length=600.,id="scheduler_q1")
|
||||
|
||||
scheduler_q0 = audio_to_stereo(scheduler_q0)
|
||||
scheduler_q1 = audio_to_stereo(scheduler_q1)
|
||||
queue = request.queue(conservative=true,length=600.,id="queue")
|
||||
queue = audio_to_stereo(queue)
|
||||
|
||||
pypo_data = ref '0'
|
||||
|
||||
# push function, enqueues file in inactive queue (does not start automatically)
|
||||
def scheduler_push(s)
|
||||
ignore(server.execute("scheduler_q#{!active_queue}.push #{s}"))
|
||||
print('push to #{!active_queue} - #{s}')
|
||||
"Done"
|
||||
end
|
||||
|
||||
# flips the queues
|
||||
def scheduler_flip()
|
||||
# get playing (active) queue and flush it
|
||||
l = list.hd(server.execute("scheduler_q#{!active_queue}.queue"))
|
||||
l = string.split(separator=" ",l)
|
||||
list.iter(fun (rid) -> ignore(server.execute("scheduler_q#{!active_queue}.ignore #{rid}")), l)
|
||||
|
||||
# skip the playing item
|
||||
source.skip(if !active_queue==0 then scheduler_q0 else scheduler_q1 end)
|
||||
|
||||
# flip variables
|
||||
active_queue := 1-!active_queue
|
||||
print('switch to active queue: #{!active_queue}')
|
||||
"Done"
|
||||
end
|
||||
|
||||
def notify(m)
|
||||
print("./notify.sh --data='#{!pypo_data}' --media-id=#{m['media_id']}")
|
||||
end
|
||||
#def notify(m)
|
||||
# print("./notify.sh --data='#{!pypo_data}' --media-id=#{m['media_id']}")
|
||||
#end
|
||||
|
||||
def crossfade(s)
|
||||
s = fade.in(type="log", s)
|
||||
|
@ -49,23 +21,42 @@ def crossfade(s)
|
|||
cross(fader,s)
|
||||
end
|
||||
|
||||
server.register(namespace="scheduler","push", scheduler_push)
|
||||
server.register(namespace="scheduler","flip", fun (s) -> begin scheduler_flip() end)
|
||||
server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := s "Done" end)
|
||||
|
||||
default = single("/opt/pypo/files/basic/silence.mp3")
|
||||
radio = fallback(track_sensitive=false, [switch(track_sensitive=false, [(fun () -> !active_queue==1, scheduler_q0), (fun () -> !active_queue==0, scheduler_q1)]), default])
|
||||
default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
|
||||
|
||||
#radio = on_metadata(notify, radio)
|
||||
s = fallback(track_sensitive=false, [queue, default])
|
||||
|
||||
radio = crossfade(radio)
|
||||
#s = on_metadata(notify, s)
|
||||
s = crossfade(s)
|
||||
|
||||
out(radio)
|
||||
clock(id="clock_icecast",
|
||||
output.icecast(%mp3,
|
||||
host = icecast_host, port = icecast_port,
|
||||
password = icecast_pass, mount = mount_scheduler,
|
||||
fallible = true,
|
||||
restart = true,
|
||||
restart_delay = 5,
|
||||
buffer(radio)))
|
||||
if output_sound_device then
|
||||
out_device = out(s)
|
||||
end
|
||||
|
||||
if output_icecast_mp3 then
|
||||
out_mp3 = output.icecast(%mp3,
|
||||
host = icecast_host, port = icecast_port,
|
||||
password = icecast_pass, mount = mount_point_mp3,
|
||||
fallible = true,
|
||||
restart = true,
|
||||
restart_delay = 5,
|
||||
url = icecast_url,
|
||||
description = icecast_description,
|
||||
genre = icecast_genre,
|
||||
s)
|
||||
end
|
||||
|
||||
if output_icecast_vorbis then
|
||||
out_vorbis = output.icecast(%vorbis,
|
||||
host = icecast_host, port = icecast_port,
|
||||
password = icecast_pass, mount = mount_point_vorbis,
|
||||
fallible = true,
|
||||
restart = true,
|
||||
restart_delay = 5,
|
||||
url = icecast_url,
|
||||
description = icecast_description,
|
||||
genre = icecast_genre,
|
||||
s)
|
||||
end
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
||||
/opt/pypo/files/basic/silence.mp3
|
|
@ -97,4 +97,3 @@ $scheduleGroup = new ScheduleGroup();
|
|||
$scheduleGroup->add($playTime, null, $pl->getId());
|
||||
|
||||
echo " SUCCESS: Playlist scheduled at $playTime\n\n";
|
||||
?>
|
||||
|
|
|
@ -1,310 +0,0 @@
|
|||
import string
|
||||
import types
|
||||
|
||||
## json.py implements a JSON (http://json.org) reader and writer.
|
||||
## Copyright (C) 2005 Patrick D. Logan
|
||||
## Contact mailto:patrickdlogan@stardecisions.com
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation; either
|
||||
## version 2.1 of the License, or (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with this library; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
class _StringGenerator(object):
|
||||
def __init__(self, string):
|
||||
self.string = string
|
||||
self.index = -1
|
||||
def peek(self):
|
||||
i = self.index + 1
|
||||
if i < len(self.string):
|
||||
return self.string[i]
|
||||
else:
|
||||
return None
|
||||
def next(self):
|
||||
self.index += 1
|
||||
if self.index < len(self.string):
|
||||
return self.string[self.index]
|
||||
else:
|
||||
raise StopIteration
|
||||
def all(self):
|
||||
return self.string
|
||||
|
||||
class WriteException(Exception):
|
||||
pass
|
||||
|
||||
class ReadException(Exception):
|
||||
pass
|
||||
|
||||
class JsonReader(object):
|
||||
hex_digits = {'A': 10,'B': 11,'C': 12,'D': 13,'E': 14,'F':15}
|
||||
escapes = {'t':'\t','n':'\n','f':'\f','r':'\r','b':'\b'}
|
||||
|
||||
def read(self, s):
|
||||
self._generator = _StringGenerator(s)
|
||||
result = self._read()
|
||||
return result
|
||||
|
||||
def _read(self):
|
||||
self._eatWhitespace()
|
||||
peek = self._peek()
|
||||
if peek is None:
|
||||
raise ReadException, "Nothing to read: '%s'" % self._generator.all()
|
||||
if peek == '{':
|
||||
return self._readObject()
|
||||
elif peek == '[':
|
||||
return self._readArray()
|
||||
elif peek == '"':
|
||||
return self._readString()
|
||||
elif peek == '-' or peek.isdigit():
|
||||
return self._readNumber()
|
||||
elif peek == 't':
|
||||
return self._readTrue()
|
||||
elif peek == 'f':
|
||||
return self._readFalse()
|
||||
elif peek == 'n':
|
||||
return self._readNull()
|
||||
elif peek == '/':
|
||||
self._readComment()
|
||||
return self._read()
|
||||
else:
|
||||
raise ReadException, "Input is not valid JSON: '%s'" % self._generator.all()
|
||||
|
||||
def _readTrue(self):
|
||||
self._assertNext('t', "true")
|
||||
self._assertNext('r', "true")
|
||||
self._assertNext('u', "true")
|
||||
self._assertNext('e', "true")
|
||||
return True
|
||||
|
||||
def _readFalse(self):
|
||||
self._assertNext('f', "false")
|
||||
self._assertNext('a', "false")
|
||||
self._assertNext('l', "false")
|
||||
self._assertNext('s', "false")
|
||||
self._assertNext('e', "false")
|
||||
return False
|
||||
|
||||
def _readNull(self):
|
||||
self._assertNext('n', "null")
|
||||
self._assertNext('u', "null")
|
||||
self._assertNext('l', "null")
|
||||
self._assertNext('l', "null")
|
||||
return None
|
||||
|
||||
def _assertNext(self, ch, target):
|
||||
if self._next() != ch:
|
||||
raise ReadException, "Trying to read %s: '%s'" % (target, self._generator.all())
|
||||
|
||||
def _readNumber(self):
|
||||
isfloat = False
|
||||
result = self._next()
|
||||
peek = self._peek()
|
||||
while peek is not None and (peek.isdigit() or peek == "."):
|
||||
isfloat = isfloat or peek == "."
|
||||
result = result + self._next()
|
||||
peek = self._peek()
|
||||
try:
|
||||
if isfloat:
|
||||
return float(result)
|
||||
else:
|
||||
return int(result)
|
||||
except ValueError:
|
||||
raise ReadException, "Not a valid JSON number: '%s'" % result
|
||||
|
||||
def _readString(self):
|
||||
result = ""
|
||||
assert self._next() == '"'
|
||||
try:
|
||||
while self._peek() != '"':
|
||||
ch = self._next()
|
||||
if ch == "\\":
|
||||
ch = self._next()
|
||||
if ch in 'brnft':
|
||||
ch = self.escapes[ch]
|
||||
elif ch == "u":
|
||||
ch4096 = self._next()
|
||||
ch256 = self._next()
|
||||
ch16 = self._next()
|
||||
ch1 = self._next()
|
||||
n = 4096 * self._hexDigitToInt(ch4096)
|
||||
n += 256 * self._hexDigitToInt(ch256)
|
||||
n += 16 * self._hexDigitToInt(ch16)
|
||||
n += self._hexDigitToInt(ch1)
|
||||
ch = unichr(n)
|
||||
elif ch not in '"/\\':
|
||||
raise ReadException, "Not a valid escaped JSON character: '%s' in %s" % (ch, self._generator.all())
|
||||
result = result + ch
|
||||
except StopIteration:
|
||||
raise ReadException, "Not a valid JSON string: '%s'" % self._generator.all()
|
||||
assert self._next() == '"'
|
||||
return result
|
||||
|
||||
def _hexDigitToInt(self, ch):
|
||||
try:
|
||||
result = self.hex_digits[ch.upper()]
|
||||
except KeyError:
|
||||
try:
|
||||
result = int(ch)
|
||||
except ValueError:
|
||||
raise ReadException, "The character %s is not a hex digit." % ch
|
||||
return result
|
||||
|
||||
def _readComment(self):
|
||||
assert self._next() == "/"
|
||||
second = self._next()
|
||||
if second == "/":
|
||||
self._readDoubleSolidusComment()
|
||||
elif second == '*':
|
||||
self._readCStyleComment()
|
||||
else:
|
||||
raise ReadException, "Not a valid JSON comment: %s" % self._generator.all()
|
||||
|
||||
def _readCStyleComment(self):
|
||||
try:
|
||||
done = False
|
||||
while not done:
|
||||
ch = self._next()
|
||||
done = (ch == "*" and self._peek() == "/")
|
||||
if not done and ch == "/" and self._peek() == "*":
|
||||
raise ReadException, "Not a valid JSON comment: %s, '/*' cannot be embedded in the comment." % self._generator.all()
|
||||
self._next()
|
||||
except StopIteration:
|
||||
raise ReadException, "Not a valid JSON comment: %s, expected */" % self._generator.all()
|
||||
|
||||
def _readDoubleSolidusComment(self):
|
||||
try:
|
||||
ch = self._next()
|
||||
while ch != "\r" and ch != "\n":
|
||||
ch = self._next()
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
def _readArray(self):
|
||||
result = []
|
||||
assert self._next() == '['
|
||||
done = self._peek() == ']'
|
||||
while not done:
|
||||
item = self._read()
|
||||
result.append(item)
|
||||
self._eatWhitespace()
|
||||
done = self._peek() == ']'
|
||||
if not done:
|
||||
ch = self._next()
|
||||
if ch != ",":
|
||||
raise ReadException, "Not a valid JSON array: '%s' due to: '%s'" % (self._generator.all(), ch)
|
||||
assert ']' == self._next()
|
||||
return result
|
||||
|
||||
def _readObject(self):
|
||||
result = {}
|
||||
assert self._next() == '{'
|
||||
done = self._peek() == '}'
|
||||
while not done:
|
||||
key = self._read()
|
||||
if type(key) is not types.StringType:
|
||||
raise ReadException, "Not a valid JSON object key (should be a string): %s" % key
|
||||
self._eatWhitespace()
|
||||
ch = self._next()
|
||||
if ch != ":":
|
||||
raise ReadException, "Not a valid JSON object: '%s' due to: '%s'" % (self._generator.all(), ch)
|
||||
self._eatWhitespace()
|
||||
val = self._read()
|
||||
result[key] = val
|
||||
self._eatWhitespace()
|
||||
done = self._peek() == '}'
|
||||
if not done:
|
||||
ch = self._next()
|
||||
if ch != ",":
|
||||
raise ReadException, "Not a valid JSON array: '%s' due to: '%s'" % (self._generator.all(), ch)
|
||||
assert self._next() == "}"
|
||||
return result
|
||||
|
||||
def _eatWhitespace(self):
|
||||
p = self._peek()
|
||||
while p is not None and p in string.whitespace or p == '/':
|
||||
if p == '/':
|
||||
self._readComment()
|
||||
else:
|
||||
self._next()
|
||||
p = self._peek()
|
||||
|
||||
def _peek(self):
|
||||
return self._generator.peek()
|
||||
|
||||
def _next(self):
|
||||
return self._generator.next()
|
||||
|
||||
class JsonWriter(object):
|
||||
|
||||
def _append(self, s):
|
||||
self._results.append(s)
|
||||
|
||||
def write(self, obj, escaped_forward_slash=False):
|
||||
self._escaped_forward_slash = escaped_forward_slash
|
||||
self._results = []
|
||||
self._write(obj)
|
||||
return "".join(self._results)
|
||||
|
||||
def _write(self, obj):
|
||||
ty = type(obj)
|
||||
if ty is types.DictType:
|
||||
n = len(obj)
|
||||
self._append("{")
|
||||
for k, v in obj.items():
|
||||
self._write(k)
|
||||
self._append(":")
|
||||
self._write(v)
|
||||
n = n - 1
|
||||
if n > 0:
|
||||
self._append(",")
|
||||
self._append("}")
|
||||
elif ty is types.ListType or ty is types.TupleType:
|
||||
n = len(obj)
|
||||
self._append("[")
|
||||
for item in obj:
|
||||
self._write(item)
|
||||
n = n - 1
|
||||
if n > 0:
|
||||
self._append(",")
|
||||
self._append("]")
|
||||
elif ty is types.StringType or ty is types.UnicodeType:
|
||||
self._append('"')
|
||||
obj = obj.replace('\\', r'\\')
|
||||
if self._escaped_forward_slash:
|
||||
obj = obj.replace('/', r'\/')
|
||||
obj = obj.replace('"', r'\"')
|
||||
obj = obj.replace('\b', r'\b')
|
||||
obj = obj.replace('\f', r'\f')
|
||||
obj = obj.replace('\n', r'\n')
|
||||
obj = obj.replace('\r', r'\r')
|
||||
obj = obj.replace('\t', r'\t')
|
||||
self._append(obj)
|
||||
self._append('"')
|
||||
elif ty is types.IntType or ty is types.LongType:
|
||||
self._append(str(obj))
|
||||
elif ty is types.FloatType:
|
||||
self._append("%f" % obj)
|
||||
elif obj is True:
|
||||
self._append("true")
|
||||
elif obj is False:
|
||||
self._append("false")
|
||||
elif obj is None:
|
||||
self._append("null")
|
||||
else:
|
||||
raise WriteException, "Cannot write in JSON: %s" % repr(obj)
|
||||
|
||||
def write(obj, escaped_forward_slash=False):
|
||||
return JsonWriter().write(obj, escaped_forward_slash)
|
||||
|
||||
def read(s):
|
||||
return JsonReader().read(s)
|
|
@ -7,8 +7,7 @@ import urllib
|
|||
import logging
|
||||
|
||||
import telnetlib
|
||||
|
||||
from util import json
|
||||
import json
|
||||
|
||||
import os
|
||||
|
||||
|
@ -26,7 +25,7 @@ class Status:
|
|||
# lookup OBP version
|
||||
try:
|
||||
response = urllib.urlopen(self.status_url)
|
||||
response_json = json.read(response.read())
|
||||
response_json = json.loads(response.read())
|
||||
obp_version = int(response_json['version'])
|
||||
logger.debug("OBP Version %s detected", obp_version)
|
||||
|
||||
|
|
|
@ -122,4 +122,3 @@ switch($argv[1]){
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -192,5 +192,3 @@ function admDumpGroup(&$bs, $gid, $ind='')
|
|||
#var_export($res);
|
||||
#var_dump($res);
|
||||
echo "$res";
|
||||
|
||||
?>
|
|
@ -346,4 +346,3 @@ if ($g_errors > 0) {
|
|||
echo " *** Total: ".($g_fileCount+$g_duplicates)." files in $time seconds = $speed files/second.\n";
|
||||
echo "==========================================================================\n";
|
||||
|
||||
?>
|
||||
|
|
|
@ -252,4 +252,3 @@ foreach ($groups as $grname => $group) {
|
|||
/* -------------------------------------------------------- restoring objects */
|
||||
ls_restore_restoreObject($tree, /*$storId,*/ FALSE);
|
||||
|
||||
?>
|
|
@ -1,41 +1,36 @@
|
|||
#!/usr/bin/php
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Do database restore in background. - command line php application
|
||||
*
|
||||
* required command line parameters:
|
||||
* @param 1. backup file
|
||||
* @param 2. status file
|
||||
* @param 3. token
|
||||
* @param 4. sessid
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Do database restore in background. - command line php application
|
||||
*
|
||||
* required command line parameters:
|
||||
* @param 1. backup file
|
||||
* @param 2. status file
|
||||
* @param 3. token
|
||||
* @param 4. sessid
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/GreenBox.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/Restore.php');
|
||||
include_once('DB.php');
|
||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/GreenBox.php');
|
||||
require_once(dirname(__FILE__).'/../application/models/Restore.php');
|
||||
include_once('DB.php');
|
||||
|
||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE);
|
||||
if (DB::isError($CC_DBC)) {
|
||||
die($CC_DBC->getMessage());
|
||||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE);
|
||||
if (DB::isError($CC_DBC)) {
|
||||
die($CC_DBC->getMessage());
|
||||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
$gb = new GreenBox();
|
||||
$rs = new Restore($gb);
|
||||
$gb = new GreenBox();
|
||||
$rs = new Restore($gb);
|
||||
|
||||
if ($rs->loglevel=='debug') {
|
||||
$rs->addLogItem('argv:'.print_r($argv,true));
|
||||
}
|
||||
if ($rs->loglevel=='debug') {
|
||||
$rs->addLogItem('argv:'.print_r($argv,true));
|
||||
}
|
||||
|
||||
# sleep(2);
|
||||
$backupfile = $argv[1];
|
||||
$token = $argv[3];
|
||||
$sessid = $argv[4];
|
||||
$rs->startRestore($backupfile,$token,$sessid);
|
||||
|
||||
$backupfile = $argv[1];
|
||||
$token = $argv[3];
|
||||
$sessid = $argv[4];
|
||||
$rs->startRestore($backupfile,$token,$sessid);
|
||||
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue