From 44ff8f830f128680f3ffe0754987e4ab368691a0 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 26 Jan 2015 16:06:32 -0500 Subject: [PATCH 1/4] Fixed Amazon S3 Proxy class bug --- .../application/cloud_storage/Amazon_S3StorageBackend.php | 2 +- airtime_mvc/application/cloud_storage/ProxyStorageBackend.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php b/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php index 8565e4767..b878a4263 100644 --- a/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php +++ b/airtime_mvc/application/cloud_storage/Amazon_S3StorageBackend.php @@ -10,7 +10,7 @@ class Amazon_S3StorageBackend extends StorageBackend private $s3Client; - public function Amazon_S3($securityCredentials) + public function Amazon_S3StorageBackend($securityCredentials) { $this->setBucket($securityCredentials['bucket']); $this->setAccessKey($securityCredentials['api_key']); diff --git a/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php b/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php index 7843f9868..29f8a9caa 100644 --- a/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php +++ b/airtime_mvc/application/cloud_storage/ProxyStorageBackend.php @@ -25,7 +25,7 @@ class ProxyStorageBackend extends StorageBackend //the name of the class that implements it (eg. Amazon_S3), so we //can easily create the right backend object dynamically: if ($storageBackend == "amazon_S3") { - $this->storageBackend = new Amazon_S3StorageBackend($CC_CONFIG["Amazon_S3"]); + $this->storageBackend = new Amazon_S3StorageBackend($CC_CONFIG["amazon_S3"]); } else if ($storageBackend == "file") { $this->storageBackend = new FileStorageBackend(); } else { From 322d85931b27f24b53f1e8a9213303f9b97b75f1 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 26 Jan 2015 17:41:10 -0500 Subject: [PATCH 2/4] CC-5988 - Better error message & regex for Transition Fade field on stream settings page --- airtime_mvc/application/forms/LiveStreamingPreferences.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index 35b6909a9..a52a74222 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -29,8 +29,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade->setLabel(_("Switch Transition Fade (s)")) ->setFilters(array('StringTrim')) - ->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,3})?$/', - 'messages' => _('enter a time in seconds 0{.000}'))) + ->addValidator('regex', false, array('/^\d+(\.\d+)?$/', + 'messages' => _('Please enter a time in seconds (eg. 0.5)'))) ->setValue($defaultFade) ->setDecorators(array('ViewHelper')); $this->addElement($transition_fade); From e3165a12c33d3017fb0dad88fc5ea86ab78aab9e Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 26 Jan 2015 17:49:58 -0500 Subject: [PATCH 3/4] Regex tweak --- airtime_mvc/application/forms/LiveStreamingPreferences.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index a52a74222..46194472e 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -29,7 +29,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade->setLabel(_("Switch Transition Fade (s)")) ->setFilters(array('StringTrim')) - ->addValidator('regex', false, array('/^\d+(\.\d+)?$/', + ->addValidator('regex', false, array('/^\d*(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)'))) ->setValue($defaultFade) ->setDecorators(array('ViewHelper')); From 648198b3e67559176f5fe3fb62c237535ac343ff Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 27 Jan 2015 10:53:58 -0500 Subject: [PATCH 4/4] Fixed unit tests by including the vendor directory for propel files, and the cloud_storage directory --- airtime_mvc/tests/application/bootstrap.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/tests/application/bootstrap.php b/airtime_mvc/tests/application/bootstrap.php index 9852bab8e..1de69efaa 100644 --- a/airtime_mvc/tests/application/bootstrap.php +++ b/airtime_mvc/tests/application/bootstrap.php @@ -21,9 +21,15 @@ set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library') ))); +// Ensure vendor/ is on the include path set_include_path(implode(PATH_SEPARATOR, array( get_include_path(), - realpath(APPLICATION_PATH . '/../library/propel/runtime/lib') + realpath(APPLICATION_PATH . '/../../vendor') +))); + +set_include_path(implode(PATH_SEPARATOR, array( + get_include_path(), + realpath(APPLICATION_PATH . '/../../vendor/propel/propel1/runtime/lib') ))); // Ensure library/ is on include_path @@ -58,6 +64,9 @@ set_include_path(APPLICATION_PATH . '/../tests/application/testdata' . PATH_SEPA //helper functions set_include_path(APPLICATION_PATH . '/../tests/application/helpers' . PATH_SEPARATOR . get_include_path()); +//cloud storage files +set_include_path(APPLICATION_PATH . '/cloud_storage' . PATH_SEPARATOR . get_include_path()); + //Zend framework if (file_exists('/usr/share/php/libzend-framework-php')) { set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path()); @@ -68,7 +77,7 @@ require_once 'Zend/Application.php'; require_once 'Zend/Config.php'; require_once APPLICATION_PATH.'/configs/conf.php'; -require_once 'propel/runtime/lib/Propel.php'; +require_once 'propel/propel1/runtime/lib/Propel.php'; Propel::init("../application/configs/airtime-conf-production.php"); require_once 'Zend/Session.php';