Commit Graph

27 Commits

Author SHA1 Message Date
Lucas Bickel 2a53241ba3 Whitespace and deadcode nitpick 2017-03-10 16:27:46 +01:00
Robb Ebright 32a1a66378 Added AutoPlaylist Functionality to Show Scheduler enabling shows to have tracks added automatically. 2017-03-10 15:33:32 +01:00
Lucas Bickel 09aea8b747 stop using reflection in prooduction code
Problem: Reflection is a debugging tool and not really meant for use on production. There are easier ways to check if a class implements an interface with `is_a()`.

Solution: Get rid of reflection use and switch to `is_a()` in TaskManager, refactor the Enum thing that does not make sense since it is not being used.

The `is_a()` solution is really straightforward and has been supported in php for ages.

The Enum thing was a copy paste hack from stackoverflow and ignored the simple solution mentioned there while not using the features of the advanced one.
2017-03-03 22:48:19 +01:00
Lucas Bickel 625f92fe44 Vendorize ZF1, fix PHPUnit and configure travis
This a a rather large commit due to the nature of the stuff it is touching. To get PHPUnit up and running again I had to update some deps and I did so by vendorizing them. The vendorizing of zf1 makes sense since distros are already considering to drop it from their repos.

* [x] install vendorized zf1 with composer
* [x] load composer autoloader before zf1
* [x] Implement headAction for all Zend_Rest_Controller based controllers
* [x] switch to yml dataset to get around string only limitations of xml sets (also removed warning in readme)
* [x] use year 2044 as hardcoded date for tests since it is in the future and has the same days like previously used 2016
* [x] make tests easier to run when accessing phpunit directly
* [x] clean up test helper to always use airtime.conf
* [x] switch test dbname to libretime_test
* [x] test db username password switched to libretime/libretime
* [x] install phpunit with composer in a clear version (make tests easier to reproduce on other platforms)
* [x] remove local libs from airtime repo (most of airtime_mvc/library was not needed of in vendor already)
* [x] configure composer autoloading and use it (also removed requires that are not needed anymore)
* [x] add LibreTime prefix for FileNotFoundException (phing had a similar class and these are all pre-namespace style)
* [x] add .travis.yml file
* [x] make etc and logdir configurable with LIBRETIME_CONF_DIR and LIBRETIME_LOG_DIR env (so travis can change it)
* [x] slight cleanup in config for travis not to fail
* [x] add cloud_storage.conf for during test runs
* [x] rewrite mvc testing docs and move them to docs/ folder
* [x] don't use `static::class` in a class that does not have a parent class, use `__CLASS__` instead.
* [x] don't use `<ClassName>::class`, since we already know what class we want `"<ClassName>"` ist just fine.
* [x] fix "can't use method in write context" errors on 5.4 (also helps the optimizer)
* [x] add build status badge on main README.md

Fixes https://github.com/LibreTime/libretime/issues/4

The PHP parts of https://github.com/LibreTime/libretime/pull/10 get obsoleted by this change and it will need rebasing.

This also contains https://github.com/LibreTime/libretime/pull/8, the late static binding compat code was broken for no reason and until CentOS drops php 5.4 there is no reason I'm aware of not to support it. I inlined #8 since the test would be failing on php 5.4 without the change.

If you want to run tests you need to run `composer install` in the root directory and then `cd airtime_mvc/tests && ../../vendor/bin/phpunit`. For the tests to run the user `libretime` needs to be allowed to create the `libretime_test` database. See `docs/TESTING.md` for more info on getting set up.
2017-02-27 17:59:01 +01:00
Duncan Sommerville eff7cd2f07 Fix bug in podcast download 2015-11-27 16:48:44 -05:00
Duncan Sommerville 6c2d1f008b SAAS-1229 - initial work on bandwidth limit within Airtime; overhaul TaskFactory to get tasks reflectively 2015-11-19 16:08:25 -05:00
Duncan Sommerville c12848b2de * SAAS-1212 - fix validation errors in station podcast rss
* Append podcast title to heading in episodes view
2015-11-17 12:26:21 -05:00
Duncan Sommerville 0360b5e460 * SAAS-1182 - added sanity checks and additional logic to rss import and episode generation
* SAAS-1184 - started work on podcast UI polishing
* Fixed pull request issues
2015-11-09 18:17:49 -05:00
Duncan Sommerville 4f281a30ed Add SoundCloud update and download tasks to Celery backend; requires airtime-celery reinstall 2015-10-30 16:10:16 -04:00
Duncan Sommerville e3feb17f0c * Change the Celery timeout to 15 minutes (from 10) to better accommodate automatic ingest
* Fix various small bugs in auto ingestion and tab implementation
* Update TaskManager run conditions to piggyback on API calls - guarantees a certain frequency of requests and greatly reduces chances of lock contention
2015-10-29 17:53:45 -04:00
Duncan Sommerville ada7212823 Add TaskManager task to fail pending imports over an hour old 2015-10-29 11:03:28 -04:00
Duncan Sommerville cd17a23d13 Fix download counter reset timer 2015-10-29 09:23:41 -04:00
Duncan Sommerville 6580c12ad3 Add station podcast privacy toggle 2015-10-21 17:30:24 -04:00
Duncan Sommerville 92ffa955c3 SAAS-1081 - implement station podcast download counter that resets monthly 2015-10-21 12:54:50 -04:00
Duncan Sommerville 12f6536e74 Merge branch 'saas-dev' into saas-dev-publishing
Conflicts:
	airtime_mvc/application/Bootstrap.php
	airtime_mvc/application/controllers/plugins/Acl_plugin.php
2015-10-19 16:18:19 -04:00
Duncan Sommerville bddc121c2d Initial work on automatic ingest for imported podcasts 2015-10-15 14:44:17 -04:00
Duncan Sommerville d09941dffa Set TaskManager run interval back to 30 seconds 2015-09-28 14:15:08 -04:00
Albert Santoni c03e9cbe9a SAAS-1085: Optimization - Don't start sessions unless we actually need them. 2015-09-25 10:41:51 -04:00
Duncan Sommerville ee1ceb9281 Update TaskManager to be a bit easier to extend 2015-09-22 20:21:19 -04:00
Duncan Sommerville 7b76c8d6d3 Rename CeleryService to avoid confusion; fix wording and reduce redundancy in task functions 2015-09-15 15:06:03 -04:00
Duncan Sommerville 04fe265538 Task manager update to run individual tasks 2015-06-30 11:46:58 -04:00
Duncan Sommerville 70f6cbbc71 Fixes to airtime-celery setup 2015-06-23 15:10:02 -04:00
Duncan Sommerville 76a7aa9a24 Fix SoundCloud and TaskManager bugs, switch tasks to use acks_late, and provide feedback from SoundCloud context menu items 2015-06-18 18:18:48 -04:00
Duncan Sommerville afb02301c1 SAAS-868 - Fixes for pull request #115 - https://github.com/sourcefabric/airtime/pull/115 2015-06-17 17:16:21 -04:00
Duncan Sommerville 27bebb9168 Remove logging statement 2015-06-17 13:09:56 -04:00
Duncan Sommerville 8d2e476ff1 SAAS-868 - Refactor third party + celery workflow, implement locking on TaskManager 2015-06-16 15:10:08 -04:00
Duncan Sommerville 3902c8c746 Add SoundCloud delete functionality and fixes; implement TaskManager to run background jobs 2015-06-15 15:12:37 -04:00