forked from sourcefabric/airtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
soundcloud-uploader.php
39 lines (30 loc) · 1.31 KB
/
soundcloud-uploader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
date_default_timezone_set("UTC");
$webRoot = apache_getenv("DOCUMENT_ROOT");
//require_once $webRoot . "/../application/configs/conf.php";
//$CC_CONFIG = Config::getConfig();
require_once($webRoot.'/application/configs/constants.php');
require_once($webRoot.'/application/configs/conf.php');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
realpath($webRoot . '/library')
)));
require_once($webRoot.'/application/common/Database.php');
require_once($webRoot.'/application/models/StoredFile.php');
require_once($webRoot.'/application/models/Preference.php');
require_once($webRoot.'/application/models/MusicDir.php');
require_once($webRoot.'/application/common/OsPath.php');
set_include_path($webRoot.'/library' . PATH_SEPARATOR . get_include_path());
require_once($webRoot.'/application/models/Soundcloud.php');
set_include_path($webRoot."/application/models" . PATH_SEPARATOR . get_include_path());
require_once 'propel/runtime/lib/Propel.php';
Propel::init($webRoot."/application/configs/airtime-conf-production.php");
if(count($argv) != 2){
exit;
}
$id = $argv[1];
$file = Application_Model_StoredFile::RecallById($id);
// set id with -2 which is indicator for processing
$file->setSoundCloudFileId(SOUNDCLOUD_PROGRESS);
$file->uploadToSoundCloud();