From 2148de0e926ed16bca19c0bc1767e99aff09e8a9 Mon Sep 17 00:00:00 2001
From: martin <martin@martin-ThinkPad-T410.(none)>
Date: Wed, 13 Apr 2011 12:07:00 -0400
Subject: [PATCH] CC-2149: Adjustments for DEB packaging -Done

---
 build/build.properties                        |  2 +-
 install/airtime-user.php                      |  0
 library/propel/docs/behavior/sluggable.txt    |  0
 library/propel/docs/build.xml                 |  0
 .../propel/docs/cookbook/Writing-Behavior.txt |  0
 .../SortableBehaviorQueryBuilderModifier.php  |  0
 .../om/ExtensionQueryInheritanceBuilder.php   |  0
 .../builder/om/QueryInheritanceBuilder.php    |  0
 .../lib/builder/util/PropelStringReader.php   |  0
 library/propel/generator/pear/pear-propel-gen |  0
 .../resources/xsd/custom_datatypes.xsd        |  0
 .../generator/resources/xsd/database.xsd      |  0
 .../generator/resources/xsl/database.xsl      |  0
 .../lib/collection/PropelOnDemandIterator.php |  0
 .../runtime/lib/formatter/ModelWith.php       |  0
 .../runtime/lib/util/PropelAutoloader.php     |  0
 ...rtableBehaviorQueryBuilderModifierTest.php |  0
 ...aviorQueryBuilderModifierWithScopeTest.php |  0
 .../sortable/SortableBehaviorTest.php         |  0
 .../generator/builder/NamespaceTest.php       |  0
 .../builder/om/OMBuilderNamespaceTest.php     |  0
 .../om/QueryBuilderInheritanceTest.php        |  0
 .../collection/PropelOnDemandIteratorTest.php |  0
 .../PropelOnDemandFormatterWithTest.php       |  0
 .../runtime/map/GeneratedRelationMapTest.php  |  0
 .../runtime/map/RelatedMapSymmetricalTest.php |  0
 .../runtime/om/BaseObjectSerializeTest.php    |  0
 .../testsuite/runtime/om/BaseObjectTest.php   |  0
 .../runtime/query/ModelCriteriaHooksTest.php  |  0
 .../testsuite/runtime/query/ModelWithTest.php |  0
 .../runtime/util/BasePeerExceptionsTest.php   |  0
 public/.htaccess                              |  2 +
 python_apps/pypo/config.cfg.dist              |  0
 python_apps/pypo/dls/__init__.py              |  0
 .../install/pypo-daemontools-liquidsoap.sh    |  0
 .../pypo/install/pypo-daemontools-logger.sh   |  0
 python_apps/pypo/install/pypo-daemontools.sh  |  0
 python_apps/pypo/install/pypo-install.py      |  0
 python_apps/pypo/install/pypo-start.py        |  0
 python_apps/pypo/install/pypo-stop.py         |  0
 python_apps/pypo/install/pypo-uninstall.py    |  0
 python_apps/pypo/pypo-cue-in-validator.py     |  0
 python_apps/pypo/pypofetch.py                 |  0
 python_apps/pypo/pypopush.py                  |  0
 .../pypo/scripts/library/liquidsoap.initd     |  0
 .../pypo/test/airtime-schedule-insert.php     | 80 ++++++++++++-------
 python_apps/pypo/util/__init__.py             |  0
 python_apps/pypo/util/status.py               |  0
 48 files changed, 53 insertions(+), 31 deletions(-)
 mode change 100644 => 100755 install/airtime-user.php
 mode change 100755 => 100644 library/propel/docs/behavior/sluggable.txt
 mode change 100755 => 100644 library/propel/docs/build.xml
 mode change 100755 => 100644 library/propel/docs/cookbook/Writing-Behavior.txt
 mode change 100755 => 100644 library/propel/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php
 mode change 100755 => 100644 library/propel/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php
 mode change 100755 => 100644 library/propel/generator/lib/builder/om/QueryInheritanceBuilder.php
 mode change 100755 => 100644 library/propel/generator/lib/builder/util/PropelStringReader.php
 mode change 100644 => 100755 library/propel/generator/pear/pear-propel-gen
 mode change 100755 => 100644 library/propel/generator/resources/xsd/custom_datatypes.xsd
 mode change 100755 => 100644 library/propel/generator/resources/xsd/database.xsd
 mode change 100755 => 100644 library/propel/generator/resources/xsl/database.xsl
 mode change 100755 => 100644 library/propel/runtime/lib/collection/PropelOnDemandIterator.php
 mode change 100755 => 100644 library/propel/runtime/lib/formatter/ModelWith.php
 mode change 100755 => 100644 library/propel/runtime/lib/util/PropelAutoloader.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierWithScopeTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/builder/NamespaceTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/builder/om/OMBuilderNamespaceTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/collection/PropelOnDemandIteratorTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/formatter/PropelOnDemandFormatterWithTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/map/GeneratedRelationMapTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/map/RelatedMapSymmetricalTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/om/BaseObjectSerializeTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/om/BaseObjectTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/query/ModelCriteriaHooksTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/query/ModelWithTest.php
 mode change 100755 => 100644 library/propel/test/testsuite/runtime/util/BasePeerExceptionsTest.php
 mode change 100755 => 100644 python_apps/pypo/config.cfg.dist
 mode change 100644 => 100755 python_apps/pypo/dls/__init__.py
 mode change 100644 => 100755 python_apps/pypo/install/pypo-daemontools-liquidsoap.sh
 mode change 100644 => 100755 python_apps/pypo/install/pypo-daemontools-logger.sh
 mode change 100644 => 100755 python_apps/pypo/install/pypo-daemontools.sh
 mode change 100644 => 100755 python_apps/pypo/install/pypo-install.py
 mode change 100644 => 100755 python_apps/pypo/install/pypo-start.py
 mode change 100644 => 100755 python_apps/pypo/install/pypo-stop.py
 mode change 100644 => 100755 python_apps/pypo/install/pypo-uninstall.py
 mode change 100644 => 100755 python_apps/pypo/pypo-cue-in-validator.py
 mode change 100644 => 100755 python_apps/pypo/pypofetch.py
 mode change 100644 => 100755 python_apps/pypo/pypopush.py
 mode change 100644 => 100755 python_apps/pypo/scripts/library/liquidsoap.initd
 mode change 100644 => 100755 python_apps/pypo/util/__init__.py
 mode change 100644 => 100755 python_apps/pypo/util/status.py

diff --git a/build/build.properties b/build/build.properties
index 75a77da70..d15498cad 100644
--- a/build/build.properties
+++ b/build/build.properties
@@ -1,6 +1,6 @@
 #Note: project.home is automatically generated by the propel-install script. 
 #Any manual changes to this value will be overwritten.
-project.home = /home/naomiaro/dev-campcaster/campcaster
+project.home = /home/martin/workspace/airtime
 project.build = ${project.home}/build
 
 #Database driver
diff --git a/install/airtime-user.php b/install/airtime-user.php
old mode 100644
new mode 100755
diff --git a/library/propel/docs/behavior/sluggable.txt b/library/propel/docs/behavior/sluggable.txt
old mode 100755
new mode 100644
diff --git a/library/propel/docs/build.xml b/library/propel/docs/build.xml
old mode 100755
new mode 100644
diff --git a/library/propel/docs/cookbook/Writing-Behavior.txt b/library/propel/docs/cookbook/Writing-Behavior.txt
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php b/library/propel/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php b/library/propel/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/om/QueryInheritanceBuilder.php b/library/propel/generator/lib/builder/om/QueryInheritanceBuilder.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/lib/builder/util/PropelStringReader.php b/library/propel/generator/lib/builder/util/PropelStringReader.php
old mode 100755
new mode 100644
diff --git a/library/propel/generator/pear/pear-propel-gen b/library/propel/generator/pear/pear-propel-gen
old mode 100644
new mode 100755
diff --git a/library/propel/generator/resources/xsd/custom_datatypes.xsd b/library/propel/generator/resources/xsd/custom_datatypes.xsd
old mode 100755
new mode 100644
diff --git a/library/propel/generator/resources/xsd/database.xsd b/library/propel/generator/resources/xsd/database.xsd
old mode 100755
new mode 100644
diff --git a/library/propel/generator/resources/xsl/database.xsl b/library/propel/generator/resources/xsl/database.xsl
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/collection/PropelOnDemandIterator.php b/library/propel/runtime/lib/collection/PropelOnDemandIterator.php
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/formatter/ModelWith.php b/library/propel/runtime/lib/formatter/ModelWith.php
old mode 100755
new mode 100644
diff --git a/library/propel/runtime/lib/util/PropelAutoloader.php b/library/propel/runtime/lib/util/PropelAutoloader.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierWithScopeTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorQueryBuilderModifierWithScopeTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php b/library/propel/test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/NamespaceTest.php b/library/propel/test/testsuite/generator/builder/NamespaceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/om/OMBuilderNamespaceTest.php b/library/propel/test/testsuite/generator/builder/om/OMBuilderNamespaceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php b/library/propel/test/testsuite/generator/builder/om/QueryBuilderInheritanceTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/collection/PropelOnDemandIteratorTest.php b/library/propel/test/testsuite/runtime/collection/PropelOnDemandIteratorTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/formatter/PropelOnDemandFormatterWithTest.php b/library/propel/test/testsuite/runtime/formatter/PropelOnDemandFormatterWithTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/map/GeneratedRelationMapTest.php b/library/propel/test/testsuite/runtime/map/GeneratedRelationMapTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/map/RelatedMapSymmetricalTest.php b/library/propel/test/testsuite/runtime/map/RelatedMapSymmetricalTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/om/BaseObjectSerializeTest.php b/library/propel/test/testsuite/runtime/om/BaseObjectSerializeTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/om/BaseObjectTest.php b/library/propel/test/testsuite/runtime/om/BaseObjectTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/query/ModelCriteriaHooksTest.php b/library/propel/test/testsuite/runtime/query/ModelCriteriaHooksTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/query/ModelWithTest.php b/library/propel/test/testsuite/runtime/query/ModelWithTest.php
old mode 100755
new mode 100644
diff --git a/library/propel/test/testsuite/runtime/util/BasePeerExceptionsTest.php b/library/propel/test/testsuite/runtime/util/BasePeerExceptionsTest.php
old mode 100755
new mode 100644
diff --git a/public/.htaccess b/public/.htaccess
index 7fb009bfe..b19791a33 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -5,3 +5,5 @@ RewriteCond %{REQUEST_FILENAME} -l [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^.*$ - [NC,L]
 RewriteRule ^.*$ index.php [NC,L]
+RewriteBase /
+
diff --git a/python_apps/pypo/config.cfg.dist b/python_apps/pypo/config.cfg.dist
old mode 100755
new mode 100644
diff --git a/python_apps/pypo/dls/__init__.py b/python_apps/pypo/dls/__init__.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh b/python_apps/pypo/install/pypo-daemontools-liquidsoap.sh
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-daemontools-logger.sh b/python_apps/pypo/install/pypo-daemontools-logger.sh
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-daemontools.sh b/python_apps/pypo/install/pypo-daemontools.sh
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-install.py b/python_apps/pypo/install/pypo-install.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-start.py b/python_apps/pypo/install/pypo-start.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-stop.py b/python_apps/pypo/install/pypo-stop.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/install/pypo-uninstall.py b/python_apps/pypo/install/pypo-uninstall.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/pypo-cue-in-validator.py b/python_apps/pypo/pypo-cue-in-validator.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/scripts/library/liquidsoap.initd b/python_apps/pypo/scripts/library/liquidsoap.initd
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/test/airtime-schedule-insert.php b/python_apps/pypo/test/airtime-schedule-insert.php
index bc229dbd4..b69d009bb 100644
--- a/python_apps/pypo/test/airtime-schedule-insert.php
+++ b/python_apps/pypo/test/airtime-schedule-insert.php
@@ -1,17 +1,43 @@
 <?php
-require_once '../../application/configs/conf.php';
+
+// Define path to application directory
+define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../../application'));
+echo APPLICATION_PATH.PHP_EOL;
+
+// Ensure library/ is on include_path
+set_include_path(get_include_path() . PATH_SEPARATOR . realpath(APPLICATION_PATH . '/../library'));
+
+set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . '/models');
+echo get_include_path().PHP_EOL;
+
+//Pear classes.
+set_include_path(APPLICATION_PATH . get_include_path() . PATH_SEPARATOR . '/../library/pear');
+
+//Controller plugins.
+set_include_path(APPLICATION_PATH . get_include_path() . PATH_SEPARATOR . '/controllers/plugins');
+
+
+require_once APPLICATION_PATH.'/configs/conf.php';
 require_once 'DB.php';
-require_once '../../application/models/Playlist.php';
-require_once '../../application/models/StoredFile.php';
-require_once(__DIR__.'/../../library/propel/runtime/lib/Propel.php');
+require_once(APPLICATION_PATH.'/../library/propel/runtime/lib/Propel.php');
+
+require_once 'Soundcloud.php';
+require_once 'Playlist.php';
+require_once 'StoredFile.php';
+require_once 'Schedule.php';
+require_once 'Shows.php';
+require_once 'Users.php';
+require_once 'RabbitMq.php';
+require_once 'Preference.php';
+//require_once APPLICATION_PATH.'/controllers/plugins/RabbitMqPlugin.php';
+
 // Initialize Propel with the runtime configuration
-Propel::init(__DIR__."/../../application/configs/propel-config.php");
-// Add the generated 'classes' directory to the include path
-set_include_path(__DIR__."/../../application/models" . PATH_SEPARATOR . get_include_path());
+Propel::init(__DIR__."/../../../application/configs/airtime-conf.php");
+
 
 $dsn = $CC_CONFIG['dsn'];
 
-$CC_DBC = DB::connect($dsn, TRUE);
+$CC_DBC = DB::connect($dsn, FALSE);
 if (PEAR::isError($CC_DBC)) {
 	echo "ERROR: ".$CC_DBC->getMessage()." ".$CC_DBC->getUserInfo()."\n";
 	exit(1);
@@ -20,10 +46,10 @@ $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
 
 
 $playlistName = "pypo_playlist_test";
-$minutesFromNow = 1;
+$secondsFromNow = 30;
 
 echo " ************************************************************** \n";
-echo " This script schedules a playlist to play $minutesFromNow minute(s) from now.\n";
+echo " This script schedules a playlist to play $secondsFromNow minute(s) from now.\n";
 echo " This is a utility to help you debug the scheduler.\n";
 echo " ************************************************************** \n";
 echo "\n";
@@ -45,20 +71,7 @@ $pl->create($playlistName);
 $mediaFile = StoredFile::findByOriginalName("Peter_Rudenko_-_Opening.mp3");
 if (is_null($mediaFile)) {
     echo "Adding test audio clip to the database.\n";
-    $v = array("filepath" => __DIR__."/../../audio_samples/OpSound/Peter Rudenko - Opening.mp3");
-    $mediaFile = StoredFile::Insert($v);
-    if (PEAR::isError($mediaFile)) {
-    	var_dump($mediaFile);
-    	exit();
-    }
-}
-$pl->addAudioClip($mediaFile->getId());
-echo "done.\n";
-
-$mediaFile = StoredFile::findByOriginalName("Manolo Camp - Morning Coffee.mp3");
-if (is_null($mediaFile)) {
-    echo "Adding test audio clip to the database.\n";
-    $v = array("filepath" => __DIR__."/../../audio_samples/OpSound/Manolo Camp - Morning Coffee.mp3");
+    $v = array("filepath" => __DIR__."/../../../audio_samples/vorbis.com/Hydrate-Kenny_Beltrey.ogg");
     $mediaFile = StoredFile::Insert($v);
     if (PEAR::isError($mediaFile)) {
     	var_dump($mediaFile);
@@ -78,9 +91,9 @@ $startTime = date("Y-m-d H:i:s");
 $endTime = date("Y-m-d H:i:s", time()+(60*60));
 
 echo "Removing everything from the scheduler between $startTime and $endTime...";
-// Scheduler: remove any playlists for the next hour
-//Schedule::RemoveItemsInRange($startTime, $endTime);
-// Check for succcess
+
+
+// Check for succces
 $scheduleClear = Schedule::isScheduleEmptyInRange($startTime, "01:00:00");
 if (!$scheduleClear) {
     echo "\nERROR: Schedule could not be cleared.\n\n";
@@ -92,8 +105,15 @@ echo "done.\n";
 // Schedule the playlist for two minutes from now
 echo "Scheduling new playlist...\n";
 //$playTime = date("Y-m-d H:i:s", time()+(60*$minutesFromNow));
-$playTime = date("Y-m-d H:i:s", time()+(20*$minutesFromNow));
-$scheduleGroup = new ScheduleGroup();
-$scheduleGroup->add($playTime, null, $pl->getId());
+$playTime = date("Y-m-d H:i:s", time()+($secondsFromNow));
+
+//$scheduleGroup = new ScheduleGroup();
+//$scheduleGroup->add($playTime, null, $pl->getId());
+
+//$show = new ShowInstance($showInstanceId);
+//$show->scheduleShow(array($pl->getId()));
+
+//$show->setShowStart();
+//$show->setShowEnd();
 
 echo " SUCCESS: Playlist scheduled at $playTime\n\n";
diff --git a/python_apps/pypo/util/__init__.py b/python_apps/pypo/util/__init__.py
old mode 100644
new mode 100755
diff --git a/python_apps/pypo/util/status.py b/python_apps/pypo/util/status.py
old mode 100644
new mode 100755